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

Fix/support for floating point #20

Merged
merged 5 commits into from
Nov 12, 2024
Merged

Conversation

cloutierMat
Copy link

@cloutierMat cloutierMat commented Nov 10, 2024

Motivation

While implementing $util.math for appsync, I realised that while aws was recognising .5 as a floating point, airspeed did not.

This pr makes the leading digits optional when evaluating a floating point element.

I also added a mechanism by which a function can bypass the default silent behavior of FormalReference. This is relevant for most $util implemented in appsync as for example $util.math.roundNum will return the statement the parameter is either empty or a non Number.

@cloutierMat cloutierMat added the bug Something isn't working label Nov 10, 2024
@cloutierMat cloutierMat self-assigned this Nov 10, 2024
@@ -12,6 +12,10 @@
LOG = logging.getLogger(__name__)


# This can be used by a function to bypass the silent behavior of a FormalReference.
# If a function returns this value instead of None, the origial text of the reference will be returned instead.
REPLACE_FORMAL_TEXT = "__FORMAL_REFERENCE__REPLACE_TEXT__"
Copy link
Author

Choose a reason for hiding this comment

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

I am not sure about that name, I am welcome to a suggestion to make it more obvious as to what it does. 🤔

Copy link

@simonrw simonrw left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for making this change to floating point handling.

@cloutierMat cloutierMat merged commit 4efbbd2 into master Nov 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants