Generate `data` fields for anonymous patterns
This commit is contained in:
parent
e8d1bf2c57
commit
a3c55238f5
|
@ -10,7 +10,7 @@ import std/[hashes, sequtils, strutils, sets, tables]
|
||||||
|
|
||||||
import compiler/[ast, idents, renderer, lineinfos]
|
import compiler/[ast, idents, renderer, lineinfos]
|
||||||
|
|
||||||
import ../preserves, ./schema, ./parse
|
import ../preserves, ./schema
|
||||||
|
|
||||||
type
|
type
|
||||||
Bundle = schema.Bundle[void]
|
Bundle = schema.Bundle[void]
|
||||||
|
@ -487,8 +487,7 @@ proc addFields(recList: PNode; scm: Schema; known: var TypeTable; cp: CompoundPa
|
||||||
proc addFields(recList: PNode; scm: Schema; known: var TypeTable; pat: Pattern; parentName: string): PNode {.discardable.} =
|
proc addFields(recList: PNode; scm: Schema; known: var TypeTable; pat: Pattern; parentName: string): PNode {.discardable.} =
|
||||||
case pat.orKind
|
case pat.orKind
|
||||||
of PatternKind.SimplePattern:
|
of PatternKind.SimplePattern:
|
||||||
raiseAssert "addFields called with SimplePattern " #& $pat.simplePattern
|
addField(recList, scm, known, pat.simplePattern, "data")
|
||||||
# addField(recList, scm, known, pat.simplePattern, "data")
|
|
||||||
of PatternKind.CompoundPattern:
|
of PatternKind.CompoundPattern:
|
||||||
discard addFields(recList, scm, known, pat.compoundPattern, parentName)
|
discard addFields(recList, scm, known, pat.compoundPattern, parentName)
|
||||||
reclist
|
reclist
|
||||||
|
|
|
@ -6,7 +6,7 @@ from std/os import absolutePath, isAbsolute, getCurrentDir, parentDir
|
||||||
|
|
||||||
import npeg
|
import npeg
|
||||||
|
|
||||||
import ../preserves, ./schema, ./parse, ./pegs
|
import ../preserves, ./schema, ./pegs
|
||||||
|
|
||||||
type
|
type
|
||||||
Value = Preserve[void]
|
Value = Preserve[void]
|
||||||
|
|
Loading…
Reference in New Issue