File tree Expand file tree Collapse file tree 9 files changed +125
-113
lines changed Expand file tree Collapse file tree 9 files changed +125
-113
lines changed Original file line number Diff line number Diff line change 5757 output .info .description = description .join (' \n ' );
5858 }
5959
60+ info_title
61+ = '#'
62+ space ?
63+ title : content
64+ { return adjust (title); }
65+
66+
6067page
6168 = title : page_title
6269 description : description *
6976 });
7077 }
7178
79+ page_title
80+ = '##'
81+ space ?
82+ title : content
83+ break
84+ { return adjust (title); }
85+
86+
7287page_task
7388 = '+'
7489 space ?
@@ -81,32 +96,11 @@ page_task
8196 return task;
8297 }
8398
84- page_actions
85- = on_page_complete
86-
8799task_actions
88100 = test : task_test
89101 / hint : task_hint
90102 / action : task_action
91103
92- info_title
93- = '#'
94- space ?
95- title : content
96- { return adjust (title); }
97-
98- page_title
99- = '##'
100- space ?
101- title : content
102- break
103- { return adjust (title); }
104-
105- description
106- = description : content
107- break
108- { return adjust (description); }
109-
110104task_test
111105 = '@test'
112106 '('
@@ -126,6 +120,10 @@ task_hint
126120 }
127121
128122
123+ page_actions
124+ = on_page_complete
125+
126+
129127on_page_complete
130128 = '@onPageComplete'
131129 '('
@@ -145,6 +143,7 @@ page_import
145143 break
146144 { return filePath .join (' ' ); }
147145
146+
148147task_action
149148 = '@action'
150149 '('
@@ -203,6 +202,13 @@ action_write_from_file
203202 quote
204203 ')'
205204
205+
206+ description
207+ = description : content
208+ break
209+ { return adjust (description); }
210+
211+
206212content = [^#^@^+] [^\n ^\r ]+ [\n\r ]
207213space = [ \s ]
208214break = [\n\r ]?
File renamed without changes.
Original file line number Diff line number Diff line change 1+ info
2+ = title : info_title
3+ description : description *
4+ {
5+ output .info .title = title;
6+ output .info .description = description .join (' \n ' );
7+ }
8+
9+ info_title
10+ = '#'
11+ space ?
12+ title : content
13+ { return adjust (title); }
Original file line number Diff line number Diff line change 1+ page_actions
2+ = on_page_complete
3+
4+
5+ on_page_complete
6+ = '@onPageComplete'
7+ '('
8+ quote
9+ content : .+
10+ quote
11+ ')'
12+ { return { type: ' onPageComplete' , value: content .join (' ' ) }; }
13+
14+ page_import
15+ = '@import'
16+ '('
17+ quote
18+ filePath : file_path
19+ quote
20+ ')'
21+ break
22+ { return filePath .join (' ' ); }
Original file line number Diff line number Diff line change 1+ page_task
2+ = '+'
3+ space ?
4+ description : description
5+ actions : task_actions *
6+ break ?
7+
8+ { let task = { description, tests: [], hints: [] };
9+ actions .forEach (({type, value}) => task[type].push (value));
10+ return task;
11+ }
12+
13+ task_actions
14+ = test : task_test
15+ / hint : task_hint
16+ / action : task_action
17+
18+ task_test
19+ = '@test'
20+ '('
21+ quote
22+ testPath : [^\n ^\r ^\'\"\` )]+
23+ quote
24+ ')'
25+ break
26+ { return { type: ' tests' , value: testPath .join (' ' ) }; }
27+
28+ task_hint
29+ = '@hint'
30+ hint : [^\n ^\r ]+
31+ break
32+ { let h = trimBracketsAndQuotes (hint .join (' ' ));
33+ return { type: ' hints' , value: h };
34+ }
Original file line number Diff line number Diff line change 1+ page
2+ = title : page_title
3+ description : description *
4+ tasks : page_task *
5+ {
6+ output .pages .push ({
7+ title,
8+ description: description .join (' \n ' ),
9+ tasks,
10+ });
11+ }
12+
13+ page_title
14+ = '##'
15+ space ?
16+ title : content
17+ break
18+ { return adjust (title); }
Original file line number Diff line number Diff line change 1+ description
2+ = description : content
3+ break
4+ { return adjust (description); }
Original file line number Diff line number Diff line change 2121 break ?
2222 page *
2323
24- info
25- = title : info_title
26- description : description *
27- {
28- output .info .title = title;
29- output .info .description = description .join (' \n ' );
30- }
24+ @ import ('./info' )
3125
32- page
33- = title : page_title
34- description : description *
35- tasks : page_task *
36- {
37- output .pages .push ({
38- title,
39- description: description .join (' \n ' ),
40- tasks,
41- });
42- }
26+ @ import ('./page' )
4327
44- page_task
45- = '+'
46- space ?
47- description : description
48- actions : task_actions *
49- break ?
28+ @ import ('./page-task' )
5029
51- { let task = { description, tests: [], hints: [] };
52- actions .forEach (({type, value}) => task[type].push (value));
53- return task;
54- }
30+ @ import ('./page-actions' )
5531
56- page_actions
57- = on_page_complete
32+ @ import ('./task-actions' )
5833
59- task_actions
60- = test : task_test
61- / hint : task_hint
62- / action : task_action
34+ @ import ('./shared' )
6335
64- info_title
65- = '#'
66- space ?
67- title : content
68- { return adjust (title); }
69-
70- page_title
71- = '##'
72- space ?
73- title : content
74- break
75- { return adjust (title); }
76-
77- description
78- = description : content
79- break
80- { return adjust (description); }
81-
82- task_test
83- = '@test'
84- '('
85- quote
86- testPath : [^\n ^\r ^\'\"\` )]+
87- quote
88- ')'
89- break
90- { return { type: ' tests' , value: testPath .join (' ' ) }; }
91-
92- task_hint
93- = '@hint'
94- hint : [^\n ^\r ]+
95- break
96- { let h = trimBracketsAndQuotes (hint .join (' ' ));
97- return { type: ' hints' , value: h };
98- }
99-
100-
101- on_page_complete
102- = '@onPageComplete'
103- '('
104- quote
105- content : .+
106- quote
107- ')'
108- { return { type: ' onPageComplete' , value: content .join (' ' ) }; }
109-
110- page_import
111- = '@import'
112- '('
113- quote
114- filePath : file_path
115- quote
116- ')'
117- break
118- { return filePath .join (' ' ); }
119-
120- @ import ('./action' )
121- @ import ('./common' )
36+ @ import ('./characters' )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments