<commit_before>#include "details/pass/build-ast-to-ir/scope.h"
#include "details/grammar/nany.h"

using namespace Yuni;





namespace Nany
{
namespace IR
{
namespace Producer
{

	bool Scope::visitASTExprTypeDecl(Node& node, LVID& localvar)
	{
		assert(node.rule == rgTypeDecl);
		localvar = 0;

		if (node.children.size() == 1)
		{
			auto& identifier = *(node.children[0]);
			if (identifier.children.empty())
			{
				if (identifier.text == "any") // no real information, already 'any'
				{
					localvar = LVID(-1);
					return true;
				}

				if (identifier.text == "void")
				{
					localvar = 0;
					return true;
				}
			}
			else
			{
				// anonymous / inline class definitnio
				if (identifier.rule == rgClass)
				{
					localvar = 2;
					return visitASTClass(identifier, &localvar);
				}
			}
		}

		IR::Producer::Scope scope{*this};
		OpcodeCodegenDisabler codegenDisabler{sequence()};
		return scope.visitASTExpr(node, localvar);
	}



	bool Scope::visitASTType(Node& node, LVID& localvar)
	{
		assert(node.rule == rgType);<commit_msg>disabled anonymous classes since not fully implemented<commit_after>#include "details/pass/build-ast-to-ir/scope.h"
#include "details/grammar/nany.h"

using namespace Yuni;





namespace Nany
{
namespace IR
{
namespace Producer
{

	bool Scope::visitASTExprTypeDecl(Node& node, LVID& localvar)
	{
		assert(node.rule == rgTypeDecl);
		localvar = 0;

		if (node.children.size() == 1)
		{
			auto& identifier = *(node.children[0]);
			if (identifier.children.empty())
			{
				if (identifier.text == "any") // no real information, already 'any'
				{
					localvar = LVID(-1);
					return true;
				}

				if (identifier.text == "void")
				{
					localvar = 0;
					return true;
				}
			}
			else
			{
				// anonymous / inline class definitnio
				if (identifier.rule == rgClass)
				{
					error(identifier) << "anonymous classes are not supported yet";
					return false;
					//localvar = 2;
					//return visitASTClass(identifier, &localvar);
				}
			}
		}

		IR::Producer::Scope scope{*this};
		OpcodeCodegenDisabler codegenDisabler{sequence()};
		return scope.visitASTExpr(node, localvar);
	}



	bool Scope::visitASTType(Node& node, LVID& localvar)
	{
		assert(node.rule == rgType);
{'fraction_non_alphanumeric': 0.13885180240320427, 'fraction_numerical': 0.0053404539385847796, 'mean_word_length': 3.065099457504521, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3435980', 'n_tokens_mistral': 956, 'n_tokens_neox': 761, 'n_words': 166}