A dotted library name (`app.named`), as the words and dots it is written with.
(tokens: readonly DirectiveToken[])
| 239 | |
| 240 | /** A dotted library name (`app.named`), as the words and dots it is written with. */ |
| 241 | function dottedName(tokens: readonly DirectiveToken[]): string | null { |
| 242 | let name = ''; |
| 243 | for (const t of tokens) { |
| 244 | if (t.kind === 'word' || (t.kind === 'punctuation' && t.value === '.')) name += t.value; |
| 245 | else return null; |
| 246 | } |
| 247 | return name; |
| 248 | } |
| 249 | |
| 250 | /** Record the directive `keyword` with `tokens` in `out`; false when the tokens are no such directive. */ |
| 251 | function addDirective(out: DartDirectives, keyword: string, tokens: DirectiveToken[]): boolean { |