Skip to content

Commit

Permalink
Fix and add tests for DUMP string
Browse files Browse the repository at this point in the history
  • Loading branch information
thelink2012 committed Sep 11, 2017
1 parent f43e35f commit 29584b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser_lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static void lex_dump(LexerContext& lexer, const char* begin, const char* end, si
// Parses a string
if(next_token->first[0] == '"')
{
it = lex_token(lexer, next_token->first, end, begin_pos);
it = lex_token(lexer, next_token->first, end, tok_begin);
continue;
}
else if((next_token->second % 2) != 0)
Expand Down
10 changes: 10 additions & 0 deletions test/codegen/dump.sc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,15 @@ DUMP
0300 060000
ENDDUMP

DUMP
// CHECK-NEXT-L: PRINT_WITH_2_NUMBERS_BIG 'TeST1234' 1011709285i32 107i8 108i8 17716i16
"m" 03 // 0x036D
"TeST1234" // ...
01 "euM<" // 01 0x3C4D7565
04 "k" // 04 0x6B
04 "l" // 04 0x6C
05 "4E" // 05 0x4534
ENDDUMP

// CHECK-NEXT-L: TERMINATE_THIS_SCRIPT
TERMINATE_THIS_SCRIPT

0 comments on commit 29584b3

Please sign in to comment.