Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert with + as keywords into identifiers #14360

Merged
merged 2 commits into from
Jun 17, 2024
Merged

Conversation

anthony-c-martin
Copy link
Member

@anthony-c-martin anthony-c-martin commented Jun 17, 2024

Noticed when helping @polatengin on modular params that we have also implemented with and as as dedicated tokens, rather than identifiers.

This means that the following cannot be parsed as legitimate Bicep code:

var with = 'with'

Also closes #13347

Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

github-actions bot commented Jun 17, 2024

Test this change out locally with the following install scripts (Action run 9555663407)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 9555663407
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 9555663407"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 9555663407
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 9555663407"

Copy link
Contributor

github-actions bot commented Jun 17, 2024

Dotnet Test Results

    72 files   -     36      72 suites   - 36   23m 54s ⏱️ - 7m 10s
10 891 tests  -     18  10 890 ✅  -     18  1 💤 ±0  0 ❌ ±0 
25 678 runs   - 12 829  25 676 ✅  - 12 828  2 💤  - 1  0 ❌ ±0 

Results for commit 30c723e. ± Comparison against base commit fece467.

♻️ This comment has been updated with latest results.

@anthony-c-martin anthony-c-martin force-pushed the ant/keywords branch 2 times, most recently from 4f547bb to 1a63587 Compare June 17, 2024 20:23
@@ -111,7 +111,7 @@ public async Task Provider_Statement_Without_As_Keyword_Should_Raise_Error()
} something
""");
result.Should().HaveDiagnostics(new[] {
("BCP012", DiagnosticLevel.Error, "Expected the \"as\" keyword at this location."),
("BCP305", DiagnosticLevel.Error, """Expected the "with" keyword, "as" keyword, or a new line character at this location."""),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
("BCP305", DiagnosticLevel.Error, """Expected the "with" keyword, "as" keyword, or a new line character at this location."""),
("BCP305", DiagnosticLevel.Error, """Expected the "with" keyword, "as" keyword, or a newline character at this location."""),

Copy link
Member

@polatengin polatengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@anthony-c-martin anthony-c-martin merged commit 338f769 into main Jun 17, 2024
44 checks passed
@anthony-c-martin anthony-c-martin deleted the ant/keywords branch June 17, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prefer-unquoted-property-names linter rule incorrectly flags keywords
3 participants