(preambleStr: string)
| 120 | } |
| 121 | |
| 122 | function extractDirectives(preambleStr: string) { |
| 123 | const map: Record<string, string> = {}; |
| 124 | for (const line of preambleStr.split(/\r?\n/)) { |
| 125 | const groups = line.match(directives)?.groups; |
| 126 | if (groups) { |
| 127 | if (!map[groups.name]) { |
| 128 | map[groups.name] = groups.value; |
| 129 | } |
| 130 | } else { |
| 131 | break; |
| 132 | } |
| 133 | } |
| 134 | return map; |
| 135 | } |
| 136 | |
| 137 | function extractInstructions(stageStr: string) { |
| 138 | return [...stageStr.matchAll(argEnvUserStatements)] |