(descriptor: SchemaAST.ConstructorDescriptor, compile: Compiler)
| 1069 | } |
| 1070 | |
| 1071 | function makeConstructorParser(descriptor: SchemaAST.ConstructorDescriptor, compile: Compiler): Parser { |
| 1072 | let sourceParser: Parser |
| 1073 | return (input, options) => { |
| 1074 | if (input === InternalParser.missing) return InternalParser.missingExit |
| 1075 | if (descriptor.isConstructed(input)) return InternalParser.sameExit |
| 1076 | const result = (sourceParser ??= compile(descriptor.link.to))(input, options) |
| 1077 | return applyTransformation(result, input, descriptor.link.transformation, options) |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | function makeParser( |
| 1082 | ast: SchemaAST.AST, |
no test coverage detected