Remove expr/stmt (#5857)
This commit is contained in:
parent
52ff244d5d
commit
000b8afd26
168 changed files with 497 additions and 529 deletions
|
|
@ -105,10 +105,10 @@ proc pat2kind(pattern: string): FormulaKind =
|
|||
import macros
|
||||
|
||||
proc matchAgainst(n, pattern: NimNode): NimNode {.compileTime.} =
|
||||
template `@`(current, field: expr): expr =
|
||||
template `@`(current, field: untyped): untyped =
|
||||
newDotExpr(current, newIdentNode(astToStr(field)))
|
||||
|
||||
template `==@`(n, pattern: expr): expr =
|
||||
template `==@`(n, pattern: untyped): untyped =
|
||||
newCall("==", n@kind, newIdentNode($pat2kind($pattern.ident)))
|
||||
|
||||
case pattern.kind
|
||||
|
|
@ -126,7 +126,7 @@ proc matchAgainst(n, pattern: NimNode): NimNode {.compileTime.} =
|
|||
else:
|
||||
error "invalid pattern"
|
||||
|
||||
macro `=~` (n: Formula, pattern: expr): bool =
|
||||
macro `=~` (n: Formula, pattern: untyped): bool =
|
||||
result = matchAgainst(n, pattern)
|
||||
|
||||
proc isPolyTerm2(n: Formula): bool = n =~ c * x^c
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue