Skip to content

Commit

Permalink
add operators
Browse files Browse the repository at this point in the history
  • Loading branch information
OsamaSBCrea committed Apr 27, 2024
1 parent 001cef0 commit a472ffd
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 112 deletions.
24 changes: 12 additions & 12 deletions dist/index.cjs

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions dist/index.cjs.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LRLanguage, LanguageSupport } from "@codemirror/language";
declare namespace relTerms {
const RawStringSequence: 1;
const spaces: 164;
const newLine: 165;
const spaces: 160;
const newLine: 161;
const LineComment: 2;
const BlockComment: 3;
const Rel: 4;
Expand Down Expand Up @@ -46,20 +46,20 @@ declare namespace relTerms {
const V1Bindings: 72;
const V1BasicActual: 73;
const ApplicationExpression: 74;
const BoundedExpression: 116;
const V1LogicalAbstractExpression: 118;
const V1AbstractExpression: 134;
const InterpolationMultilineLiteral: 135;
const BoundDeclaration: 138;
const ValueTypeDeclaration: 139;
const EntityTypeDeclaration: 140;
const ConstraintDeclaration: 141;
const ModuleDeclaration: 142;
const WithUseDeclaration: 143;
const Alias: 145;
const AliasId: 146;
const ImportDeclaration: 147;
const NamespaceDeclaration: 149;
const BoundedExpression: 114;
const V1LogicalAbstractExpression: 116;
const V1AbstractExpression: 130;
const InterpolationMultilineLiteral: 131;
const BoundDeclaration: 134;
const ValueTypeDeclaration: 135;
const EntityTypeDeclaration: 136;
const ConstraintDeclaration: 137;
const ModuleDeclaration: 138;
const WithUseDeclaration: 139;
const Alias: 141;
const AliasId: 142;
const ImportDeclaration: 143;
const NamespaceDeclaration: 145;
}
declare const relLanguage: LRLanguage;
declare function rel(): LanguageSupport;
Expand Down
32 changes: 16 additions & 16 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LRLanguage, LanguageSupport } from "@codemirror/language";
declare namespace relTerms {
const RawStringSequence: 1;
const spaces: 164;
const newLine: 165;
const spaces: 160;
const newLine: 161;
const LineComment: 2;
const BlockComment: 3;
const Rel: 4;
Expand Down Expand Up @@ -46,20 +46,20 @@ declare namespace relTerms {
const V1Bindings: 72;
const V1BasicActual: 73;
const ApplicationExpression: 74;
const BoundedExpression: 116;
const V1LogicalAbstractExpression: 118;
const V1AbstractExpression: 134;
const InterpolationMultilineLiteral: 135;
const BoundDeclaration: 138;
const ValueTypeDeclaration: 139;
const EntityTypeDeclaration: 140;
const ConstraintDeclaration: 141;
const ModuleDeclaration: 142;
const WithUseDeclaration: 143;
const Alias: 145;
const AliasId: 146;
const ImportDeclaration: 147;
const NamespaceDeclaration: 149;
const BoundedExpression: 114;
const V1LogicalAbstractExpression: 116;
const V1AbstractExpression: 130;
const InterpolationMultilineLiteral: 131;
const BoundDeclaration: 134;
const ValueTypeDeclaration: 135;
const EntityTypeDeclaration: 136;
const ConstraintDeclaration: 137;
const ModuleDeclaration: 138;
const WithUseDeclaration: 139;
const Alias: 141;
const AliasId: 142;
const ImportDeclaration: 143;
const NamespaceDeclaration: 145;
}
declare const relLanguage: LRLanguage;
declare function rel(): LanguageSupport;
Expand Down
24 changes: 12 additions & 12 deletions dist/index.js

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions src/parser.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions src/parser.terms.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
export const
RawStringSequence = 1,
spaces = 164,
newLine = 165,
spaces = 160,
newLine = 161,
LineComment = 2,
BlockComment = 3,
Rel = 4,
Expand Down Expand Up @@ -46,17 +46,17 @@ export const
V1Bindings = 72,
V1BasicActual = 73,
ApplicationExpression = 74,
BoundedExpression = 116,
V1LogicalAbstractExpression = 118,
V1AbstractExpression = 134,
InterpolationMultilineLiteral = 135,
BoundDeclaration = 138,
ValueTypeDeclaration = 139,
EntityTypeDeclaration = 140,
ConstraintDeclaration = 141,
ModuleDeclaration = 142,
WithUseDeclaration = 143,
Alias = 145,
AliasId = 146,
ImportDeclaration = 147,
NamespaceDeclaration = 149
BoundedExpression = 114,
V1LogicalAbstractExpression = 116,
V1AbstractExpression = 130,
InterpolationMultilineLiteral = 131,
BoundDeclaration = 134,
ValueTypeDeclaration = 135,
EntityTypeDeclaration = 136,
ConstraintDeclaration = 137,
ModuleDeclaration = 138,
WithUseDeclaration = 139,
Alias = 141,
AliasId = 142,
ImportDeclaration = 143,
NamespaceDeclaration = 145
39 changes: 10 additions & 29 deletions src/syntax.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
product @left,
union @left,
compL @left,
compR @right,
not,
quant,
and @left,
Expand Down Expand Up @@ -261,35 +260,19 @@ BasicExpression
) BasicExpression
| BasicExpression !add
( op<"+">
| op<"++">
| op<"-">
| op<"∩">
| op<"⊕">
| op<"⊓">
) BasicExpression
| BasicExpression !union ( op<"∪"> | op<"⊔"> ) BasicExpression
| BasicExpression !compL
( op<"=">
| op<"!=">
| op<"≈">
| op<"∼">
| op<"←">
| op<"≼">
| op<"≽">
| op<"≺">
| op<"≻">
| op<"≠">
| op<"<">
| op<">">
| op<"<=">
| op<"≤">
| op<">=">
| op<"≥">
| op<"⊆">
| op<"⊇">
| op<"⊂">
| op<"⊃">
( op<"="> | op<"!="> | op<"≠"> | op<"≡"> | op<"≢"> | op<"~="> | op<"!~=">
| op<"←"> | op<"→">
| op<"<"> | op<">"> | op<"<="> | op<"≤"> | op<">="> | op<"≥">
| op<"⊆"> | op<"⊇"> | op<"⊂"> | op<"⊃">
) BasicExpression
| BasicExpression !compR op<"→"> BasicExpression
| BasicExpression !iffXor ( kw<"iff"> | kw<"xor"> | op<"⇔"> | op<"⇎"> | op<"⊻"> ) BasicExpression

| kw<"if"> v1expression kw<"then"> v1expression kw<"else"> v1expression kw<"end">
Expand Down Expand Up @@ -351,7 +334,7 @@ V1LogicalAbstractExpression
nonAbstractExpression
{ BasicExpression
| UnionExpression { v1expression !union ";" v1expression }
| ProductExpression { v1expression !product "," v1expression }
| ProductExpression { v1expression !product "," v1expression | v1expression !product kw<"where"> v1expression }
| TripleEqualExpression { v1expression !tripleEqual (op<'≡'> | op<'≢'>) v1expression }
}

Expand Down Expand Up @@ -432,15 +415,10 @@ v1FormalsParen { "(" Bindings? ")" }
| "≤"
| ">="
| "≥"
| "∈"
| "⊆"
| "⊇"
| "⊂"
| "⊃"
| "≼"
| "≽"
| "≺"
| "≻"
| "¬"
| "∧"
| "∨"
Expand All @@ -458,6 +436,9 @@ v1FormalsParen { "(" Bindings? ")" }
| "<++"
| "++>"
| "++"
| "~="
| "!~="
| $[\u2200-\u22FF]
}

decimalLiteral { $[0-9]+ }
Expand Down Expand Up @@ -534,7 +515,7 @@ v1FormalsParen { "(" Bindings? ")" }
@precedence { BasicId "_" }
@precedence { LineComment Operator }
@precedence { MultilineDocstringLiteral DocstringLiteral }

@precedence { "∀" "∃" Operator }
}

kw<term> { @specialize[@name=Keyword]<BasicId, term> }
Expand Down

0 comments on commit a472ffd

Please sign in to comment.