From e33d210a4a85e91abe04f1874f460b6e60c6b5e0 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 4 Jun 2016 12:33:35 +0800 Subject: Byte string literals in AST, infrastructure for coercions --- src/parse/expr.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/parse/expr.cpp') diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp index 37bc03e7..3dbdd1d3 100644 --- a/src/parse/expr.cpp +++ b/src/parse/expr.cpp @@ -1064,15 +1064,8 @@ ExprNodeP Parse_ExprVal(TokenStream& lex) return NEWNODE( AST::ExprNode_Float, tok.floatval(), tok.datatype() ); case TOK_STRING: return NEWNODE( AST::ExprNode_String, tok.str() ); - case TOK_BYTESTRING: { - ::std::vector items; - for(char b: tok.str()) { - items.push_back( NEWNODE( AST::ExprNode_Integer, b, CORETYPE_U8 ) ); - } - return NEWNODE( AST::ExprNode_Array, ::std::move(items) ); - } - // TODO: Correct type here - return NEWNODE( AST::ExprNode_String, tok.str() ); + case TOK_BYTESTRING: + return NEWNODE( AST::ExprNode_ByteString, tok.str() ); case TOK_RWORD_TRUE: return NEWNODE( AST::ExprNode_Bool, true ); case TOK_RWORD_FALSE: -- cgit v1.2.3