2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit e5f8370f authored by di68kap's avatar di68kap
Browse files

transform.py: is_token function corrected

parent 1cf94671
......@@ -382,9 +382,8 @@ def is_token(context: List[Node], tokens: AbstractSet[str] = frozenset()) -> boo
return "".join(child.content for child in node.children[i:k])
return nd.content
node = context[-1]
return (node.parser.ptype == TOKEN_PTYPE
and ((not tokens or stripped(node) in tokens)
or (not node.parser.name and len(tokens) == 1 and ":" in tokens)))
return (node.parser.ptype == TOKEN_PTYPE and (not tokens or stripped(node) in tokens))
......@@ -231,7 +231,7 @@ class LaTeXGrammar(Grammar):
paragraph = Forward()
tabular_config = Forward()
text_element = Forward()
source_hash__ = "a078d3d46ee55a7543f37c62b3fb24a7"
source_hash__ = "96b3c5ce2f75505a279d4d27f7712323"
parser_initialization__ = "upon instantiation"
COMMENT__ = r'%.*'
WHITESPACE__ = r'[ \t]*(?:\n(?![ \t]*\n)[ \t]*)?'
......@@ -85,11 +85,11 @@ CFG_FILE_3 = r'''
class TestTestfiles:
def setup(self):
with open('configfile_test_1.ini', 'w') as f:
with open('configfile_test_1.ini', 'w', encoding="utf-8") as f:
with open('configfile_test_2.ini', 'w') as f:
with open('configfile_test_2.ini', 'w', encoding="utf-8") as f:
with open('configfile_test_3.ini', 'w') as f:
with open('configfile_test_3.ini', 'w', encoding="utf-8") as f:
def teardown(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment