Skip to content

Commit

Permalink
refactor grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
OsamaSBCrea committed Nov 15, 2023
1 parent 585f1b6 commit ae280aa
Show file tree
Hide file tree
Showing 16 changed files with 402 additions and 611 deletions.
40 changes: 14 additions & 26 deletions dist/index.cjs

Large diffs are not rendered by default.

104 changes: 46 additions & 58 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: 166;
const newLine: 167;
const spaces: 159;
const newLine: 160;
const LineComment: 2;
const BlockComment: 3;
const Rel: 4;
Expand All @@ -14,62 +14,50 @@ declare namespace relTerms {
const Annotation: 11;
const AnnotationKeyword: 12;
const AnnotationParams: 13;
const BaseLiteral: 14;
const IntLiteral: 15;
const FloatLiteral: 16;
const RelnameLiteral: 17;
const RelnameStringLiteral: 18;
const RelnameMultilineStringLiteral: 19;
const StaticStringLiteral: 20;
const StaticMultilineStringLiteral: 21;
const CharLiteral: 22;
const DateLiteral: 23;
const DateTimeLiteral: 24;
const RawStringLiteral: 25;
const LhsId: 28;
const ConstructorId: 29;
const ParenOpId: 33;
const Operator: 34;
const QualifiedName: 35;
const QualifiedNameId: 36;
const QualifiedKeyword: 42;
const QualifiedNameElem: 60;
const FormalsBracket: 61;
const Formals: 62;
const Formal: 63;
const Literal: 64;
const BooleanLiteral: 65;
const SpecializeIntLiteral: 66;
const InterpolationLiteral: 67;
const Interpolation: 68;
const InterpolationId: 69;
const InterpolationExpression: 70;
const Expression: 71;
const IffXorExpression: 72;
const UnionExpression: 73;
const ProductExpression: 74;
const BasicExpression: 75;
const PartialApplicationExpression: 76;
const NocommaParam: 77;
const NocommaExpression: 78;
const NocommaUnionExpression: 79;
const NocommaAbstractExpression: 80;
const Bindings: 81;
const BasicParam: 82;
const ApplicationExpression: 83;
const BoundedExpression: 122;
const LogicalAbstractExpression: 124;
const AbstractExpression: 140;
const InterpolationMultilineLiteral: 141;
const FormalsParen: 144;
const BoundDeclaration: 145;
const ValueTypeDeclaration: 146;
const EntityTypeDeclaration: 147;
const ConstraintDeclaration: 148;
const ModuleDeclaration: 149;
const WithUseDeclaration: 150;
const Alias: 152;
const AliasId: 153;
const IntLiteral: 14;
const FloatLiteral: 15;
const RelnameLiteral: 16;
const RelnameStringLiteral: 17;
const RelnameMultilineStringLiteral: 18;
const StaticStringLiteral: 19;
const StaticMultilineStringLiteral: 20;
const CharLiteral: 21;
const DateLiteral: 22;
const DateTimeLiteral: 23;
const RawStringLiteral: 24;
const LhsId: 27;
const ConstructorId: 28;
const ParenOpId: 32;
const Operator: 33;
const QualifiedName: 34;
const QualifiedNameId: 35;
const QualifiedKeyword: 41;
const QualifiedNameElem: 59;
const Formals: 60;
const Formal: 61;
const BooleanLiteral: 62;
const SpecializeIntLiteral: 63;
const InterpolationLiteral: 64;
const InterpolationId: 65;
const InterpolationExpression: 66;
const BasicExpression: 67;
const PartialApplicationExpression: 68;
const NocommaParam: 69;
const Bindings: 72;
const BasicParam: 73;
const ApplicationExpression: 74;
const BoundedExpression: 113;
const LogicalAbstractExpression: 115;
const AbstractExpression: 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;
}
declare const relLanguage: LRLanguage;
declare function rel(): LanguageSupport;
Expand Down
104 changes: 46 additions & 58 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: 166;
const newLine: 167;
const spaces: 159;
const newLine: 160;
const LineComment: 2;
const BlockComment: 3;
const Rel: 4;
Expand All @@ -14,62 +14,50 @@ declare namespace relTerms {
const Annotation: 11;
const AnnotationKeyword: 12;
const AnnotationParams: 13;
const BaseLiteral: 14;
const IntLiteral: 15;
const FloatLiteral: 16;
const RelnameLiteral: 17;
const RelnameStringLiteral: 18;
const RelnameMultilineStringLiteral: 19;
const StaticStringLiteral: 20;
const StaticMultilineStringLiteral: 21;
const CharLiteral: 22;
const DateLiteral: 23;
const DateTimeLiteral: 24;
const RawStringLiteral: 25;
const LhsId: 28;
const ConstructorId: 29;
const ParenOpId: 33;
const Operator: 34;
const QualifiedName: 35;
const QualifiedNameId: 36;
const QualifiedKeyword: 42;
const QualifiedNameElem: 60;
const FormalsBracket: 61;
const Formals: 62;
const Formal: 63;
const Literal: 64;
const BooleanLiteral: 65;
const SpecializeIntLiteral: 66;
const InterpolationLiteral: 67;
const Interpolation: 68;
const InterpolationId: 69;
const InterpolationExpression: 70;
const Expression: 71;
const IffXorExpression: 72;
const UnionExpression: 73;
const ProductExpression: 74;
const BasicExpression: 75;
const PartialApplicationExpression: 76;
const NocommaParam: 77;
const NocommaExpression: 78;
const NocommaUnionExpression: 79;
const NocommaAbstractExpression: 80;
const Bindings: 81;
const BasicParam: 82;
const ApplicationExpression: 83;
const BoundedExpression: 122;
const LogicalAbstractExpression: 124;
const AbstractExpression: 140;
const InterpolationMultilineLiteral: 141;
const FormalsParen: 144;
const BoundDeclaration: 145;
const ValueTypeDeclaration: 146;
const EntityTypeDeclaration: 147;
const ConstraintDeclaration: 148;
const ModuleDeclaration: 149;
const WithUseDeclaration: 150;
const Alias: 152;
const AliasId: 153;
const IntLiteral: 14;
const FloatLiteral: 15;
const RelnameLiteral: 16;
const RelnameStringLiteral: 17;
const RelnameMultilineStringLiteral: 18;
const StaticStringLiteral: 19;
const StaticMultilineStringLiteral: 20;
const CharLiteral: 21;
const DateLiteral: 22;
const DateTimeLiteral: 23;
const RawStringLiteral: 24;
const LhsId: 27;
const ConstructorId: 28;
const ParenOpId: 32;
const Operator: 33;
const QualifiedName: 34;
const QualifiedNameId: 35;
const QualifiedKeyword: 41;
const QualifiedNameElem: 59;
const Formals: 60;
const Formal: 61;
const BooleanLiteral: 62;
const SpecializeIntLiteral: 63;
const InterpolationLiteral: 64;
const InterpolationId: 65;
const InterpolationExpression: 66;
const BasicExpression: 67;
const PartialApplicationExpression: 68;
const NocommaParam: 69;
const Bindings: 72;
const BasicParam: 73;
const ApplicationExpression: 74;
const BoundedExpression: 113;
const LogicalAbstractExpression: 115;
const AbstractExpression: 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;
}
declare const relLanguage: LRLanguage;
declare function rel(): LanguageSupport;
Expand Down
40 changes: 14 additions & 26 deletions dist/index.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@relationalai/codemirror-lang-rel",
"version": "0.3.0",
"version": "0.3.1",
"description": "CodeMirror 6 language support for Rel",
"scripts": {
"test": "mocha test/test.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const relLanguage = LRLanguage.define({
"PartialApplicationExpression/BasicExpression/BasicId": tags.variableName,
"ApplicationExpression/BasicExpression/BasicId": tags.variableName,
"BasicParam/BasicExpression/BasicId": tags.attributeName,
"FormalId/BasicId": tags.attributeName,
"Formal/BasicId": tags.attributeName,
"InterpolationId AliasId/BasicId": tags.labelName,
"QualifiedNameElem RelnameLiteral RelnameStringLiteral RelnameMultilineStringLiteral ValueTypeLiteral": tags.literal,
"DateLiteral DateTimeLiteral": tags.string,
Expand Down
24 changes: 12 additions & 12 deletions src/parser.js

Large diffs are not rendered by default.

104 changes: 46 additions & 58 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 = 166,
newLine = 167,
spaces = 159,
newLine = 160,
LineComment = 2,
BlockComment = 3,
Rel = 4,
Expand All @@ -14,59 +14,47 @@ export const
Annotation = 11,
AnnotationKeyword = 12,
AnnotationParams = 13,
BaseLiteral = 14,
IntLiteral = 15,
FloatLiteral = 16,
RelnameLiteral = 17,
RelnameStringLiteral = 18,
RelnameMultilineStringLiteral = 19,
StaticStringLiteral = 20,
StaticMultilineStringLiteral = 21,
CharLiteral = 22,
DateLiteral = 23,
DateTimeLiteral = 24,
RawStringLiteral = 25,
LhsId = 28,
ConstructorId = 29,
ParenOpId = 33,
Operator = 34,
QualifiedName = 35,
QualifiedNameId = 36,
QualifiedKeyword = 42,
QualifiedNameElem = 60,
FormalsBracket = 61,
Formals = 62,
Formal = 63,
Literal = 64,
BooleanLiteral = 65,
SpecializeIntLiteral = 66,
InterpolationLiteral = 67,
Interpolation = 68,
InterpolationId = 69,
InterpolationExpression = 70,
Expression = 71,
IffXorExpression = 72,
UnionExpression = 73,
ProductExpression = 74,
BasicExpression = 75,
PartialApplicationExpression = 76,
NocommaParam = 77,
NocommaExpression = 78,
NocommaUnionExpression = 79,
NocommaAbstractExpression = 80,
Bindings = 81,
BasicParam = 82,
ApplicationExpression = 83,
BoundedExpression = 122,
LogicalAbstractExpression = 124,
AbstractExpression = 140,
InterpolationMultilineLiteral = 141,
FormalsParen = 144,
BoundDeclaration = 145,
ValueTypeDeclaration = 146,
EntityTypeDeclaration = 147,
ConstraintDeclaration = 148,
ModuleDeclaration = 149,
WithUseDeclaration = 150,
Alias = 152,
AliasId = 153
IntLiteral = 14,
FloatLiteral = 15,
RelnameLiteral = 16,
RelnameStringLiteral = 17,
RelnameMultilineStringLiteral = 18,
StaticStringLiteral = 19,
StaticMultilineStringLiteral = 20,
CharLiteral = 21,
DateLiteral = 22,
DateTimeLiteral = 23,
RawStringLiteral = 24,
LhsId = 27,
ConstructorId = 28,
ParenOpId = 32,
Operator = 33,
QualifiedName = 34,
QualifiedNameId = 35,
QualifiedKeyword = 41,
QualifiedNameElem = 59,
Formals = 60,
Formal = 61,
BooleanLiteral = 62,
SpecializeIntLiteral = 63,
InterpolationLiteral = 64,
InterpolationId = 65,
InterpolationExpression = 66,
BasicExpression = 67,
PartialApplicationExpression = 68,
NocommaParam = 69,
Bindings = 72,
BasicParam = 73,
ApplicationExpression = 74,
BoundedExpression = 113,
LogicalAbstractExpression = 115,
AbstractExpression = 134,
InterpolationMultilineLiteral = 135,
BoundDeclaration = 138,
ValueTypeDeclaration = 139,
EntityTypeDeclaration = 140,
ConstraintDeclaration = 141,
ModuleDeclaration = 142,
WithUseDeclaration = 143,
Alias = 145,
AliasId = 146
Loading

0 comments on commit ae280aa

Please sign in to comment.