kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

6_4_5_01_string_concat_expr.c (450B)


      1 /* Three-way adjacent string literal fusion per C11 §6.4.5 ¶5. Exercises
      2  * the loop in fetch_tok so a run longer than two pieces collapses into
      3  * one TOK_STR with the full concatenation as its spelling.
      4  *
      5  * Subscripting goes through a char[] (the direct-string-literal subscript
      6  * codegen path is separately limited at nonzero offsets). */
      7 int test_main(void) {
      8   char s[7] =
      9       "a"
     10       "bc"
     11       "def";
     12   return s[5]; /* 'f' = 102 */
     13 }