Closed hynek closed 12 months ago
What kind of error message would work for you here? It's tricky given the flexible nature of the lexing and parsing; the error message says what pattern couldn't be matched, and gives the text it failed to match against already...
Maybe an error message in general and not a traceback? It's kinda difficult to find the necessary info if you don't know what you're looking for.
Do you know how I could implement that? I can't think of a sensible way to originate this other than an exception....
Okay, don't think I can make the error message better, but I have fixed the bug with lexing fenced code blocks at the end of documents without newlines in https://github.com/simplistix/sybil/commit/a9c7c80422939794fd05045182225193241fb6bc
This took me a moment to figure out and I feel like the DX could be better.
If you have a file that doesn't have a final line feed like the following:
sybil.parsers.abstract.lexers.LexingException: Could not match '(?<=\n)
\\n' in /Users/hynek/FOSS/svcs/docs/integrations/index.md: E ':maxdepth: 1\n\nflask\npyramid\ncustom\n
'