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

Commit

Permalink
feat: allow optional commas in arrays (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed May 1, 2019
1 parent 5e0fff9 commit c0346ad
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ key : ON_KEYWORD
value : STRING_LITERAL | string_array | env_variables ;
string_array : LEFT_SQUARE_BRACKET
((STRING_LITERAL COMMA)* STRING_LITERAL COMMA?)?
(STRING_LITERAL COMMA?)*
RIGHT_SQUARE_BRACKET ;
env_variables : LEFT_CURLY_BRACKET (env_variable)* RIGHT_CURLY_BRACKET ;
Expand Down
1 change: 1 addition & 0 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LinterTasks } from "./scripts/gulp-linter";
import { VSCodeTasks } from "./scripts/gulp-vscode";

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

// Called by debugger before launching
gulp.task("update-vscode", gulp.series([BuildTasks.compile, VSCodeTasks.copyFiles, VSCodeTasks.generatePackageJson]));
Expand Down
22 changes: 22 additions & 0 deletions test/parsing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,26 @@ ERROR: A token of kind ',' was not expected here.
"
`);
});

it("does not report errors on missing commas", () => {
expectDiagnostics(`
action "a" {
uses = "./ci"
}
action "b" {
uses = "./ci"
}
action "c" {
uses = "./ci"
}
workflow "x" {
on = "fork"
resolves = [
"a",
"b"
"c",
]
}
`).toMatchInlineSnapshot(`""`);
});
});

0 comments on commit c0346ad

Please sign in to comment.