vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
typescript.lua
(475B)
1 -- Copyright 2021-2025 Mitchell. See LICENSE.
2 -- TypeScript LPeg lexer.
3
4 local lexer = lexer
5 local P, S = lpeg.P, lpeg.S
6
7 local lex = lexer.new(..., {inherit = lexer.load('javascript')})
8
9 -- Word lists.
10 lex:set_word_list(lexer.KEYWORD, 'abstract as constructor declare is module namespace require type',
11 true)
12
13 lex:set_word_list(lexer.TYPE, 'boolean number bigint string unknown any void never symbol object',
14 true)
15
16 lexer.property['scintillua.comment'] = '//'
17
18 return lex