File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,20 @@ class CommentSectionHeaderLexer(SectionHeaderLexer):
143
143
token_type = Token .COMMENT_HEADER
144
144
145
145
146
+ class ErrorSectionHeaderLexer (SectionHeaderLexer ):
147
+
148
+ def lex (self , ctx ):
149
+ self .statement [0 ].type = Token .ERROR
150
+ self .statement [0 ].error = (
151
+ "Unrecognized table header '%s'. Available headers for data: "
152
+ "'Setting(s)', 'Variable(s)', 'Test Case(s)', 'Task(s)' and "
153
+ "'Keyword(s)'. Use 'Comment(s)' to embedded additional data."
154
+ % self .statement [0 ].value .strip ('*' ).strip ()
155
+ )
156
+ for token in self .statement [1 :]:
157
+ token .type = Token .COMMENT
158
+
159
+
146
160
class CommentSectionLexer (SectionLexer ):
147
161
markers = ('Comment' , 'Comments' )
148
162
@@ -171,11 +185,7 @@ def handles(cls, statement):
171
185
return statement [0 ].value .startswith ('*' )
172
186
173
187
def lexer_classes (self ):
174
- return (ErrorLexer ,)
175
-
176
-
177
- class ErrorLexer (StatementLexer ):
178
- token_type = Token .ERROR
188
+ return (ErrorSectionHeaderLexer , CommentLexer )
179
189
180
190
181
191
class SettingSectionLexer (SectionLexer ):
You can’t perform that action at this time.
0 commit comments