(def: unknown, ctx: BaseParseContext)
| 285 | } |
| 286 | |
| 287 | parseOwnDefinitionFormat(def: unknown, ctx: BaseParseContext): BaseRoot { |
| 288 | const isScopeAlias = ctx.alias && ctx.alias in this.aliases |
| 289 | |
| 290 | // if the definition being parsed is not a scope alias and is not a |
| 291 | // generic instantiation (i.e. opts don't include args), add `this` as a resolution. |
| 292 | |
| 293 | // if we're parsing a nested string, ctx.args will have already been set |
| 294 | if (!isScopeAlias && !ctx.args) ctx.args = { this: ctx.id } |
| 295 | |
| 296 | const result = parseInnerDefinition(def, ctx) |
| 297 | |
| 298 | if (isArray(result)) { |
| 299 | if (result[1] === "=") return throwParseError(shallowDefaultableMessage) |
| 300 | |
| 301 | if (result[1] === "?") return throwParseError(shallowOptionalMessage) |
| 302 | } |
| 303 | |
| 304 | return result |
| 305 | } |
| 306 | |
| 307 | unit: UnitTypeParser<$> = value => this.units([value]) as never |
| 308 |
no test coverage detected