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

update expressions to error for non-ints #438

Merged
merged 8 commits into from
May 31, 2024

Conversation

tgauth
Copy link
Collaborator

@tgauth tgauth commented May 22, 2024

PR Summary

PR Context

  • existing grammar parses only the decimal digit(s) of floating point input as a number, resulting in incorrect handling by functions, like int()
  • adds check for ERROR nodes in Rust parser for function name and args

tree-sitter-dscexpression/grammar.js Outdated Show resolved Hide resolved
dsc_lib/src/functions/int.rs Outdated Show resolved Hide resolved
tree-sitter-dscexpression/grammar.js Outdated Show resolved Hide resolved
@tgauth tgauth requested a review from SteveL-MSFT May 29, 2024 14:47
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue May 31, 2024
Merged via the queue into PowerShell:main with commit b26a223 May 31, 2024
4 checks passed
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Jun 13, 2024
In PowerShell#438 we changed the `int()` function to error on input that
isn't a string or an integer to align with the behavior of the
ARM template function.

This change:

- Updates the documentation for the function to match the updated
  behavior and removing the note about the now-patched bug.
- Adds an entry for the fix to the changelog.
@tgauth tgauth deleted the update-exp-for-non-ints branch August 27, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The int() function incorrectly handles non-integer numbers
2 participants