mappyfile icon indicating copy to clipboard operation
mappyfile copied to clipboard

Missing end

Open zsiki opened this issue 7 years ago • 2 comments

I've tested this nice project. I commented out an "END" at the middle of a map file and got "recursion depth" error, the trace log is very long, last few lines (the same messages are repeated): File "/usr/lib/python2.7/functools.py", line 87, in lt return mycmp(self.obj, other.obj) < 0 File "/usr/local/lib/python2.7/dist-packages/lark/parsers/earley.py", line 257, in _compare_drv c = _compare_drv(t1, t2) File "/usr/local/lib/python2.7/dist-packages/lark/parsers/earley.py", line 247, in _compare_drv _resolve_ambig(tree1) File "/usr/local/lib/python2.7/dist-packages/lark/parsers/earley.py", line 267, in _resolve_ambig best = min(tree.children, key=cmp_to_key(_compare_drv)) File "/usr/lib/python2.7/functools.py", line 87, in lt return mycmp(self.obj, other.obj) < 0 File "/usr/local/lib/python2.7/dist-packages/lark/parsers/earley.py", line 257, in _compare_drv c = _compare_drv(t1, t2) File "/usr/local/lib/python2.7/dist-packages/lark/parsers/earley.py", line 234, in _compare_drv if not (isinstance(tree1, Tree) and isinstance(tree2, Tree)): RuntimeError: maximum recursion depth exceeded while calling a Python object

I attach the file (see the commented line at 3000) (renamed to txt because of the github limitation) x201703.txt

zsiki avatar Jul 21 '17 18:07 zsiki

It would be nice to get a message: missing block end at line ...

zsiki avatar Jul 21 '17 19:07 zsiki

See attached differ.dif.txt

ghost avatar Jan 30 '22 16:01 ghost

@zsiki - testing this again on the latest versions of mappyfile gives a slightly better error message. I don't think the parser will ever be able to poinpoint the location of this missing END in the middle, but hopefully this error is slightly less cryptic. Closing this issue now, and thanks for using mappyfile!

Unexpected token Token('$END', '') at line 5174, column 1.
Expected one of: 
	* VALUES
	* VALIDATION
	* GRID
	* QUERYMAP
	* OUTPUTFORMAT
	* CONFIG
	* MAP
	* LEGEND
	* ...

geographika avatar Aug 19 '23 09:08 geographika