@formulavize/lezer-fiz 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,16 +1,24 @@
1
1
  {
2
2
  "name": "@formulavize/lezer-fiz",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "fiz grammar for lezer",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",
7
7
  "exports": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.es.js",
10
- "require": "./dist/index.cjs"
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.es.js",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./package.json": "./package.json"
11
14
  },
12
15
  "module": "dist/index.es.js",
13
16
  "types": "dist/index.d.ts",
17
+ "files": [
18
+ "dist",
19
+ "src"
20
+ ],
21
+ "sideEffects": false,
14
22
  "dependencies": {
15
23
  "@lezer/highlight": "^1.2.5",
16
24
  "@lezer/lr": "^1.4.12"
@@ -20,16 +28,11 @@
20
28
  "chokidar-cli": "^3.0.0",
21
29
  "mocha": "^12.0.3",
22
30
  "npm-run-all": "^4.1.5",
23
- "only-allow": "^1.2.2",
24
31
  "prettier": "^3.9.10",
25
32
  "rollup": "^4.67.2"
26
33
  },
27
- "engines": {
28
- "node": ">=26.0",
29
- "pnpm": ">=12"
30
- },
31
34
  "scripts": {
32
- "preinstall": "npx only-allow pnpm",
35
+ "prepack": "run-s build test",
33
36
  "build": "rollup -c",
34
37
  "build:watch": "chokidar 'src/**/*' -c 'pnpm build'",
35
38
  "test": "mocha test/test-*.js",
@@ -1,32 +0,0 @@
1
- name: Run Tests
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- pull_request:
8
- branches:
9
- - main
10
-
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
-
15
- steps:
16
- - name: Checkout code
17
- uses: actions/checkout@v7
18
-
19
- - name: Install pnpm
20
- uses: pnpm/action-setup@v6
21
- with:
22
- version: 12
23
-
24
- - name: Set up Node.js
25
- uses: actions/setup-node@v7
26
- with:
27
- node-version: 26
28
- cache: pnpm
29
-
30
- - run: pnpm install --frozen-lockfile
31
- - run: pnpm build
32
- - run: pnpm test
package/.prettierignore DELETED
@@ -1 +0,0 @@
1
- pnpm-lock.yaml
package/rollup.config.js DELETED
@@ -1,19 +0,0 @@
1
- import { lezer } from "@lezer/generator/rollup";
2
-
3
- export default {
4
- input: "./src/fiz.grammar",
5
- output: [
6
- {
7
- format: "cjs",
8
- file: "./dist/index.cjs",
9
- },
10
- {
11
- format: "es",
12
- file: "./dist/index.es.js",
13
- },
14
- ],
15
- external(id) {
16
- return !/^[\.\/]/.test(id);
17
- },
18
- plugins: [lezer()],
19
- };
package/test/about.txt DELETED
@@ -1,188 +0,0 @@
1
- # Empty About Note
2
-
3
- ~about{}
4
-
5
- ==>
6
-
7
- Recipe(
8
- AboutNote(Identifier, StyleArgList())
9
- )
10
-
11
- # Unnamed About Note
12
-
13
- ~{}
14
-
15
- ==>
16
-
17
- Recipe(
18
- AboutNote(StyleArgList())
19
- )
20
-
21
- # Unnamed About Note with StringLiteral
22
-
23
- ~{ "unkeyed description" }
24
-
25
- ==>
26
-
27
- Recipe(
28
- AboutNote(StyleArgList(StringLiteral))
29
- )
30
-
31
- # About Note with Style Declarations
32
-
33
- ~about{
34
- author: "anthologen"
35
- version: 1.2
36
- license: "MIT"
37
- }
38
-
39
- ==>
40
-
41
- Recipe(
42
- AboutNote(
43
- Identifier,
44
- StyleArgList(
45
- StyleDeclaration(PropertyName, StringLiteral),
46
- StyleDeclaration(PropertyName, NumberLiteral),
47
- StyleDeclaration(PropertyName, StringLiteral)
48
- )
49
- )
50
- )
51
-
52
- # About Note with StyleTags
53
-
54
- ~about{
55
- #meta #draft
56
- }
57
-
58
- ==>
59
-
60
- Recipe(
61
- AboutNote(
62
- Identifier,
63
- StyleArgList(
64
- StyleTag(QualifiableIdentifier(Identifier)),
65
- StyleTag(QualifiableIdentifier(Identifier))
66
- )
67
- )
68
- )
69
-
70
- # About Note with Qualified StyleTag
71
-
72
- ~about{ #provenance.internal }
73
-
74
- ==>
75
-
76
- Recipe(
77
- AboutNote(
78
- Identifier,
79
- StyleArgList(
80
- StyleTag(QualifiableIdentifier(Identifier, Identifier))
81
- )
82
- )
83
- )
84
-
85
- # About Note Mixed Content
86
-
87
- ~about{
88
- #draft
89
- author: "anthologen"
90
- "free form description"
91
- }
92
-
93
- ==>
94
-
95
- Recipe(
96
- AboutNote(
97
- Identifier,
98
- StyleArgList(
99
- StyleTag(QualifiableIdentifier(Identifier)),
100
- StyleDeclaration(PropertyName, StringLiteral),
101
- StringLiteral
102
- )
103
- )
104
- )
105
-
106
- # About Note with Semicolons
107
-
108
- ~about{ author: "anthologen"; license: "MIT" };
109
-
110
- ==>
111
-
112
- Recipe(
113
- AboutNote(
114
- Identifier,
115
- StyleArgList(
116
- StyleDeclaration(PropertyName, StringLiteral),
117
- StyleDeclaration(PropertyName, StringLiteral)
118
- )
119
- )
120
- )
121
-
122
- # Multiple About Notes
123
-
124
- ~about{ version: 1 }
125
- ~provenance{ source: "upstream" }
126
- ~{ "unnamed" }
127
-
128
- ==>
129
-
130
- Recipe(
131
- AboutNote(
132
- Identifier,
133
- StyleArgList(StyleDeclaration(PropertyName, NumberLiteral))
134
- )
135
- AboutNote(
136
- Identifier,
137
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
138
- )
139
- AboutNote(StyleArgList(StringLiteral))
140
- )
141
-
142
- # About Note Alongside Other Statements
143
-
144
- ~about{ author: "anthologen" }
145
- *node{ color: #abc }
146
- ^cytoscape{ rankDir: "LR" }
147
- f(x)
148
-
149
- ==>
150
-
151
- Recipe(
152
- AboutNote(
153
- Identifier,
154
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
155
- )
156
- GlobalStyleBinding(
157
- Identifier,
158
- StyleArgList(StyleDeclaration(PropertyName, ColorLiteral))
159
- )
160
- RendererDirective(
161
- Identifier,
162
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
163
- )
164
- Call(
165
- Identifier,
166
- ArgList(RhsVariable(QualifiableIdentifier(Identifier)))
167
- )
168
- )
169
-
170
- # About Note in a StatementList
171
-
172
- ns[
173
- ~about{ scope: "inner" }
174
- ]
175
-
176
- ==>
177
-
178
- Recipe(
179
- Namespace(
180
- Identifier,
181
- StatementList(
182
- AboutNote(
183
- Identifier,
184
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
185
- )
186
- )
187
- )
188
- )
@@ -1,43 +0,0 @@
1
- # Single Variable Assignment
2
-
3
- x = y
4
-
5
- ==>
6
-
7
- Recipe(
8
- Assignment(
9
- LhsVariable(Identifier),
10
- Eq,
11
- RhsVariable(QualifiableIdentifier(Identifier))
12
- )
13
- )
14
-
15
- # Single Variable Assignment
16
-
17
- foo = f()
18
-
19
- ==>
20
-
21
- Recipe(
22
- Assignment(
23
- LhsVariable(Identifier),
24
- Eq,
25
- Call(Identifier, ArgList)
26
- )
27
- )
28
-
29
- # Unpacked Variable List Assignment
30
-
31
- a, b, c = g()
32
-
33
- ==>
34
-
35
- Recipe(
36
- Assignment(
37
- LhsVariable(Identifier),
38
- LhsVariable(Identifier),
39
- LhsVariable(Identifier),
40
- Eq,
41
- Call(Identifier, ArgList)
42
- )
43
- )
package/test/calls.txt DELETED
@@ -1,132 +0,0 @@
1
- # No Parameters
2
-
3
- func()
4
-
5
- ==>
6
-
7
- Recipe(
8
- Call(Identifier, ArgList)
9
- )
10
-
11
- # One Variable
12
-
13
- f( x )
14
-
15
- ==>
16
-
17
- Recipe(
18
- Call(Identifier, ArgList(
19
- RhsVariable(QualifiableIdentifier(Identifier))
20
- ))
21
- )
22
-
23
- # Two Variables
24
-
25
- f(x,y)
26
-
27
- ==>
28
-
29
- Recipe(
30
- Call(Identifier, ArgList(
31
- RhsVariable(QualifiableIdentifier(Identifier)),
32
- RhsVariable(QualifiableIdentifier(Identifier))
33
- ))
34
- )
35
-
36
- # Three Variables
37
-
38
- f(x, y, z)
39
-
40
- ==>
41
-
42
- Recipe(
43
- Call(
44
- Identifier,
45
- ArgList(
46
- RhsVariable(QualifiableIdentifier(Identifier)),
47
- RhsVariable(QualifiableIdentifier(Identifier)),
48
- RhsVariable(QualifiableIdentifier(Identifier))
49
- )
50
- )
51
- )
52
-
53
- # Nested Call
54
-
55
- f(g())
56
-
57
- ==>
58
-
59
- Recipe(
60
- Call(Identifier, ArgList(
61
- Call(Identifier, ArgList)
62
- ))
63
- )
64
-
65
- # Nested Nested Call
66
-
67
- f( g( h() ) )
68
-
69
- ==>
70
-
71
- Recipe(
72
- Call(Identifier, ArgList(
73
- Call(Identifier, ArgList(
74
- Call(Identifier, ArgList)
75
- ))
76
- ))
77
- )
78
-
79
- # Variable and Call
80
-
81
- f ( x , g ( ) )
82
-
83
- ==>
84
-
85
- Recipe(
86
- Call(Identifier, ArgList(
87
- RhsVariable(QualifiableIdentifier(Identifier)),
88
- Call(Identifier, ArgList)
89
- ))
90
- )
91
-
92
- # Call and Variable
93
-
94
- f (
95
- g ( ) ,
96
- y
97
- )
98
-
99
- ==>
100
-
101
- Recipe(
102
- Call(Identifier, ArgList(
103
- Call(Identifier, ArgList),
104
- RhsVariable(QualifiableIdentifier(Identifier))
105
- ))
106
- )
107
-
108
- # Nested Nested Call with Variable Parameters
109
-
110
- f(
111
- g(
112
- h(x,y),
113
- z
114
- )
115
- )
116
-
117
- ==>
118
-
119
- Recipe(
120
- Call(Identifier, ArgList(
121
- Call(Identifier, ArgList(
122
- Call(
123
- Identifier,
124
- ArgList(
125
- RhsVariable(QualifiableIdentifier(Identifier)),
126
- RhsVariable(QualifiableIdentifier(Identifier))
127
- )
128
- ),
129
- RhsVariable(QualifiableIdentifier(Identifier))
130
- ))
131
- ))
132
- )
@@ -1,154 +0,0 @@
1
- # Empty Renderer Directive
2
-
3
- ^cytoscape{}
4
-
5
- ==>
6
-
7
- Recipe(
8
- RendererDirective(Identifier, StyleArgList())
9
- )
10
-
11
- # Renderer Directive with Style Declarations
12
-
13
- ^cytoscape{
14
- rankDir: "LR"
15
- background-color: #ff0000
16
- }
17
-
18
- ==>
19
-
20
- Recipe(
21
- RendererDirective(
22
- Identifier,
23
- StyleArgList(
24
- StyleDeclaration(PropertyName, StringLiteral),
25
- StyleDeclaration(PropertyName, ColorLiteral)
26
- )
27
- )
28
- )
29
-
30
- # Renderer Directive with StyleTags
31
-
32
- ^cytoscape{
33
- #compact #dark
34
- }
35
-
36
- ==>
37
-
38
- Recipe(
39
- RendererDirective(
40
- Identifier,
41
- StyleArgList(
42
- StyleTag(QualifiableIdentifier(Identifier)),
43
- StyleTag(QualifiableIdentifier(Identifier))
44
- )
45
- )
46
- )
47
-
48
- # Renderer Directive with Qualified StyleTag
49
-
50
- ^cytoscape{ #themes.compact }
51
-
52
- ==>
53
-
54
- Recipe(
55
- RendererDirective(
56
- Identifier,
57
- StyleArgList(
58
- StyleTag(QualifiableIdentifier(Identifier, Identifier))
59
- )
60
- )
61
- )
62
-
63
- # Renderer Directive Mixed Content
64
-
65
- ^cytoscape{
66
- #base
67
- rankDir: "TB"
68
- "note"
69
- }
70
-
71
- ==>
72
-
73
- Recipe(
74
- RendererDirective(
75
- Identifier,
76
- StyleArgList(
77
- StyleTag(QualifiableIdentifier(Identifier)),
78
- StyleDeclaration(PropertyName, StringLiteral),
79
- StringLiteral
80
- )
81
- )
82
- )
83
-
84
- # Multiple Renderer Directives
85
-
86
- ^cytoscape{ rankDir: "LR" }
87
- ^minimal{ x: "y" }
88
-
89
- ==>
90
-
91
- Recipe(
92
- RendererDirective(
93
- Identifier,
94
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
95
- )
96
- RendererDirective(
97
- Identifier,
98
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
99
- )
100
- )
101
-
102
- # Renderer Directive Alongside Global Style Binding
103
-
104
- *node{ color: #abc }
105
- ^cytoscape{ rankDir: "RL" }
106
-
107
- ==>
108
-
109
- Recipe(
110
- GlobalStyleBinding(
111
- Identifier,
112
- StyleArgList(StyleDeclaration(PropertyName, ColorLiteral))
113
- )
114
- RendererDirective(
115
- Identifier,
116
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
117
- )
118
- )
119
-
120
- # Renderer Directive with Semicolons
121
-
122
- ^cytoscape{ rankDir: "LR"; background-color: "#fff" };
123
-
124
- ==>
125
-
126
- Recipe(
127
- RendererDirective(
128
- Identifier,
129
- StyleArgList(
130
- StyleDeclaration(PropertyName, StringLiteral),
131
- StyleDeclaration(PropertyName, StringLiteral)
132
- )
133
- )
134
- )
135
-
136
- # Renderer Directive in a StatementList
137
-
138
- ns[
139
- ^cytoscape{ rankDir: "LR" }
140
- ]
141
-
142
- ==>
143
-
144
- Recipe(
145
- Namespace(
146
- Identifier,
147
- StatementList(
148
- RendererDirective(
149
- Identifier,
150
- StyleArgList(StyleDeclaration(PropertyName, StringLiteral))
151
- )
152
- )
153
- )
154
- )
package/test/imports.txt DELETED
@@ -1,59 +0,0 @@
1
- # Empty Anonymous Import
2
-
3
- @ ""
4
-
5
- ==>
6
-
7
- Recipe(
8
- Import(StringLiteral)
9
- )
10
-
11
- # Aliased Import
12
-
13
- test @ "testing"
14
-
15
- ==>
16
-
17
- Recipe(
18
- Import(Identifier, StringLiteral)
19
- )
20
-
21
- # Two Import Statements
22
-
23
- test @ "one"
24
- @ "two"
25
-
26
- ==>
27
-
28
- Recipe(
29
- Import(Identifier, StringLiteral)
30
- Import(StringLiteral)
31
- )
32
-
33
- # Assignment of Named Import Statement
34
-
35
- x = y @ "one"
36
-
37
- ==>
38
-
39
- Recipe(
40
- Assignment(
41
- LhsVariable(Identifier),
42
- Eq,
43
- Import(Identifier, StringLiteral)
44
- )
45
- )
46
-
47
- # Assignment of Anonymous Import Statement
48
-
49
- x =@ "one"
50
-
51
- ==>
52
-
53
- Recipe(
54
- Assignment(
55
- LhsVariable(Identifier),
56
- Eq,
57
- Import(StringLiteral)
58
- )
59
- )