( def: string, ctx: BaseParseContext )
| 19 | } from "./shift/operator/operator.ts" |
| 20 | |
| 21 | export const parseString = ( |
| 22 | def: string, |
| 23 | ctx: BaseParseContext |
| 24 | ): InnerParseResult => { |
| 25 | const aliasResolution = ctx.$.maybeResolveRoot(def) |
| 26 | if (aliasResolution) return aliasResolution |
| 27 | |
| 28 | if (def.endsWith("[]")) { |
| 29 | const possibleElementResolution = ctx.$.maybeResolveRoot(def.slice(0, -2)) |
| 30 | if (possibleElementResolution) return possibleElementResolution.array() |
| 31 | } |
| 32 | |
| 33 | const s = new RuntimeState(new Scanner(def), ctx) |
| 34 | |
| 35 | const node = fullStringParse(s) |
| 36 | |
| 37 | if (s.finalizer === ">") throwParseError(writeUnexpectedCharacterMessage(">")) |
| 38 | |
| 39 | return node |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Try to parse the definition from right to left using the most common syntax. |
no test coverage detected
searching dependent graphs…