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