Skip to content

BREAKING CHANGE: constant as a class #280

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

Merged
merged 1 commit into from
Mar 14, 2019
Merged

BREAKING CHANGE: constant as a class #280

merged 1 commit into from
Mar 14, 2019

Conversation

saschanaz
Copy link
Member

This removes valueLiteral writer hook because it turns out that ReSpec doesn't need it.

@saschanaz saschanaz requested a review from marcoscaceres March 14, 2019 08:57
Copy link
Member

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

Just question... looks good otherwise.

}
const { trivia } = token;
let data;
return consume("true", "false", "null", "Infinity", "-Infinity", "NaN", FLOAT, INT);
Copy link
Member

Choose a reason for hiding this comment

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

FLOAT, INT add indirection, why not just inline them? or do they have some special definition?

Copy link
Member Author

@saschanaz saschanaz Mar 14, 2019

Choose a reason for hiding this comment

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

It's LONG and used twice (from constants and default values). Not great to inline IMO.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I figured:) thought I’d ask.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, maybe I misunderstood, I thought you asked about inlining const_value() which contains them.

For FLOAT/INT/STR/ID, they have slightly different meaning. Typically consume("text") means consuming a token which is exactly text, but in those cases regex is used instead.

Copy link
Member

Choose a reason for hiding this comment

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

ah, right. Sorry, I was reviewing on my phone and should have checked that. Using regexes 👍 makes sense then.

@saschanaz saschanaz merged commit 812a292 into gh-pages Mar 14, 2019
@saschanaz saschanaz deleted the class-constant branch March 14, 2019 11:06
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.

2 participants