Skip to content

Commit

Permalink
Fixed bug where the end of the string was not matched
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Jun 28, 2021
1 parent 7ee915f commit 5738191
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/webqueue2api/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,9 @@ def error_handler(original_string, match_start_index, tokens):
(pp.Literal(action_end_delimiter) + pp.LineEnd()).suppress() +
pp.Group(
pp.SkipTo(
pp.Literal(reply_from_user_start_delimiter)
pp.Literal(reply_from_user_start_delimiter)
| pp.Literal(action_start_delimiter)
| pp.StringEnd()
)
) | pp.SkipTo(pp.StringEnd(), include=True)
).setResultsName("content")
).leaveWhitespace().setParseAction(parse_section_by_type("reply_to_user"))

Expand All @@ -231,8 +230,7 @@ def error_handler(original_string, match_start_index, tokens):
pp.SkipTo(
pp.Literal(reply_from_user_start_delimiter)
| pp.Literal(action_start_delimiter)
| pp.stringEnd()
)
) | pp.SkipTo(pp.StringEnd(), include=True)
).setResultsName("content")
).leaveWhitespace().setParseAction(parse_section_by_type("edit"))

Expand All @@ -244,10 +242,9 @@ def error_handler(original_string, match_start_index, tokens):
(pp.Literal(action_end_delimiter) + pp.LineEnd()).suppress() +
pp.Group(
pp.SkipTo(
pp.Literal(reply_from_user_start_delimiter)
pp.Literal(reply_from_user_start_delimiter)
| pp.Literal(action_start_delimiter)
| pp.StringEnd()
)
) | pp.SkipTo(pp.StringEnd(), include=True)
).setResultsName("content")
).leaveWhitespace().setParseAction(parse_section_by_type("status"))

Expand Down

0 comments on commit 5738191

Please sign in to comment.