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

scalaparse: ! and ~ cannot be parsed as object names #183

Open
abgruszecki opened this issue Apr 11, 2018 · 0 comments
Open

scalaparse: ! and ~ cannot be parsed as object names #183

abgruszecki opened this issue Apr 11, 2018 · 0 comments

Comments

@abgruszecki
Copy link

Examples from Ammonite:

@ object !
defined object !

@ // Here I would write just !, but Ammonite doesn't actually allow entering that

@ !.toString
SyntaxError: found "!.toString", expected Import | Prelude ~ BlockDef | Expr | "{" | End at index 0
!.toString
^

@ {{ !.toString }}
SyntaxError: found "!.toString }}", expected ";" | Newline.rep(1) | "}" at index 3
{{ !.toString }}
   ^

@ val a = !.toString
SyntaxError: found "!.toString", expected If | While | Try | DoWhile | For | Throw | Return | ImplicitLambda | SmallerExprOrLambda at index 8
val a = !.toString
        ^

@ `!`
res1: !.type = ammonite.$sess.cmd0$$bang$@39ae6408

Same goes for ~.

For comparison, scala behaviour:

scala> object !
defined object $bang

scala> !
res2: !.type = $bang$@40d23c82

scala> !.toString
res3: String = $bang$@40d23c82

scala> object ~
defined object $tilde

scala> ~
res4: ~.type = $tilde$@29170a47
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