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

Kotlin improvements around string interpolation, escaping, and generics #392

Merged
merged 8 commits into from Aug 28, 2020

Conversation

pedroql
Copy link
Contributor

@pedroql pedroql commented Aug 21, 2020

Hi,

I did a few improvements on the kotlin lexer. Each commit describes what it does but the main changes are:

  • Detect string interpolation and escaping
"My value is $something and 1 + 2 is ${ 1 + 2}"
"I can do new lines\n"
  • Better detect generics

    • now the reified keyword is properly detected. Before it was just considered Text
class Holder <in A, out B, C: TUpper>

fun <T : Comparable<T>> sort(list: List<T>)  // woohoo! nested generics work

inline fun <reified T>  generic(t: T)

And added a few more tests to verify the functionality around my changes.

@pedroql
Copy link
Contributor Author

pedroql commented Aug 21, 2020

Update I was on the wrong branch 🤦‍♂️

The build failed but I don't understand why...

From travis logs:

8.29s$ ./bin/golangci-lint run

lexers/k/kotlin.go:33: File is not `gofmt`-ed with `-s` (gofmt)

I have more than triple checked and gofmt -s -w lexers/k/kotlin.go doesn't change anything. I looked at that line and don't see anything suspicious. I introduced intentional errors (trailing white spaces) and those were removed by gofmt.

$ go version
go version go1.14.7 darwin/amd64

Can someone help?

@alecthomas alecthomas merged commit fb0b720 into alecthomas:master Aug 28, 2020
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.

None yet

2 participants