Skip to content

Add verbatim string support #21

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
Aug 14, 2017
Merged

Conversation

sbarzowski
Copy link
Collaborator

No description provided.

@sbarzowski
Copy link
Collaborator Author

@lwander @sparkprime

@coveralls
Copy link

coveralls commented Aug 11, 2017

Coverage Status

Coverage increased (+0.3%) to 75.4% when pulling a94bfef on sbarzowski:verbatim_strings into da7c66a on google:master.

@@ -346,6 +346,8 @@ func (p *parser) parseObjectRemainder(tok *token) (astNode, *token, error) {
kind: astStringBlock,
blockIndent: next.stringBlockIndent,
}
// TODO(sbarzowski) are verbatim string literals allowed here?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes they should be allowed everywhere other string literals are allowed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see there is no test for it and it doesn't work in C++:

$ jsonnet -e '{@"foo": 3}'
STATIC ERROR: <cmdline>:1:2-7: Unexpected: VERBATIM_STRING_DOUBLE while parsing field definition

Copy link
Collaborator

Choose a reason for hiding this comment

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

It does work in import, but there is also no test for that

Copy link
Collaborator

Choose a reason for hiding this comment

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

See also: google/jsonnet#172

@sparkprime
Copy link
Collaborator

LGTM

@sparkprime sparkprime merged commit ace9ab7 into google:master Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants