<commit_before>using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using DotVVM.Framework.Compilation.Parser.Binding.Tokenizer;
using DotVVM.Framework.Compilation.Parser.Dothtml.Parser;
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace DotVVM.Framework.Compilation.Parser.Binding.Parser
{
    public class BindingParser : ParserBase<BindingToken, BindingTokenType>
    {
        public BindingParser() : base(BindingTokenType.WhiteSpace)
        {
        }

        public BindingParserNode ReadImportDirectiveValue()
        {
            var startIndex = CurrentIndex;
            var first = ReadNamespaceOrTypeName();

            if (Peek() != null)
            {
                var @operator = PeekOrFail().Type;
                if (@operator == BindingTokenType.AssignOperator)
                {
                    Read();
                    var second = ReadNamespaceOrTypeName();

                    if (first is SimpleNameBindingParserNode)
                    {
                        return CreateNode(new BinaryOperatorBindingParserNode(first, second, @operator), startIndex);
                    }
                    else
                    {
                        first.NodeErrors.Add("Only simple name is allowed as alias.");
                    }
                }
                else
                {
                    first.NodeErrors.Add($"Unexpected operator: {@operator}, expecting assignment (=).");
                }
            }
            return first;
        }

        public BindingParserNode ReadArrayInitializerValue()
        {
            var startIndex = CurrentIndex;
            SkipWhiteSpace();

            if (Peek() is BindingToken openBraceToken && openBraceToken.Type == BindingTokenType.OpenArrayBrace)
            {
                var initializerExpressions = new List<BindingParserNode>();
                Read();
                SkipWhiteSpace();
                initializerExpressions.Add(ReadArrayInitializerValue());
                SkipWhiteSpace();

                while (Peek() is BindingToken comma && comma.Type == BindingTokenType.Comma)
                {
                    Read();
                    SkipWhiteSpace();
                    initializerExpressions.Add(ReadArrayInitializerValue());
                }

                if(Peek() is BindingToken closeBraceToken && closeBraceToken.Type == BindingTokenType.CloseArrayBrace)
                {
                    Read();
                    SkipWhiteSpace();<commit_msg>Minor fixes to the parser.<commit_after>using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using DotVVM.Framework.Compilation.Parser.Binding.Tokenizer;
using DotVVM.Framework.Compilation.Parser.Dothtml.Parser;
using System.Reflection;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace DotVVM.Framework.Compilation.Parser.Binding.Parser
{
    public class BindingParser : ParserBase<BindingToken, BindingTokenType>
    {
        public BindingParser() : base(BindingTokenType.WhiteSpace)
        {
        }

        public BindingParserNode ReadImportDirectiveValue()
        {
            var startIndex = CurrentIndex;
            var first = ReadNamespaceOrTypeName();

            if (Peek() != null)
            {
                var @operator = PeekOrFail().Type;
                if (@operator == BindingTokenType.AssignOperator)
                {
                    Read();
                    var second = ReadNamespaceOrTypeName();

                    if (first is SimpleNameBindingParserNode)
                    {
                        return CreateNode(new BinaryOperatorBindingParserNode(first, second, @operator), startIndex);
                    }
                    else
                    {
                        first.NodeErrors.Add("Only simple name is allowed as alias.");
                    }
                }
                else
                {
                    first.NodeErrors.Add($"Unexpected operator: {@operator}, expecting assignment (=).");
                }
            }
            return first;
        }

        public BindingParserNode ReadArrayInitializerValue()
        {
            var startIndex = CurrentIndex;
            SkipWhiteSpace();

            if (PeekType() == BindingTokenType.OpenArrayBrace)
            {
                var initializerExpressions = new List<BindingParserNode>();
                Read();
                SkipWhiteSpace();
                initializerExpressions.Add(ReadArrayInitializerValue());
                SkipWhiteSpace();

                while (Peek() is BindingToken comma && comma.Type == BindingTokenType.Comma)
                {
                    Read();
                    SkipWhiteSpace();
                    initializerExpressions.Add(ReadArrayInitializerValue());
                    SkipWhiteSpace();
                }

                if(PeekType() == BindingTokenType.CloseArrayBrace)
                {
                    Read();
                    SkipWhiteSpace();
{'fraction_non_alphanumeric': 0.0820967431104259, 'fraction_numerical': 0.0, 'mean_word_length': 1.585949177877429, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6989651', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1127, 'n_words': 232}