diff --git a/.gitignore b/.gitignore index 4bafa794239d1c624d7f27175fd3b5ac4dc68ba1..910ab9fd37cc8903ca1e0c89b8e0452259b8ee44 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # Build files __pycache__ +_lextab.py +_parsetab.py lextab.py parser.out parsetab.py diff --git a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py index 9d23f78452460c13796d41abb3400c935ea1a49a..96778cadc63beb7454bd8d34d1ab8268486eb1e1 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Lexer.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Lexer.py @@ -222,6 +222,7 @@ class GcodeLexerMixin: module=self, reflags=int(re.VERBOSE + re.IGNORECASE), optimize=1, + lextab='_lextab', **kwargs, ) diff --git a/PythonicGcodeMachine/Gcode/Rs274/Parser.py b/PythonicGcodeMachine/Gcode/Rs274/Parser.py index f35b280016de462669fd2b9616a40b49d4657a58..7db6675475150b4e2e80ad01149a18fe63cd1cfa 100644 --- a/PythonicGcodeMachine/Gcode/Rs274/Parser.py +++ b/PythonicGcodeMachine/Gcode/Rs274/Parser.py @@ -54,6 +54,8 @@ __all__ = [ #################################################################################################### +from pathlib import Path + # https://rply.readthedocs.io/en/latest/ from ply import yacc @@ -367,8 +369,10 @@ class GcodeParserMixin: self.tokens = self._lexer.tokens self._parser = yacc.yacc( module=self, - # debug=True, - optimize=0, + debug=False, + optimize=1, + tabmodule='_parsetab', + # outputdir=Path(__file__).parent.joinpath('ply'), ) ##############################################