Skip to content

Commit 96dc349

Browse files
committed
test(isc): fix spec syntax — use ISC format (no commas in sub rules)
The ISC grammar uses whitespace-separated atoms in compact sub rules: sub "a" "b" (correct ISC) sub "a", "b" (legacy .imp, codemod converts this) Updated all specs to use ISC-native syntax. Remaining failures are: - Metadata specs need system block wrapper (parser requires root system block) - Transform specs need real parser output instead of hand-built Parslet trees These are documented in TODO.rababa/03-fix-isc-spec-failures.md.
1 parent 5a73a00 commit 96dc349

5 files changed

Lines changed: 31 additions & 31 deletions

File tree

spec/interscript/isc/codemod_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def convert(imp_src)
8888
it "converts modifier kwargs (before:, after:)" do
8989
imp = <<~IMP
9090
stage {
91-
sub "a", "b", before: "c", after: "d"
91+
sub "a" "b" before: "c", after: "d"
9292
}
9393
IMP
9494
isc = convert(imp)

spec/interscript/isc/document_builder_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
}
2323
2424
tests {
25-
test "hello", "hello"
26-
test "world", "world"
25+
"hello" -> "hello"
26+
"world" -> "world"
2727
}
2828
2929
stage main {
30-
sub "a", "b"
31-
sub "c", "d"
30+
sub "a" "b"
31+
sub "c" "d"
3232
}
3333
}
3434
ISC
@@ -82,7 +82,7 @@
8282
parallel {
8383
# just a comment
8484
}
85-
sub "a", "b"
85+
sub "a" "b"
8686
}
8787
}
8888
ISC

