Skip to content

Commit

Permalink
Test escape characters in string literals in macro args
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jan 28, 2025
1 parent 375adc6 commit b5d6ef3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/asm/string-literal-macro-arg.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
MACRO mac
println "\1"
println \1
ENDM
mac "hello \\\"\t\r\0\n\ ; comment
\wor\
ld"
mac """goodbye
cruel\ ; comment
\nworld"""
mac "\
9 changes: 9 additions & 0 deletions test/asm/string-literal-macro-arg.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error: string-literal-macro-arg.asm(6):
Illegal character escape 'w'
error: string-literal-macro-arg.asm(11):
Illegal character escape at end of input
error: string-literal-macro-arg.asm(11):
Unterminated string
error: string-literal-macro-arg.asm(11) -> string-literal-macro-arg.asm::mac(4):
Unterminated string
error: Assembly aborted (4 errors)!
Binary file added test/asm/string-literal-macro-arg.out
Binary file not shown.

0 comments on commit b5d6ef3

Please sign in to comment.