コード例 #1
0
        private TypeIdentifierNode BindTypeIdentifier(SyntaxNode parent, Scanner <CommonTree> parentChildren)
        {
            if (parentChildren.Current.GetAstType() == AstType.None)
            {
                return(null);
            }

            return(CreateNode <TypeIdentifierNode>(parent, parentChildren, (node, children) =>
            {
                node.Text = _text.GetTextInRange(node.Range);

                if (!node.Text.CaseInsensitiveEquals("CustomEventName") && !node.Text.CaseInsensitiveEquals("ScriptEventName"))
                {
                    node.Range = new Range()
                    {
                        Start = new Position()
                        {
                            Character = node.CompilerNode.CharPositionInLine,
                            Line = node.CompilerNode.Line - 1
                        },
                        End = new Position()
                        {
                            Character = node.CompilerNode.CharPositionInLine + node.CompilerNode.Text.Length,
                            Line = node.CompilerNode.Line - 1
                        }
                    };

                    node.Text = _text.GetTextInRange(node.Range);
                }

                while (parentChildren.PeekType() == AstType.LeftBracket || parentChildren.PeekType() == AstType.RightBracket)
                {
                    node.IsArray = true;
                    parentChildren.Next();
                }
            }));
        }