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

Allow starting a number with a decimal point #296

Merged
merged 1 commit into from
May 18, 2022

Conversation

triallax
Copy link
Contributor

Fixes #221.


mFracPart ← optionMaybe (append <$> string "." <*> digits)
let fracPart = fromMaybe "" mFracPart
decimalPart ← fractionalPart <|> do
Copy link
Contributor Author

@triallax triallax May 13, 2022

Choose a reason for hiding this comment

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

Suggestions on how to better implement this are welcome.

@triallax triallax force-pushed the allow-decimal-without-leading-zero branch from 55bf17e to c774ab5 Compare May 13, 2022 20:54
@triallax triallax changed the title Allow starting a decimal directly with a point Allow starting a number with a decimal point May 13, 2022
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you very much.

test/Main.purs Outdated Show resolved Hide resolved
@triallax triallax force-pushed the allow-decimal-without-leading-zero branch from c774ab5 to f6f7561 Compare May 18, 2022 16:53
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you for the update!

@sharkdp sharkdp merged commit 08ff517 into sharkdp:master May 18, 2022
@triallax triallax deleted the allow-decimal-without-leading-zero branch May 18, 2022 19:25
@sharkdp
Copy link
Owner

sharkdp commented May 18, 2022

Deployed on https://insect.sh/

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.

Allow starting a number with a decimal point
2 participants