(written: string)
| 130 | const idPrefixes: PartialRecord<string, string> = Object.create(null) |
| 131 | |
| 132 | const idPrefixOf = (written: string): string => { |
| 133 | let prefix = written.replace(/[^\w$]/g, "_") |
| 134 | if (!prefix || /^\d/.test(prefix)) prefix = `_${prefix}` |
| 135 | if (/\d$/.test(prefix)) prefix += "_" |
| 136 | return prefix |
| 137 | } |
| 138 | |
| 139 | export const parseNode = (ctx: NodeParseContext): BaseNode => { |
| 140 | const impl = nodeImplementationsByKind[ctx.kind] |
no test coverage detected