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

STRING_LITERAL at end of string interpolation #211

Open
isomarcte opened this issue Mar 8, 2016 · 0 comments
Open

STRING_LITERAL at end of string interpolation #211

isomarcte opened this issue Mar 8, 2016 · 0 comments

Comments

@isomarcte
Copy link
Contributor

Why do we tokenize a string interpolation into the following?

scala> scalariform.lexer.ScalaLexer.tokenise("s\"" + "$" + "{y}\"")
res5: List[scalariform.lexer.Token] = List(Token(INTERPOLATION_ID,s,0,s), Token(STRING_PART,"$,1,"$), Token(LBRACE,{,3,{), Token(VARID,y,4,y), Token(RBRACE,},5,}), Token(STRING_LITERAL,",6,"), Token(EOF,,7,))

Specifically the final STRING_LITERAL doesn't seem to make sense to me. It is always half closed, i.e. doesn't have a leading ". It seems as though it would make more sense to have STRING_PART on both sides.

This is the cause of at least one bug, scalastyle/scalastyle#100.

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

No branches or pull requests

1 participant