11{
2- // Initial Data
2+ /** * "pegjs/_data.js" ** */
33
44 var output = {
55 info: {
99 pages: []
1010 };
1111
12- // Types
12+ /** * "pegjs/_types.js" ** */
1313
1414 const pageTypes = [' onPageComplete' ];
1515 const taskTypes = [' tests' , ' actions' , ' hints' ]
1616
17- // Helper Functions
17+ /** * "pegjs/_functions.js" ** */
1818
1919 function adjust (item ) {
2020 return item[0 ].concat (item[1 ].join (' ' ));
5959 break ?
6060 page *
6161
62+ /*** "pegjs/info.pegjs" ***/
63+
6264info
6365 = title : info_title
6466 description : description *
@@ -73,6 +75,8 @@ info_title
7375 title : content
7476 { return adjust (title); }
7577
78+ /*** "pegjs/page.pegjs" ***/
79+
7680page
7781 = title : page_title
7882 description : description *
8589 description: description .join (' \n ' ),
8690 tasks
8791 }
92+
8893 // map over any actions and add them
8994 actions .forEach (({type, value}) => {
9095 if (page .hasOwnProperty (type)) {
@@ -102,6 +107,8 @@ page_title
102107 break
103108 { return adjust (title); }
104109
110+ /*** "pegjs/task.pegjs" ***/
111+
105112page_task
106113 = '+'
107114 space ?
@@ -144,6 +151,8 @@ task_hint
144151 return { type: ' hints' , value: h };
145152 }
146153
154+ /*** "pegjs/page-actions.pegjs" ***/
155+
147156page_actions
148157 = on_page_complete
149158
@@ -157,6 +166,8 @@ on_page_complete
157166 break
158167 { return { type: ' onPageComplete' , value: content .join (' ' ) }; }
159168
169+ /*** "pegjs/task-actions.pegjs" ***/
170+
160171task_action
161172 = '@action'
162173 '('
@@ -215,11 +226,15 @@ action_write_from_file
215226 quote
216227 ')'
217228
229+ /*** "pegjs/shared.pegjs" ***/
230+
218231description
219232 = description : content
220233 break
221234 { return adjust (description); }
222235
236+ /*** "pegjs/characters.pegjs" ***/
237+
223238content = [^#^@^+] [^\n ^\r ]+ [\n\r ]
224239space = [ \s ]
225240break = [\n\r ]?
0 commit comments