Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
Treat '_' as uppercase character in Scala ids
Browse files Browse the repository at this point in the history
The Scala specification (see Chapter 1 - Lexical Syntax) requires
'_' to be treated as uppercase letter.

Fix #1002674
  • Loading branch information
mlangc committed Sep 1, 2016
1 parent e4af03f commit 24c0360
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -672,11 +672,13 @@ object SourceWithMarker {
}
}

private val upper = charOfClass(c => c.isUpper || c == '_')

val idrest = (letter | digit).zeroOrMore ~ ('_' ~ op).zeroOrMore

val varid = charOfClass(_.isLower) ~ idrest

val plainid = (charOfClass(_.isUpper) ~ idrest) | varid | op
val plainid = (upper ~ idrest) | varid | op

val symbolLiteral = ''' ~ plainid

Expand Down

0 comments on commit 24c0360

Please sign in to comment.