From 76127841e4323aadea1bede4e0e492f472787ad3 Mon Sep 17 00:00:00 2001 From: Fred Sonnenwald <142429179+fredsonnenwald@users.noreply.github.com> Date: Fri, 28 Mar 2025 14:12:06 +0000 Subject: [PATCH] Fix invalid escape sequence messages --- py_models_parser/grammar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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+ """