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

Exp: scalar encoding is incompatible with the parser rules #650

Open
andrus opened this issue Sep 25, 2023 · 0 comments · May be fixed by #665
Open

Exp: scalar encoding is incompatible with the parser rules #650

andrus opened this issue Sep 25, 2023 · 0 comments · May be fixed by #665

Comments

@andrus
Copy link
Contributor

andrus commented Sep 25, 2023

ExpScalar.toString doesn't follow the rules of the parser. It effectively calls value.toString(). The only special rule is that it encloses it in single quotes if it is a char sequence. We need the encoding to be complimentary to the literals grammar used by the parser:

Long l = 3147483647L; // encode as 3147483647L, not 314748364
BigDecimal d = new BigDecimal("2.1000001B"); // encode as 2.1000001B, not 2.1000001
// same for floats...

String s1 = "a'b"; // encode as "a'b", not 'a'b'
String s1 = "a\"'b"; // encode as 'a"\'b, not 'a"'b'
@andrus andrus changed the title Long scalar toString method should append "L" suffix Long scalar toString() should append "L" suffix Sep 25, 2023
@andrus andrus changed the title Long scalar toString() should append "L" suffix Exp: Long scalar toString() should append "L" suffix Sep 25, 2023
@andrus andrus changed the title Exp: Long scalar toString() should append "L" suffix Exp: numeric scalars toString() should append type suffix Sep 25, 2023
@andrus andrus changed the title Exp: numeric scalars toString() should append type suffix Exp: scalar encoding is incompatible with the parser rules Sep 25, 2023
@m-dzianishchyts m-dzianishchyts linked a pull request Feb 1, 2024 that will close this issue
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 a pull request may close this issue.

1 participant