aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subprojects/frontend/src/index.tsx6
-rw-r--r--subprojects/frontend/src/language/indentation.ts13
2 files changed, 9 insertions, 10 deletions
diff --git a/subprojects/frontend/src/index.tsx b/subprojects/frontend/src/index.tsx
index 9f413b85..602a68ef 100644
--- a/subprojects/frontend/src/index.tsx
+++ b/subprojects/frontend/src/index.tsx
@@ -33,14 +33,16 @@ enum TaxStatus {
33pred invalidTaxStatus(Person p) <-> 33pred invalidTaxStatus(Person p) <->
34 taxStatus(p, child), 34 taxStatus(p, child),
35 children(p, _q) 35 children(p, _q)
36 ; taxStatus(p, retired), 36;
37 taxStatus(p, retired),
37 parent(p, q), 38 parent(p, q),
38 !taxStatus(q, retired). 39 !taxStatus(q, retired).
39 40
40rule createChild(may Person p, must Person newPerson): 41rule createChild(may Person p, must Person newPerson):
41 may children(p, newPerson), 42 may children(p, newPerson),
42 may !equals(newPerson, newPerson) 43 may !equals(newPerson, newPerson)
43==> new q <: newPerson, 44==>
45 new q <: newPerson,
44 children(p, q), 46 children(p, q),
45 taxStatus(q, child). 47 taxStatus(q, child).
46 48
diff --git a/subprojects/frontend/src/language/indentation.ts b/subprojects/frontend/src/language/indentation.ts
index 0bd2423c..b49d6563 100644
--- a/subprojects/frontend/src/language/indentation.ts
+++ b/subprojects/frontend/src/language/indentation.ts
@@ -38,11 +38,11 @@ function findAlignmentAfterOpening(context: TreeIndentContext): number | null {
38 * https://github.com/codemirror/language/blob/cd7f7e66fa51ddbce96cf9396b1b6127d0ca4c94/src/indent.ts#L275 38 * https://github.com/codemirror/language/blob/cd7f7e66fa51ddbce96cf9396b1b6127d0ca4c94/src/indent.ts#L275
39 * 39 *
40 * @example 40 * @example
41 * Result with no hanging indent (indent unit = 2 spaces, units = 1): 41 * Result with no hanging indent (indent unit = 4 spaces, units = 1):
42 * ``` 42 * ```
43 * scope 43 * scope
44 * Family = 1, 44 * Family = 1,
45 * Person += 5..10. 45 * Person += 5..10.
46 * ``` 46 * ```
47 * 47 *
48 * @example 48 * @example
@@ -78,11 +78,8 @@ export function indentDeclaration(context: TreeIndentContext): number {
78 78
79export function indentPredicateOrRule(context: TreeIndentContext): number { 79export function indentPredicateOrRule(context: TreeIndentContext): number {
80 const clauseIndent = indentDeclarationStrategy(context, 1); 80 const clauseIndent = indentDeclarationStrategy(context, 1);
81 if (/^\s+[;.]/.exec(context.textAfter) !== null) { 81 if (/^\s+(?:==>|[;.])/.exec(context.textAfter) !== null) {
82 return clauseIndent - 2; 82 return clauseIndent - context.unit;
83 }
84 if (/^\s+(==>)/.exec(context.textAfter) !== null) {
85 return clauseIndent - 4;
86 } 83 }
87 return clauseIndent; 84 return clauseIndent;
88} 85}