refactor: restructure list/map compilation loops and extract syntax error tests
- Convert list() and map() compiler functions from if/do-while to do-while loops - Remove redundant empty literal handling by breaking on right bracket/brace - Add new test files for duplicate comma, duplicate trailing comma, and empty list/map with comma - Expand newlines test to cover trailing comma and empty list/map cases - Simplify trailing_comma tests by removing inline syntax error checks - Update Test.fail() to handle variable arguments without kwargs
This commit is contained in:
+4
-2
@@ -230,8 +230,10 @@ class Test:
|
||||
index += 1
|
||||
|
||||
|
||||
def fail(self, message, *args, **kwargs):
|
||||
self.failures.append(message.format(*args, **kwargs))
|
||||
def fail(self, message, *args):
|
||||
if args:
|
||||
message = message.format(*args)
|
||||
self.failures.append(message)
|
||||
|
||||
|
||||
def color_text(text, color):
|
||||
|
||||
Reference in New Issue
Block a user