Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
badw-it
DHParser
Commits
28abee18
Commit
28abee18
authored
Mar 29, 2018
by
di68kap
Browse files
- DHParser/testing.py: bugfix regular expresseion RE_ENTRY
parent
3fe280d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/testing.py
View file @
28abee18
...
...
@@ -80,14 +80,14 @@ UNIT_STAGES = {'match*', 'match', 'fail', 'ast', 'cst', '__ast__', '__cst__'}
# # print(json.dumps(unit, sort_keys=True, indent=4))
# return unit
RX_SECTION
=
re
.
compile
(
'\s*\[(?P<stage>\w+
\*?
):(?P<symbol>\w+)\]'
)
RX_SECTION
=
re
.
compile
(
'\s*\[(?P<stage>\w+):(?P<symbol>\w+)\]'
)
RE_VALUE
=
'(?:"""((?:.|
\n
)*?)""")|'
+
"(?:'''((?:.|
\n
)*?)''')|"
+
\
'(?:"(.*?)")|'
+
"(?:'(.*?)')|"
+
'(.*(?:
\n
(?:\s*
\n
)* .*)*)'
# the following does not work with pypy3, because pypy's re-engine does not
# support local flags, e.g. '(?s: )'
# RE_VALUE = '(?:"""((?s:.*?))""")|' + "(?:'''((?s:.*?))''')|" + \
# '(?:"(.*?)")|' + "(?:'(.*?)')|" + '(.*(?:\n(?:\s*\n)* .*)*)'
RX_ENTRY
=
re
.
compile
(
'\s*(\w+)\s*:\s*(?:{value})\s*'
.
format
(
value
=
RE_VALUE
))
RX_ENTRY
=
re
.
compile
(
'\s*(\w+
\*?
)\s*:\s*(?:{value})\s*'
.
format
(
value
=
RE_VALUE
))
RX_COMMENT
=
re
.
compile
(
'\s*#.*
\n
'
)
...
...
test/test_testing.py
View file @
28abee18
...
...
@@ -80,6 +80,9 @@ CFG_FILE_3 = r'''
Like this one.
21: \begin{enumerate}
[match:csttest]
M1*: """Trigger CST-output with an asterix!"""
'''
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment