public final class LanguageDef

  1. Object
  2. LanguageDef
Describes the lexical rules of a programming language for the pure code editor’s tokenizer: its keyword set, comment styles, string delimiters and number syntax. The keyword lists match the ones the previous BrowserComponent highlighter used.

Methods

public boolean isPlain()True for plain text (no syntax highlighting at all).
public boolean isKeyword(String word)True when word is a keyword in this language.
public boolean hasLineCommentSlash()True when // starts a line comment.
public boolean hasLineCommentHash()True when # starts a line comment.
public boolean hasBlockComment()True when /* */ block comments are supported.
public boolean hasTemplateString()True when backtick template strings (which may span lines) are supported.
public static LanguageDef forName(String language)Returns the language definition for the given language id, defaulting to a plain text definition (no highlighting) for unknown ids.

Inherited methods

Method details

isPlain

public boolean isPlain()
True for plain text (no syntax highlighting at all).

isKeyword

public boolean isKeyword(String word)
True when word is a keyword in this language.

hasLineCommentSlash

public boolean hasLineCommentSlash()
True when // starts a line comment.

hasLineCommentHash

public boolean hasLineCommentHash()
True when # starts a line comment.

hasBlockComment

public boolean hasBlockComment()
True when /* */ block comments are supported.

hasTemplateString

public boolean hasTemplateString()
True when backtick template strings (which may span lines) are supported.

forName

public static LanguageDef forName(String language)
Returns the language definition for the given language id, defaulting to a plain text definition (no highlighting) for unknown ids.