Skip to content

Commit aa9a9aa

Browse files
author
Laurent Pinson
committed
added #error directive
1 parent 2d05991 commit aa9a9aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pypreprocessor/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ def lexer(self, line):
317317
print('Warning trying to remove more blocks than present',
318318
self.input, self.__linenum)
319319

320+
elif self.__is_directive(line, 'error'):
321+
print('File: "' + self.input + '", line ' + str(self.__linenum + 1))
322+
print('Error directive reached')
323+
sys.exit(1)
324+
320325
else:
321326
# escapechar + space ==> comment
322327
# starts with #!/ ==> shebang

0 commit comments

Comments
 (0)