Commit 37717619 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Match single semi-colons as empty, not as a part of content.

/close #39
parent 08c93906
......@@ -158,9 +158,9 @@ class Content(Element):
# v3: does not allow braces in the content
#PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)*);?"
# v4: do not allow empty match (require either the first or the second part to be non-empty)
#PATTERN = r"\s*(?<content>(?:(?:[^\[\];\r\n{}]+)|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+));?"
PATTERN = r"\s*(?<content>(?:(?:[^\[\];\r\n{}]+)|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+));?"
# v5: do match emptystring if followed by a semi colon
PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+);?|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+;?|;)"
#PATTERN = r"\s*(?<content>(?:[^\[\];\r\n{}]+);?|(?:[^\[\];\r\n{}]+)?(?:\[[^\]\r\n{}]+\][^;\[\]\r\n{}]*)+;?|;)"
class Text:
def __init__(self, text, linenumber, fork):
......@@ -271,7 +271,7 @@ class Empty(Element):
linenumber = Element.parse_inner(match, current, linenumber)
return current, linenumber
PATTERN = r"\s+"
PATTERN = r"(?:\s+|;)"
class Remark(Element):
def __init__(self, name, value, linenumber):
......
......@@ -114,7 +114,7 @@ def merge_todos():
@manager.command
def runserver():
app.run(host="192.168.0.13")
app.run()
make_scheduler()
# cause uwsgi currently has a bug
......@@ -536,7 +536,7 @@ def upload_source_to_known_protocol(protocol):
@login_required
def upload_new_protocol():
user = current_user()
available_types = ProtocolType.get_modifiable_protocoltypes()
available_types = ProtocolType.get_modifiable_protocoltypes(user)
form = NewProtocolSourceUploadForm(protocoltypes=available_types)
if form.validate_on_submit():
if form.source.data is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment