Skip to content

Commit ed6e99e

Browse files
committed
modifier Option was missing.
1 parent 475fd02 commit ed6e99e

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.py[cod]
22
*.egg-info
3+
.ropeproject

nginxparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class NginxParser(object):
2424
block = Forward()
2525

2626
block << Group(
27-
Group(key + Optional(space + location))
27+
Group(key + Optional(space + modifier) + Optional(space + location))
2828
+ left_bracket
2929
+ Group(ZeroOrMore(Group(assignment) | block))
3030
+ right_bracket)

tests.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ class TestNginxParser(unittest.TestCase):
2525
}
2626
}
2727
28-
location ~ case_sensitive\.php$ {}
29-
location ~* case_insensitive\.php$ {}
30-
location = exact_match\.php$ {}
31-
location ^~ ignore_regex\.php$ {}
28+
location ~ case_sensitive\.php$ {
29+
hoge hoge;
30+
}
31+
location ~* case_insensitive\.php$ {}
32+
location = exact_match\.php$ {}
33+
location ^~ ignore_regex\.php$ {}
3234
3335
}'''
3436
}

0 commit comments

Comments
 (0)