Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
37717619
Commit
37717619
authored
8 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
Match single semi-colons as empty, not as a part of content.
/close
#39
parent
08c93906
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
parser.py
+3
-3
3 additions, 3 deletions
parser.py
server.py
+2
-2
2 additions, 2 deletions
server.py
with
5 additions
and
5 deletions
parser.py
+
3
−
3
View file @
37717619
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
server.py
+
2
−
2
View file @
37717619
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment