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 'astFromValue' to correctly handle integers and strings #1181

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

IvanGoncharov
Copy link
Member

Currently astFromValue converts -1 to float, 0000 to integer and also escapes strings when it shouldn't.

ListValueNode,
ObjectValueNode,
} from '../language/ast';
import type { ValueNode } from '../language/ast';
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for cleaning up these flow types!

* - NegativeSign? 0
* - NegativeSign? NonZeroDigit ( Digit+ )?
*/
const integerStringRegExp = /^-?(0|[1-9][0-9]*)$/;
Copy link
Contributor

Choose a reason for hiding this comment

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

Much better. Thanks for including the comment with the lexeme rule

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.

3 participants