Skip to content

Commit 44eb93a

Browse files
committed
Allow extra space at the beginning of the GRAMMAR #8
1 parent 38d3670 commit 44eb93a

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

simplepeg/speg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def noop(self, node):
5454
return node
5555

5656
def peg(self, node):
57-
return node.children[2]
57+
return node.children[3]
5858

5959
def parsing_body(self, node):
6060
node.children = [child.children[0] for child in node.children]

simplepeg/speg_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
def peg():
55
return rd.action('peg', rd.sequence([
6+
rd.zero_or_more(_()),
67
parsing_header(),
78
rd.one_or_more(_()),
89
parsing_body(),
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
GRAMMAR url test ->"asda";newtest-> "sda";

0 commit comments

Comments
 (0)