コード例 #1
0
        public override TreeElement ParseErrorElement()
        {
            // NOTE: Doesn't Advance
            var result = TreeElementFactory.CreateErrorElement(ParserMessages.GetUnexpectedTokenMessage());

            return(result);
        }
コード例 #2
0
        public override void ParseErrorTexturePropertyBlockValues(CompositeElement result)
        {
            // Parse anything with the `{ }` of a texture property block
            if (myOriginalLexer.TokenType == ShaderLabTokenType.RBRACE)
            {
                return;
            }

            var errorElement = TreeElementFactory.CreateErrorElement(ParserMessages.GetUnexpectedTokenMessage());

            while (myOriginalLexer.TokenType != ShaderLabTokenType.RBRACE)
            {
                Skip(errorElement);
            }
            result.AppendNewChild(errorElement);
        }
コード例 #3
0
        public override TreeElement ParseErrorPropertyValue()
        {
            var result = TreeElementFactory.CreateErrorElement(ParserMessages.GetUnexpectedTokenMessage());

            // Consume until we hit either an identifier (start of another property)
            // an LBRACK (start of attributes for another property) or RBRACE
            while (!IsIdentifier(myOriginalLexer.TokenType) &&
                   myOriginalLexer.TokenType != ShaderLabTokenType.LBRACK &&
                   myOriginalLexer.TokenType != ShaderLabTokenType.RBRACE)
            {
                if (myOriginalLexer.TokenType == ShaderLabTokenType.LBRACE)
                {
                    SkipNestedBraces(result);
                }
                else
                {
                    Skip(result);
                }
            }
            return(result);
        }