mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-06-22 23:19:25 -04:00
Add tests, remove unused code, fix bugs
- Added tests for more error messages - Test the "go to reference" feature at every character index of every test case - Delete unused code and imports - Fix some bugs I found along the way
This commit is contained in:
parent
5b0f662478
commit
9b9fab832b
47 changed files with 140 additions and 190 deletions
|
@ -20,7 +20,8 @@
|
|||
import re
|
||||
from enum import Enum
|
||||
|
||||
from . import tokenizer, utils
|
||||
from . import tokenizer
|
||||
from .errors import CompilerBugError
|
||||
from .tokenizer import TokenType
|
||||
|
||||
OPENING_TOKENS = ("{", "[")
|
||||
|
@ -192,8 +193,8 @@ def format(data, tab_size=2, insert_space=True):
|
|||
|
||||
commit_current_line(LineType.COMMENT, newlines_before=newlines)
|
||||
|
||||
else:
|
||||
commit_current_line()
|
||||
else: # pragma: no cover
|
||||
raise CompilerBugError()
|
||||
|
||||
elif str_item == "(" and (
|
||||
re.match(r"^([A-Za-z_\-])+\s*\(", current_line) or watch_parentheses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue