A parser that accepts Scala Identifiers?

I was wondering if the standard Scala parser compiler contains a parser that accepts the same identifiers as the Scala language itself (as stated in the Scala Language Specification, section 1.1).

The StdTokenParsers element has an ident parser, but it rejects identifiers such as empty_? .

(If there really is no such parser, I could just instantiate the Scala analyzer itself, but that would not be so easy.)

+7
scala parsing
source share
1 answer

It is not a standard parser combinator, but there are canonical tools for testing Scala id-ness in scala.tools.nsc.util.Chars. There is no need to instantiate a global or Scala scanner.

+4
source share

All Articles