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

dfmc-reader: Allow underscores in numeric literals #1203

Merged
merged 1 commit into from Mar 15, 2019

Conversation

cgay
Copy link
Member

@cgay cgay commented Mar 4, 2019

This implements DEP-0011,
https://opendylan.org/proposals/dep-0011-numeric-literal-syntax.html

Aside from the lexer changes to implement the new syntax, there is one
change to parse-integer:dfmc-reader to catch instead
of , since this masked other errors encountered during development.

@waywardmonkeys
Copy link
Member

In addition to the other comments ... you might consider changing the parsing tests first and then just adding the tests for the underscore changes.

Also, you might look at the code that presents / formats fragments back into code and see how they handle all of this ... but I bet that that'll show off some new problems.

@cgay
Copy link
Member Author

cgay commented Mar 10, 2019

Also, you might look at the code that presents / formats fragments back into code and see how they handle all of this ... but I bet that that'll show off some new problems.

It looks to me like the fragment presentation code is only used for presenting warnings (via print-object). I like that the warning here displays the integer in the standard form while the code snippet displays the original source form. I think this is ok?

abc.dylan:12: Serious warning - Invalid type for argument key1 in call to method keyword-function (key1 :: <string>) => (#rest results :: <object>):  singleton(1000000 :: <integer>) supplied, <string> expected.
        ---------------------------
        keyword-function(1_000_000);
        ---------------------------

@cgay cgay marked this pull request as ready for review March 15, 2019 14:31
@cgay cgay merged commit 1e16e15 into dylan-lang:master Mar 15, 2019
@cgay cgay deleted the integer-literals branch May 2, 2019 03:12
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.

None yet

3 participants