A variable's value as make reads it: each backslash-newline, with the * blanks around it, is one space (a value expanded into a recipe line adds * no lines). */
| 3055 | * blanks around it, is one space (a value expanded into a recipe line adds |
| 3056 | * no lines). */ |
| 3057 | static const char *mk_fold(CBMArena *a, const char *p, size_t n) { |
| 3058 | char *out = cbm_arena_alloc(a, n + SKIP_ONE); |
| 3059 | if (!out) { |
| 3060 | return NULL; |
| 3061 | } |
| 3062 | size_t o = 0; |
| 3063 | for (size_t i = 0; i < n; i++) { |
| 3064 | size_t k = i + SKIP_ONE; |
| 3065 | k += k < n && p[k] == '\r'; |
| 3066 | if (p[i] != '\\' || k >= n || p[k] != '\n') { |
| 3067 | out[o++] = p[i]; |
| 3068 | continue; |
| 3069 | } |
| 3070 | while (o > 0 && (out[o - SKIP_ONE] == ' ' || out[o - SKIP_ONE] == '\t')) { |
| 3071 | o--; |
| 3072 | } |
| 3073 | out[o++] = ' '; |
| 3074 | i = k; |
| 3075 | while (i + SKIP_ONE < n && (p[i + SKIP_ONE] == ' ' || p[i + SKIP_ONE] == '\t')) { |
| 3076 | i++; |
| 3077 | } |
| 3078 | } |
| 3079 | return mk_trim(a, out, o); |
| 3080 | } |
| 3081 | |
| 3082 | static void mk_assign(mk_t *m, TSNode n, bool cond) { |
| 3083 | TSNode name = ts_node_child_by_field_name(n, TS_FIELD("name")); |
no test coverage detected