~ecs/hare.lua

f190ee04d316a379fad97307e6b3ce2ba1778ff0 — Alexey Yerin 1 year, 4 months ago 6909930
Update keywords

* Add 'case'
* Drop 'while'
* Add 'insert'
1 files changed, 4 insertions(+), 3 deletions(-)

M hare.lua
M hare.lua => hare.lua +4 -3
@@ 7,7 7,8 @@ local P, R, S = lpeg.P, lpeg.R, lpeg.S
local M = {_NAME = 'hare'}

local builtin = token(l.FUNCTION, word_match{
	'len', 'offset', 'free', 'alloc', 'assert', 'append', 'abort', 'delete'
	'len', 'offset', 'free', 'alloc', 'assert', 'append', 'insert',
	'abort', 'delete',
})

local comment = token(l.COMMENT, '//' * l.nonnewline_esc^0)


@@ 20,8 21,8 @@ local identifier = token(l.IDENTIFIER, l.word)

local keyword = token(l.KEYWORD, word_match{
	'let', 'const', 'fn', 'def', 'static', 'export', 'defer', 'for',
	'while', 'return', 'break', 'continue', 'if', 'else', 'match',
	'switch', 'type', 'yield',
	'return', 'break', 'continue', 'if', 'else', 'match', 'switch',
	'type', 'yield', 'case',
})

local operator = token(l.OPERATOR, word_match{