-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backport] SI-6478 Fixing JavaTokenParser ident
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[1.7] parsed: simple | ||
[1.8] parsed: with123 | ||
[1.6] parsed: with$ | ||
[1.10] parsed: withøßöèæ | ||
[1.6] parsed: with_ | ||
[1.6] parsed: _with | ||
[1.1] failure: java identifier expected | ||
|
||
3start | ||
^ | ||
[1.1] failure: java identifier expected | ||
|
||
-start | ||
^ | ||
[1.5] failure: java identifier expected | ||
|
||
with-s | ||
^ | ||
[1.3] failure: java identifier expected | ||
|
||
we♥scala | ||
^ | ||
[1.6] failure: java identifier expected | ||
|
||
with space | ||
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
object Test extends scala.util.parsing.combinator.JavaTokenParsers { | ||
|
||
def test[A](s: String) { | ||
val res = parseAll(ident, s) match { | ||
case Failure(_, in) => Failure("java identifier expected", in) | ||
case o => o | ||
} | ||
println(res) | ||
} | ||
|
||
def main(args: Array[String]) { | ||
// Happy tests | ||
test("simple") | ||
test("with123") | ||
test("with$") | ||
test("withøßöèæ") | ||
test("with_") | ||
test("_with") | ||
// Sad tests | ||
test("3start") | ||
test("-start") | ||
test("with-s") | ||
test("we♥scala") | ||
test("with space") | ||
} | ||
} |
6052e19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job pr-rangepos-per-commit failed for 6052e19 (results):
Took 8 s.
to rebuild, comment "PLS REBUILD/pr-rangepos-per-commit@6052e19292c95270ac0a4bf30b6df47a257f88d4"on PR #2112
6052e19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job pr-checkin-per-commit failed for 6052e19 (results):
Took 13 s.
to rebuild, comment "PLS REBUILD/pr-checkin-per-commit@6052e19292c95270ac0a4bf30b6df47a257f88d4"on PR #2112