Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

Commit c0346ad

Browse files
committed
feat: allow optional commas in arrays (#87)
1 parent 5e0fff9 commit c0346ad

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

docs/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ key : ON_KEYWORD
6464
value : STRING_LITERAL | string_array | env_variables ;
6565
6666
string_array : LEFT_SQUARE_BRACKET
67-
((STRING_LITERAL COMMA)* STRING_LITERAL COMMA?)?
67+
(STRING_LITERAL COMMA?)*
6868
RIGHT_SQUARE_BRACKET ;
6969
7070
env_variables : LEFT_CURLY_BRACKET (env_variable)* RIGHT_CURLY_BRACKET ;

gulpfile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { LinterTasks } from "./scripts/gulp-linter";
88
import { VSCodeTasks } from "./scripts/gulp-vscode";
99

1010
// TODO: replace all module-like files with classes
11+
// TODO: Use discriminated unions instead of kinds and remove all casts
1112

1213
// Called by debugger before launching
1314
gulp.task("update-vscode", gulp.series([BuildTasks.compile, VSCodeTasks.copyFiles, VSCodeTasks.generatePackageJson]));

test/parsing.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,26 @@ ERROR: A token of kind ',' was not expected here.
120120
"
121121
`);
122122
});
123+
124+
it("does not report errors on missing commas", () => {
125+
expectDiagnostics(`
126+
action "a" {
127+
uses = "./ci"
128+
}
129+
action "b" {
130+
uses = "./ci"
131+
}
132+
action "c" {
133+
uses = "./ci"
134+
}
135+
workflow "x" {
136+
on = "fork"
137+
resolves = [
138+
"a",
139+
"b"
140+
"c",
141+
]
142+
}
143+
`).toMatchInlineSnapshot(`""`);
144+
});
123145
});

0 commit comments

Comments
 (0)