syndump: only text patterns

This commit is contained in:
Emery Hemingway 2023-08-25 20:11:24 +01:00
parent c08ed920b5
commit 3e5f791d70
1 changed files with 8 additions and 13 deletions

View File

@ -29,21 +29,16 @@ proc parsePattern(pr: Assertion): Pattern =
proc inputPattern: Pattern = proc inputPattern: Pattern =
var args = commandLineParams() var args = commandLineParams()
if args.len != 1: if args.len != 1 or args == @[""]:
quit "expected a single pattern argument" quit "expected a single pattern argument"
else: else:
var input = pop args var
if input == "": pr: Assertion
quit "expected Preserves Pattern on stdin" input = pop args
else: try: pr = parsePreserves(input, Cap)
var pr: Assertion except ValueError:
try: pr = decodePreserves(input, Cap) quit "failed to parse Preserves argument"
except ValueError: discard result = parsePattern(pr)
try: pr = parsePreserves(input, Cap)
except ValueError: discard
if pr.isFalse:
quit "failed to parse Preserves argument"
result = parsePattern(pr)
type DumpEntity {.final.} = ref object of Entity type DumpEntity {.final.} = ref object of Entity
assertions: Table[Handle, seq[Assertion]] assertions: Table[Handle, seq[Assertion]]