1 /* $NetBSD: lex_string.c,v 1.4 2022/04/24 09:04:12 rillig Exp $ */ 2 3 /* 4 * Test lexing of string literals. 5 */ 6 7 //indent input 8 char simple[] = "x"; 9 char multi[] = "xy"; 10 char empty[] = ""; 11 char null[] = "\0"; 12 char escape_hex[] = "\x3f"; 13 char escape_octal[] = "\040"; 14 char escape_a[] = "\a"; 15 char escape_b[] = "\b"; 16 char escape_f[] = "\f"; 17 char escape_n[] = "\n"; 18 char escape_t[] = "\t"; 19 char escape_v[] = "\v"; 20 char escape_single_quote[] = "\'"; 21 char escape_double_quote[] = "\""; 22 char escape_backslash[] = "\\"; 23 24 char escape_newline[] = "\ 25 "; 26 //indent end 27 28 //indent run-equals-input -di0 29 30 31 /* 32 * Concatenated string literals are separated with a single space. 33 */ 34 //indent input 35 char concat[] = "line 1\n" 36 "line2" "has" "several""words\n"; 37 //indent end 38 39 //indent run -di0 40 char concat[] = "line 1\n" 41 "line2" "has" "several" "words\n"; 42 //indent end 43