Exemplo n.º 1
0
        private LiteralExpressionNode ParseBoolLiteral()
        {
            var isTrue       = Current.Kind == TokenKind.TrueKeyword;
            var keywordToken = isTrue ? MatchToken(TokenKind.TrueKeyword) : MatchToken(TokenKind.FalseKeyword);

            return(LiteralExpressionNode.MakeBoolLiteral(keywordToken, isTrue));
        }
Exemplo n.º 2
0
        private LiteralExpressionNode ParseStringLiteral()
        {
            _ = MatchToken(TokenKind.DoubleQuote);
            var token = MatchToken(TokenKind.StringLiteral);

            _ = MatchToken(TokenKind.DoubleQuote);
            return(LiteralExpressionNode.MakeStringLiteral(token));
        }
Exemplo n.º 3
0
        private LiteralExpressionNode ParseDoubleLiteral()
        {
            var token = MatchToken(TokenKind.DoubleLiteral);

            return(LiteralExpressionNode.MakeDoubleLiteral(token));
        }