Documentation
¶
Overview ¶
Package java is the Java tokenizer. lang/java registers it. Options (the switches for the intended differences from Chroma) exist only for the comparison in compat/ and are not exposed.
The token types and boundaries reproduce the rules of Chroma 2.27.0's java.xml without regular expressions. java.xml is dot_all, so . also matches a newline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// ChromaIdent, if true, makes the name-start character [^\W\d] the same as Chroma. In regexp2,
// the \d in [^\W\d] has no effect and it is the same as \w, so a part that starts with a digit also becomes
// a name (a number does not get the number color). If false, it is a word character other than digits,
// as the rule intends.
ChromaIdent bool
// ChromaTypes, if true, makes a user-defined type name a plain name (Name), as in Chroma, where only
// the built-in types (int, void, ...) are types. If false (production), a name in a type position is
// KeywordType too: a capitalized name with type arguments (List<User>, new ArrayList<User>()) and the
// names inside them, a capitalized name followed by a variable name (User u = ..., User u) as a
// field, local variable or parameter, and the return type right before a method name (User get().
ChromaTypes bool
}
Options holds the switches for the intended differences from Chroma. The zero value is the production setting (the one lang/java registers).