Skip to content

Commit 27e454f

Browse files
committed
adds tests
1 parent 7a81216 commit 27e454f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

‎parser/index.pegjs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ page_task
6464
space?
6565
description: content
6666
break
67+
test: task_test*
68+
break?
6769
{
6870
position.task += 1;
6971
if (!output.pages[position.page].tasks) {
7072
output.pages[position.page].tasks = [];
7173
}
7274
output.pages[position.page].tasks.push({
73-
description: adjust(description)
74-
})
75+
description: adjust(description),
76+
tests: test
77+
})
7578
}
7679

7780
page_actions
@@ -85,6 +88,11 @@ task_actions
8588

8689
task_test
8790
= '@test'
91+
'(' quote
92+
testPath: [^\n^\r^\'\"\`)]+
93+
quote ')'
94+
break
95+
{ return testPath.join(''); }
8896

8997
task_hint
9098
= '@hint'
@@ -121,9 +129,3 @@ space = [ \s]
121129
break = [\n\r]?
122130
file_path = [a-z_\-\s0-9\.]+
123131
quote = [\"\'\`]
124-
125-
{
126-
// notes
127-
// - break if line starts with #
128-
// - break if line starts with @
129-
}

0 commit comments

Comments
 (0)