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