forked from shidasan/ASNParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse.js
61 lines (57 loc) · 2.49 KB
/
parse.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
PEG = require("./peg.js");
function test(source) {
console.log(source);
var result = PEG.parse(source)[1];
console.log("--result--");
console.log(JSON.stringify(result, null, " "));
}
test("* goal\n");
test("* goal");
test("* goal\ndesc");
test("* goal @hi @bye\ndesc");
test("* goal @task @test\ntodo:: shida\nsubject:: test");
test("* goal\nhi\n*context\nhi");
test("* goal\nhi\n* context\nhi\ntodo::");
test("* goal\n*context");
test("* goal @task @test\ndesc\ntodo::*context\nhi");
test("* goal\n* strategy\n** goal\n**strategy\n***goal");
test("* goal\n* strategy\n** goal\n**strategy @test\n***goal");
test("* goal\n* strategy\n** goal\ntest\n**strategy @test\n***goal\n** goal\n** strategy @test\n**context *** goal");
test("* goal\nTODO:: system is dependable");
test("* goal\nTODO::");
test("* goal\n* evidence");
test("* goal\nsystem is dependable\n* context @def\n* strategy\n** goal\n** evidence @task\n**goal");
test("* goal\n* context");
test("* goal\n* evidence");
test("* goal\n* strategy");
test("* strategy\n** goal");
test("* evidence\n* context");
test("* strategy\n*context\n**goal");
test("*Goal\n*Strategy\n*Context\n**Goal\nHoge\n**Evidence\n**Goal\n**Context\n**Evidence\n**Context\n**Evidence\n**Goal\n**Evidence");
test("*Goal\n*Evidence\n*Evidence");
test("*context @def");
test("*goal\n日本語\nhi");
test("*evidence\nhi\n*context");
test("*evidence\nMonitor:: \"return 1;\"");
test("*Strategy");
test("*Goal\nStakeholders are identified in this project\n*Context\nProjectName: Development of Assure S\n\tStakeholders: LDAPName\n\tVisible: true\n \n*Strategy\nArguing over types of stakeholders\n**Goal\nFounders are identified\n**Evidence\nkimio\n**Goal\nDevelopers are identified\n**Evidence\nuchida\nmatsumura\n**Goal\nOperators are identified\n**Evidence\nishii");
test("*goal\n*context\n \n*strategy");
test("*strategy\n*context\nhi\n**goal");
test("*goal\n*context\n*context");
test("*evidence\n*context");
test("*G1");
test("*G100");
test("*G @param (Monitor.X.callAdmin == 1)");
test("*G @param (Monitor.X.callAdmin == 1) @param2");
test("*G @param hi @param2");
test("*G @param (Monitor.X.callAdmin == 1)\n*C");
test("*G @after (E1.Monitor() == true) @test");
test("*G @after (E1.Action == true) @test");
test("*G @after (E1.Action == true) @test\n*S\nnewnode");
test("*G0");
test("* goal @task\ndesc\ntodo::");
test("*G1\nImportDScript:: LibName\nAdminName:: Admin\n\n");
test("*G1\n*S1\n*S2");
test("*G1\n*C1\n*S1");
test("* goal @task @test\ntodo:: shida");
test("* goal\n\n\n\n* context");