示例#1
0
        private TexlNode ParseReplaceableExpr()
        {
            Contracts.Assert(_curs.TidCur == TokKind.ReplaceableLit);

            ReplaceableToken tok = _curs.TokMove().As <ReplaceableToken>();

            Contracts.AssertValue(tok);

            if (tok.Value.StartsWith(TexlLexer.LocalizedTokenDelimiterStr, StringComparison.OrdinalIgnoreCase) ||
                tok.Value.StartsWith(TexlLexer.ContextDependentTokenDelimiterStr, StringComparison.OrdinalIgnoreCase))
            {
                return(new ReplaceableNode(ref _idNext, tok));
            }

            return(CreateError(tok, TexlStrings.ErrBadToken));
        }
示例#2
0
 public ReplaceableNode(ref int idNext, ReplaceableToken tok)
     : base(ref idNext, tok, new SourceList(tok))
 {
     Value = tok.Value;
     Contracts.AssertValue(Value);
 }