Ejemplo n.º 1
0
 def __compile(self):
     # TODO: add support for comments in pattern
     parser = DisplayPatternParser(whitespace='')
     try:
         asts = parser.parse(self.__text, rule_name='start')
         self.sub_patterns = self.__compile_asts(asts)
         self.__text = None
     except BaseException as parsing_error:
         raise PatternCompileException(parsing_error.message)
Ejemplo n.º 2
0
 def __compile(self):
     # TODO: add support for comments in pattern
     parser = DisplayPatternParser(whitespace='')
     try:
         asts = parser.parse(self.__text, rule_name='start')
         self.sub_patterns = self.__compile_asts(asts)
         self.__text = None
     except BaseException as parsing_error:
         raise PatternCompileException(str(parsing_error))