logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

rhtml.lua (533B)


  1. -- Copyright 2006-2024 Mitchell. See LICENSE.
  2. -- RHTML LPeg lexer.
  3. local lexer = lexer
  4. local P, S = lpeg.P, lpeg.S
  5. local lex = lexer.new(..., {inherit = lexer.load('html')})
  6. -- Embedded Ruby.
  7. local ruby = lexer.load('rails')
  8. local ruby_start_rule = lex:tag(lexer.PREPROCESSOR, '<%' * P('=')^-1)
  9. local ruby_end_rule = lex:tag(lexer.PREPROCESSOR, '%>')
  10. lex:embed(ruby, ruby_start_rule, ruby_end_rule)
  11. -- Fold points.
  12. lex:add_fold_point(lexer.PREPROCESSOR, '<%', '%>')
  13. lexer.property['scintillua.comment'] = '<!--|-->'
  14. return lex