diff --git a/py_models_parser/grammar.py b/py_models_parser/grammar.py index 9f749f1..beaa809 100644 --- a/py_models_parser/grammar.py +++ b/py_models_parser/grammar.py @@ -4,7 +4,7 @@ r""" expr = (class / if_else/ call_result / return / comments / attr_def / emptyline / funct_def)* return = "return" (id* ","*)* - comments = "\#" (text / list) + comments = r"\#" (text / list) if_else= ("if" (compare/ id / attr_def) ":")/("elif" (id/attr_def) ":")/("else" ":") compare = (call_result / id / args /args_in_brackets ) operator (call_result/id/args_in_brackets/args) operator = "==" / "!=" / ">" / "<" / ">=" / "<=" @@ -25,7 +25,7 @@ class = class_def attr_def* funct_def* id = (((dot_id / text)+ ) * / dot_id / text) ws? dot_id = (text ".")*text intend = " " / "\t" / "\n" - text = !"class" ~"['_A-Z 0-9{}_\"\-\/\$<%>\+\-\w*&^%$#!±~`§]*"i + text = !"class" ~r"['_A-Z 0-9{}_\"\-\/\$<%>\+\-\w*&^%$#!±~`§]*"i ws = ~"\\s*" emptyline = ws+ """