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

scala parsing bug? #58

Open
declerambaul opened this issue Nov 18, 2014 · 3 comments
Open

scala parsing bug? #58

declerambaul opened this issue Nov 18, 2014 · 3 comments

Comments

@declerambaul
Copy link

Hi,

Github uses this tmbundle for rendering scala code - I noticed that there seems to be an issue with highlighting:

e.g. https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/util/Future.scala

OsX 10.10, Chrome version 38.0.2125.122 - 10.10

@jrudolph
Copy link

Another broken example is this one:

https://github.com/2beaucoup/akka/blob/f6b1c90abc5011a9a4ec06663deea8174a76fdae/akka-http/src/main/scala/akka/http/server/RequestContextImpl.scala

I think both of those boil down to a too simplistic grammar that allows arbitrary nesting of any code elements.

@aryairani
Copy link

@infininight

The first example shows the bundle doesn't understand nested comments.

/* this is a comment
   /* this is a nested comment */
this is part of the outer comment, and should be colored as such */

The second example shows that the bundle doesn't understand back-ticked identifiers.

val `string/*` = Foo("""
   I'm pleased to see that the tm grammar does understand that the /* 
   above is part of the identifier declaration.  Pretty much anything can
   go in there.  Spaces, escaped characters, until the closing backtick.  
   It also understands that /* within strings don't really start comments.
""")
val length = `string/*`.explain("""
   It doesn't understand this time that /* is part of the referenced identifier,
   which means that the closing backtick, the method call, and this string
   are all colored incorrectly as comments.
""")

I had planned to link to the language spec around back-ticked identifiers, but it turns out that the spec is messed up 😞. I filed an issue about the spec here. Let me know if there's anything else I can do to help.

@aryairani
Copy link

The first issue seems to have been patched in textmate@40f14ec.

I'll create a new issue for the second one.

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

3 participants