?login_element?

Subversion Repositories NedoOS

Rev

Rev 126 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.     OUTPUT "new_apostrophe.bin"
  2.  
  3.     ; test new \0 escape for double quotes
  4.     db  "\0"
  5.  
  6.     ; test new stricter rules for not-escaping apostrophe strings
  7.     db  '\E', '\\'          ; test (4 bytes)
  8.     db  "\\E", "\\\\"       ; expected (emulating expected result in quotes)
  9.     db  '''''', '\', 0, ''  ; test (4 bytes) + warning
  10.     db  "''", "\\", 0       ; expected (emulating expected result in quotes)
  11.  
  12.     ; more tricky ones (putting stress also on line parsers and buffer readers)
  13.     db  '/**/''/**/''\n\\''\"'''
  14.     db  "/**/'/**/'\\n\\\\'\\\"'"    ; expected
  15.  
  16.    db  "\"" : db 0
  17.    db  '\' : db 1
  18.    db  '\\' : db 2
  19.    db  '' : db 3           ; warning empty string + error no arguments
  20.    db  '''' : db 4
  21.  
  22.    dw  'ABCD', 'ABCDEFGHXX'; regular value check warnings + string literal overflow
  23.    dw  "ABCD", "ABCDEFGHXX"; regular value check warnings + string literal overflow
  24.  
  25.    ;; exercise remaining escape sequences inside apostrophes (shouldn't be escaped)
  26.     db  '\A', '\B', '\D', '\E'      ; verify nothing leaks into comments
  27.     db  '\F', '\N', '\R', '\T'      ; verify nothing leaks into comments
  28.     db  '\\', '\"', '\?', '"\'      ; verify nothing leaks into comments
  29.     db  '\0', '\'''                 ; verify nothing leaks into comments
  30.     db  "\n"
  31.  
  32.     ;; Example about string literals from documentation
  33.     BYTE "stringconstant\n" ; escape sequence assembles to newline
  34.     BYTE 'stringconstant\n' ; \n assembles literally as two bytes: '\', 'n'
  35.     LD HL,'hl'  ; hl = 0x686C = 'l', 'h'
  36.     LD HL,"hl"  ; hl = 0x686C = 'l', 'h'
  37.     LD A,"7"    ; not recommended (but works)
  38.     LD A,'8'    ; recommended
  39.     LD A,'\E'   ; warning + truncating value to 'E' (0x45)
  40.     LD A,'"'    ; A = 0x22
  41.     LD A,"'"    ; A = 0x27
  42.     LD A,''''   ; A = 0x27 ; since v1.11
  43.