diff options
author | jfalkenhagen <jfalkenhagen@uos.de> | 2020-07-16 16:39:19 +0200 |
---|---|---|
committer | jfalkenhagen <jfalkenhagen@uos.de> | 2020-07-16 16:39:19 +0200 |
commit | 98d23807e35cc211415c7e0c887f1b1b502f10e5 (patch) | |
tree | ebb649c585166e546dda704990ed4c5eeb95519f /lib/lex.py | |
parent | a00ffc0e32ddc72a8faceec4344432cdbf3b90c7 (diff) | |
parent | af4cc108b5c5132a991a2b83d258ed55e985936f (diff) |
Merge branch 'master' into janis
Diffstat (limited to 'lib/lex.py')
-rw-r--r-- | lib/lex.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,4 +1,7 @@ from .sly import Lexer, Parser +import logging + +logger = logging.getLogger(__name__) class TimedWordLexer(Lexer): @@ -38,7 +41,7 @@ class TimedSequenceLexer(Lexer): FUNCTIONSEP = r";" def error(self, t): - print("Illegal character '%s'" % t.value[0]) + logger.error("Illegal character '%s'" % t.value[0]) if t.value[0] == "{" and t.value.find("}"): self.index += 1 + t.value.find("}") else: @@ -153,11 +156,11 @@ class TimedSequenceParser(Parser): def error(self, p): if p: - print("Syntax error at token", p.type) + logger.error("Syntax error at token", p.type) # Just discard the token and tell the parser it's okay. self.errok() else: - print("Syntax error at EOF") + logger.error("Syntax error at EOF") class TimedWord: |