Skip to content

Commit

Permalink
Fixed regex statements in parser
Browse files Browse the repository at this point in the history
This clears up a bunch of `DeprecationWarning`s in pytest
  • Loading branch information
iluvcapra committed Nov 6, 2022
1 parent fc2e823 commit 10c0e4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions ptulsconv/docparser/ptuls_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
fs = "\t"
rs = "\n"
block_ending = rs rs
string_value = ~"[^\t\n]*"
integer_value = ~"\d+"
float_value = ~"\d+(\.\d+)?"
isp = ~"[^\d\t\n]*"
string_value = ~r"[^\t\n]*"
integer_value = ~r"\d+"
float_value = ~r"\d+(\.\d+)?"
isp = ~r"[^\d\t\n]*"
""")
8 changes: 4 additions & 4 deletions ptulsconv/docparser/tagged_string_parser_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class TagPreModes(Enum):
key_tag = "[" key "]" word_sep?
short_tag = "$" key "=" word word_sep?
full_text_tag = "{" key "=" value "}" word_sep?
key = ~"[A-Za-z][A-Za-z0-9_]*"
value = ~"[^}]+"
key = ~r"[A-Za-z][A-Za-z0-9_]*"
value = ~r"[^}]+"
tag_junk = word word_sep?
word = ~"[^ \[\{\$][^ ]*"
word_sep = ~" +"
word = ~r"[^ \[\{\$][^ ]*"
word_sep = ~r" +"
modifier = ("@" / "&") word_sep?
"""
)
Expand Down

0 comments on commit 10c0e4f

Please sign in to comment.