Skip to content

Commit 9b29b7f

Browse files
committed
Handle test/kw names followed by data
1 parent c24647b commit 9b29b7f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/robot/parsing/lexer/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,18 @@ def get_tokens(self):
4646
else:
4747
ignore = {Token.IGNORE}
4848
for statement in self._handle_old_for(self.statements):
49+
name_eos = None
4950
for token in statement:
50-
if token.type not in ignore:
51-
yield token
51+
if token.type in ignore:
52+
continue
53+
if name_eos:
54+
yield name_eos
55+
name_eos = None
56+
if token.type == Token.NAME:
57+
name_eos = Token(Token.EOS,
58+
lineno=token.lineno,
59+
columnno=token.columnno + len(token.value))
60+
yield token
5261
yield Token(Token.EOS,
5362
lineno=token.lineno,
5463
columnno=token.columnno + len(token.value))

0 commit comments

Comments
 (0)