Schema: parse the embeddedType
This commit is contained in:
parent
b165c64475
commit
3606ce5459
|
@ -47,7 +47,7 @@ when isMainModule:
|
|||
scm = parsePreservesSchema(readFile(inputPath / filePath))
|
||||
path: ModulePath
|
||||
for e in split(dirPath, '/'):
|
||||
add(path, Symbol e)
|
||||
if e != "": add(path, Symbol e)
|
||||
add(path, Symbol fileName)
|
||||
bundle.modules[path] = scm
|
||||
if bundle.modules.len == 0:
|
||||
|
|
|
@ -70,7 +70,12 @@ const parser = peg("Schema", p: ParseState):
|
|||
Version <- "version" * S * >(*Digit):
|
||||
if parseInt($1) != 1: fail()
|
||||
|
||||
EmbeddedTypeName <- "embeddedType" * S * >("#f" | Ref)
|
||||
EmbeddedTypeName <- "embeddedType" * S * ("#f" | Ref):
|
||||
if capture.len == 1:
|
||||
var r = popStack()
|
||||
p.schema.embeddedType =
|
||||
EmbeddedTypeName(orKind: EmbeddedTypeNameKind.Ref)
|
||||
validate p.schema.embeddedType.`ref`.fromPreserve(r)
|
||||
|
||||
Include <- "include" * S * '"' * >(+Preserves.char) * '"':
|
||||
var path: string
|
||||
|
|
Loading…
Reference in New Issue