diff options
Diffstat (limited to 'language-web')
-rw-r--r-- | language-web/src/main/webapp/index.html | 12 | ||||
-rw-r--r-- | language-web/src/main/webapp/script.js | 2 | ||||
-rw-r--r-- | language-web/src/main/webapp/xtext-resources/generated/mode-problem.js | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/language-web/src/main/webapp/index.html b/language-web/src/main/webapp/index.html index 753ed63a..97c4dbab 100644 --- a/language-web/src/main/webapp/index.html +++ b/language-web/src/main/webapp/index.html | |||
@@ -17,22 +17,22 @@ | |||
17 | data-editor-enable-formatting-action="true" | 17 | data-editor-enable-formatting-action="true" |
18 | data-editor-send-full-text="false" | 18 | data-editor-send-full-text="false" |
19 | ><pre>class Family { | 19 | ><pre>class Family { |
20 | contains Person[] members | 20 | contains Person[] members |
21 | } | 21 | } |
22 | 22 | ||
23 | class Person { | 23 | class Person { |
24 | Person[] children opposite parent | 24 | Person[] children opposite parent |
25 | Person parent opposite children | 25 | Person parent opposite children |
26 | TaxStatus[1] taxStatus | 26 | TaxStatus[1] taxStatus |
27 | } | 27 | } |
28 | 28 | ||
29 | enum TaxStatus { | 29 | enum TaxStatus { |
30 | child, student, adult, retired | 30 | child, student, adult, retired |
31 | } | 31 | } |
32 | 32 | ||
33 | % A child cannot have any dependents. | 33 | % A child cannot have any dependents. |
34 | error invalidTaxStatus(Person p) :- | 34 | error invalidTaxStatus(Person p) :- |
35 | taxStatus(p, child), children(p, _q). | 35 | taxStatus(p, child), children(p, _q). |
36 | 36 | ||
37 | Family('family'). | 37 | Family('family'). |
38 | members('family', anne). | 38 | members('family', anne). |
diff --git a/language-web/src/main/webapp/script.js b/language-web/src/main/webapp/script.js index 818a056c..4b466fed 100644 --- a/language-web/src/main/webapp/script.js +++ b/language-web/src/main/webapp/script.js | |||
@@ -16,5 +16,5 @@ require.config({ | |||
16 | }] | 16 | }] |
17 | }); | 17 | }); |
18 | require(["xtext-resources/generated/mode-problem", "xtext/xtext-codemirror"], function(mode, xtext) { | 18 | require(["xtext-resources/generated/mode-problem", "xtext/xtext-codemirror"], function(mode, xtext) { |
19 | xtext.createEditor({baseUrl: baseUrl, indentUnit: 4,}); | 19 | xtext.createEditor({baseUrl: baseUrl, indentUnit: 2,}); |
20 | }); | 20 | }); |
diff --git a/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js b/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js index 1640d13d..92adcff1 100644 --- a/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js +++ b/language-web/src/main/webapp/xtext-resources/generated/mode-problem.js | |||
@@ -21,7 +21,7 @@ define(["codemirror", "codemirror/addon/mode/simple"], function(CodeMirror, Simp | |||
21 | meta: { | 21 | meta: { |
22 | dontIndentStates: ["comment"], | 22 | dontIndentStates: ["comment"], |
23 | lineComment: "%", | 23 | lineComment: "%", |
24 | electricChars: "])]" | 24 | electricChars: "])];" |
25 | }, | 25 | }, |
26 | predicateBody: [ | 26 | predicateBody: [ |
27 | {token: "comment", regex: "\\/\\*", next : "comment"}, | 27 | {token: "comment", regex: "\\/\\*", next : "comment"}, |
@@ -34,6 +34,7 @@ define(["codemirror", "codemirror/addon/mode/simple"], function(CodeMirror, Simp | |||
34 | {token: "lparen", indent: true, regex: "[[({]"}, | 34 | {token: "lparen", indent: true, regex: "[[({]"}, |
35 | {token: "rparen", dedent: true, dedentIfLineStart: true, regex: "[\\])}]"}, | 35 | {token: "rparen", dedent: true, dedentIfLineStart: true, regex: "[\\])}]"}, |
36 | {dedent: true, dedentIfLineStart: false, pop: true, regex: "\\.\\s*$"}, | 36 | {dedent: true, dedentIfLineStart: false, pop: true, regex: "\\.\\s*$"}, |
37 | {indent: true, dedent: true, regex: "[;]"}, | ||
37 | {token: "keyword", regex: "\\b(?:" + keywords + ")\\b"} | 38 | {token: "keyword", regex: "\\b(?:" + keywords + ")\\b"} |
38 | ] | 39 | ] |
39 | }); | 40 | }); |