(core) Raise syntax errors that Python can format nicely to show the location

Summary: Update _create_syntax_error_code to raise an error with similar arguments to the real arguments it already has, with our modifications.

Test Plan: Updated python unit tests

Reviewers: jarek, dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D3040
This commit is contained in:
Alex Hall
2021-09-24 15:06:39 +02:00
parent fb583f303a
commit 52fd28815e
6 changed files with 64 additions and 16 deletions

View File

@@ -63,6 +63,6 @@ class Address:
def badSyntax(rec, table):
# for a in b
# 10
raise SyntaxError('invalid syntax on line 1 col 11')
raise SyntaxError('invalid syntax', ('usercode', 1, 11, u'for a in b'))
======================================================================
"""