spec/interscript/isc/grammar/concerns/items_spec.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
tree = parser.parse(<<~ISC, filename: "t.isc")
1010
system "X:e-Latn:Latn:1" {
1111
stage main {
12-
sub "abc", "def"
12+
sub "abc" "def"
1313
}
1414
}
1515
ISC
@@ -20,7 +20,7 @@
2020
tree = parser.parse(<<~ISC, filename: "t.isc")
2121
system "X:e-Latn:Latn:1" {
2222
stage main {
23-
sub 'abc', 'def'
23+
sub 'abc' 'def'
2424
}
2525
}
2626
ISC
@@ -31,7 +31,7 @@
3131
tree = parser.parse(<<~ISC, filename: "t.isc")
3232
system "X:e-Latn:Latn:1" {
3333
stage main {
34-
sub none, "X"
34+
sub none "X"
3535
}
3636
}
3737
ISC
@@ -44,7 +44,7 @@
4444
tree = parser.parse(<<~ISC, filename: "t.isc")
4545
system "X:e-Latn:Latn:1" {
4646
stage main {
47-
sub #{prim}, "X"
47+
sub #{prim} "X"
4848
}
4949
}
5050
ISC
@@ -56,7 +56,7 @@
5656
tree = parser.parse(<<~ISC, filename: "t.isc")
5757
system "X:e-Latn:Latn:1" {
5858
stage main {
59-
sub any_character, "X"
59+
sub any_character "X"
6060
}
6161
}
6262
ISC
@@ -67,7 +67,7 @@
6767
tree = parser.parse(<<~ISC, filename: "t.isc")
6868
system "X:e-Latn:Latn:1" {
6969
stage main {
70-
sub any("abc"), "X"
70+
sub any("abc") "X"
7171
}
7272
}
7373
ISC
@@ -78,7 +78,7 @@
7878
tree = parser.parse(<<~ISC, filename: "t.isc")
7979
system "X:e-Latn:Latn:1" {
8080
stage main {
81-
sub any(["a", "b", "c"]), "X"
81+
sub any(["a", "b", "c"]) "X"
8282
}
8383
}
8484
ISC
@@ -89,7 +89,7 @@
8989
tree = parser.parse(<<~ISC, filename: "t.isc")
9090
system "X:e-Latn:Latn:1" {
9191
stage main {
92-
sub any("a".."z"), "X"
92+
sub any("a".."z") "X"
9393
}
9494
}
9595
ISC
@@ -100,7 +100,7 @@
100100
tree = parser.parse(<<~ISC, filename: "t.isc")
101101
system "X:e-Latn:Latn:1" {
102102
stage main {
103-
sub any(my_alias), "X"
103+
sub any(my_alias) "X"
104104
}
105105
}
106106
ISC
@@ -125,7 +125,7 @@
125125
tree = parser.parse(<<~ISC, filename: "t.isc")
126126
system "X:e-Latn:Latn:1" {
127127
stage main {
128-
sub capture("abc"), "X"
128+
sub capture("abc") "X"
129129
}
130130
}
131131
ISC
@@ -136,7 +136,7 @@
136136
tree = parser.parse(<<~ISC, filename: "t.isc")
137137
system "X:e-Latn:Latn:1" {
138138
stage main {
139-
sub maybe("a"), "X"
139+
sub maybe("a") "X"
140140
}
141141
}
142142
ISC
@@ -147,7 +147,7 @@
147147
tree = parser.parse(<<~ISC, filename: "t.isc")
148148
system "X:e-Latn:Latn:1" {
149149
stage main {
150-
sub some("a"), "X"
150+
sub some("a") "X"
151151
}
152152
}
153153
ISC
@@ -158,7 +158,7 @@
158158
tree = parser.parse(<<~ISC, filename: "t.isc")
159159
system "X:e-Latn:Latn:1" {
160160
stage main {
161-
sub capture("a"), ref(1)
161+
sub capture("a") ref(1)
162162
}
163163
}
164164
ISC
@@ -170,7 +170,7 @@
170170
tree = parser.parse(<<~ISC, filename: "t.isc")
171171
system "X:e-Latn:Latn:1" {
172172
stage main {
173-
sub "a", #{fn}
173+
sub "a" #{fn}
174174
}
175175
}
176176
ISC
@@ -182,7 +182,7 @@
182182
tree = parser.parse(<<~ISC, filename: "t.isc")
183183
system "X:e-Latn:Latn:1" {
184184
stage main {
185-
sub "a" + "b", "c"
185+
sub "a" + "b" "c"
186186
}
187187
}
188188
ISC
@@ -193,7 +193,7 @@
193193
tree = parser.parse(<<~ISC, filename: "t.isc")
194194
system "X:e-Latn:Latn:1" {
195195
stage main {
196-
sub "a" "b", "c"
196+
sub "a" "b" "c"
197197
}
198198
}
199199
ISC
@@ -207,7 +207,7 @@
207207
my_alias = "abc"
208208
}
209209
stage main {
210-
sub my_alias, "X"
210+
sub my_alias "X"
211211
}
212212
}
213213
ISC

spec/interscript/isc/grammar/concerns/stages_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
tree = parser.parse(<<~ISC, filename: "t.isc")
1010
system "X:eng-Latn:Latn:2026" {
1111
stage main {
12-
sub "a", "b"
12+
sub "a" "b"
1313
}
1414
}
1515
ISC
@@ -35,8 +35,8 @@
3535
system "X:eng-Latn:Latn:2026" {
3636
stage main {
3737
parallel {
38-
sub "a", "b"
39-
sub "c", "d"
38+
sub "a" "b"
39+
sub "c" "d"
4040
}
4141
}
4242
}
@@ -49,8 +49,8 @@
4949
system "X:eng-Latn:Latn:2026" {
5050
stage main {
5151
sequence {
52-
sub "a", "b"
53-
sub "c", "d"
52+
sub "a" "b"
53+
sub "c" "d"
5454
}
5555
}
5656
}
@@ -62,7 +62,7 @@
6262
tree = parser.parse(<<~ISC, filename: "t.isc")
6363
system "X:eng-Latn:Latn:2026" {
6464
stage main {
65-
sub "a", "b"
65+
sub "a" "b"
6666
before "c"
6767
after "d"
6868
not_before "e"

spec/interscript/isc/parser_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
}
1818
1919
tests {
20-
test "hello", "hello"
20+
"hello" -> "hello"
2121
}
2222
2323
stage main {
24-
sub "a", "b"
24+
sub "a" "b"
2525
}
2626
}
2727
ISC

0 commit comments

Comments
 (0)