Show More
@@ -220,6 +220,8 except Exception: | |||||
220 | # for tokenizing blocks |
|
220 | # for tokenizing blocks | |
221 | COMMENT, INPUT, OUTPUT = range(3) |
|
221 | COMMENT, INPUT, OUTPUT = range(3) | |
222 |
|
222 | |||
|
223 | PSEUDO_DECORATORS = ["suppress", "verbatim", "savefig", "doctest"] | |||
|
224 | ||||
223 | #----------------------------------------------------------------------------- |
|
225 | #----------------------------------------------------------------------------- | |
224 | # Functions and class declarations |
|
226 | # Functions and class declarations | |
225 | #----------------------------------------------------------------------------- |
|
227 | #----------------------------------------------------------------------------- | |
@@ -263,11 +265,14 def block_parser(part, rgxin, rgxout, fmtin, fmtout): | |||||
263 | block.append((COMMENT, line)) |
|
265 | block.append((COMMENT, line)) | |
264 | continue |
|
266 | continue | |
265 |
|
267 | |||
266 | if line_stripped.startswith('@'): |
|
268 | if any( | |
267 | # Here is where we assume there is, at most, one decorator. |
|
269 | line_stripped.startswith('@' + pseudo_decorator) for pseudo_decorator in PSEUDO_DECORATORS | |
268 | # Might need to rethink this. |
|
270 | ): | |
269 |
decorator |
|
271 | if decorator: | |
270 | continue |
|
272 | raise RuntimeError("Applying multiple pseudo-decorators on one line is not supported") | |
|
273 | else: | |||
|
274 | decorator = line_stripped | |||
|
275 | continue | |||
271 |
|
276 | |||
272 | # does this look like an input line? |
|
277 | # does this look like an input line? | |
273 | matchin = rgxin.match(line) |
|
278 | matchin = rgxin.match(line) |
General Comments 0
You need to be logged in to leave comments.
Login now