Closed milahu closed 2 years ago
before
NotImplementedError: pattern.
after
NotImplementedError: type = pattern. token = *o*
test
#!/usr/bin/env python import bashlex import sys input = """ case foo in *o*) echo yes;; *) echo no;; esac """ # workaround for https://github.com/idank/bashlex/issues/23 input = "{\n" + input + "\n}" try: parts = bashlex.parse(input) except Exception as e: if not hasattr(e, 'position'): raise e p = e.position print(input[(p - 100):p]) print('# ERROR ' + e.message) print(input[p:(p + 100)]) sys.exit(1) for ast in parts: print(ast.dump())
Can you please rearrange the commits? I think you just need two here (one for the tests and one for the parser).
Thanks! :-)
before
after
test