Home | History | Annotate | Line # | Download | only in indent
lex_string.c revision 1.1
      1 /* $NetBSD: lex_string.c,v 1.1 2021/10/22 20:54:36 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 /* Concatenated string literals are separated with a single space. */
     32 #indent input
     33 char concat[] = "line 1\n"
     34 "line2"		"has"   "several""words\n";
     35 #indent end
     36 
     37 #indent run -di0
     38 char concat[] = "line 1\n"
     39 "line2" "has" "several" "words\n";
     40 #indent end
     41