XUtils

LXSH

A collection of lexers and syntax highlighters written with LPeg.


Tokens produced by the lexers

The Lua lexer produces the following tokens:

  • comment
  • constant (true, false and nil)
  • error (invalid input)
  • identifier
  • keyword
  • number
  • operator
  • string
  • whitespace

The C lexer produces the following tokens:

  • comment
  • character (literals like 'C')
  • string (literals like "Lua")
  • error (invalid input)
  • identifier
  • keyword
  • number
  • operator
  • preprocessor
  • whitespace

The BibTeX lexer produces the following tokens:

  • entry (e.g. @Book)
  • field (e.g. author)
  • identifier
  • string
  • number
  • operator
  • delimiter
  • whitespace
  • error (invalid input)

The shell script lexer produces the following tokens:

  • comment
  • number
  • string
  • variable
  • operator
  • keyword
  • command
  • error (invalid input)

Articles

  • coming soon...