Tabnine Logo
Prism4j.grammar
Code IndexAdd Tabnine to your IDE (free)

How to use
grammar
method
in
ru.noties.prism4j.Prism4j

Best Java code snippets using ru.noties.prism4j.Prism4j.grammar (Showing top 2 results out of 315)

origin: ru.noties/prism4j

@NonNull
public static Prism4j.Grammar require(@NonNull Prism4j prism4j, @NonNull String name) {
  final Prism4j.Grammar grammar = prism4j.grammar(name);
  if (grammar == null) {
    throw new IllegalStateException("Unexpected state, requested language is not found: " + name);
  }
  return grammar;
}
origin: noties/Markwon

@NonNull
protected CharSequence highlightWithLanguageInfo(@NonNull String info, @NonNull String code) {
  final CharSequence out;
  final String language;
  final Prism4j.Grammar grammar;
  {
    String _language = info;
    Prism4j.Grammar _grammar = prism4j.grammar(info);
    if (_grammar == null && !TextUtils.isEmpty(fallback)) {
      _language = fallback;
      _grammar = prism4j.grammar(fallback);
    }
    language = _language;
    grammar = _grammar;
  }
  if (grammar != null) {
    out = highlight(language, grammar, code);
  } else {
    out = code;
  }
  return out;
}
ru.noties.prism4jPrism4jgrammar

Javadoc

Factory method to create a Grammar

Popular methods of Prism4j

  • tokenize
  • <init>
  • isGreedyNode
  • isSyntaxNode
  • matchGrammar

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setContentView (Activity)
  • startActivity (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now