| 233 | }; |
| 234 | |
| 235 | static bool dm_namespace_source(char *out, size_t cap, size_t index, bool file_scoped) { |
| 236 | const char *recovery = dm_namespace_cases[index].recovery |
| 237 | ? "public class ParseEdge { unsafe void M(void* p) { " |
| 238 | "_r = ref *(int*)p; } }\n" |
| 239 | : ""; |
| 240 | int n = snprintf(out, cap, |
| 241 | "namespace %s%s" |
| 242 | "/// <summary><see cref=\"global::Good.Target\"/></summary>\n" |
| 243 | "public class FromBad { }\n" |
| 244 | "public class Hidden { }\n" |
| 245 | "%s%s", |
| 246 | dm_namespace_cases[index].name, file_scoped ? ";\n" : " {\n", recovery, |
| 247 | file_scoped ? "" : "}\n"); |
| 248 | return n >= 0 && (size_t)n < cap; |
| 249 | } |
| 250 | |
| 251 | /* Real parser inputs, including both AST and lexical recovery paths. Valid |
| 252 | * controls prevent treating every file with a parse error as unplaceable. */ |