예제 #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));
        }
예제 #2
0
        private LiteralExpressionNode ParseStringLiteral()
        {
            _ = MatchToken(TokenKind.DoubleQuote);
            var token = MatchToken(TokenKind.StringLiteral);

            _ = MatchToken(TokenKind.DoubleQuote);
            return(LiteralExpressionNode.MakeStringLiteral(token));
        }
예제 #3
0
        private LiteralExpressionNode ParseDoubleLiteral()
        {
            var token = MatchToken(TokenKind.DoubleLiteral);

            return(LiteralExpressionNode.MakeDoubleLiteral(token));
        }