Improve shell and m4 syntax
gitile/highlight/shell.scm
31 | 31 | lex-m4 | |
32 | 32 | lex-autoconf)) | |
33 | 33 | ||
34 | - | (define %variable-char-set char-set:letter+digit) | |
34 | + | (define %variable-char-set | |
35 | + | (char-set-union (char-set #\_) char-set:letter+digit)) | |
35 | 36 | ||
36 | 37 | (define %shell-builtins | |
37 | 38 | '("alias" "bg" "bind" "break" "builtin" "caller" "cd" "command" "compgen" | |
… | |||
336 | 337 | (lex-tag 'comment (lex-delimited "DNL" #:until "\n")) | |
337 | 338 | (lex-string ",") | |
338 | 339 | lex-whitespace | |
339 | - | (lex-delimited quote-in #:until quote-out #:nested? #t) | |
340 | - | (lex-char-set (char-set-complement (char-set #\,))))) | |
340 | + | (lex-tag 'string (lex-delimited quote-in #:until quote-out #:nested? #t)) | |
341 | + | (lex-char-set (char-set-complement (char-set #\, #\)))))) | |
341 | 342 | ||
342 | 343 | (define lex-macro | |
343 | 344 | (lex-all | |
344 | 345 | (lex-any | |
345 | 346 | (lex-tag 'builtin (lex-filter | |
346 | 347 | (lambda (str) | |
347 | - | (pk 'builtin? str) | |
348 | 348 | (any (cut string=? <> str) builtins)) | |
349 | 349 | (lex-char-set %macro-char-set))) | |
350 | 350 | (lex-tag 'variable (lex-char-set %macro-char-set))) | |
… | |||
359 | 359 | (lex-tag 'comment (lex-delimited "#" #:until "\n")) | |
360 | 360 | (lex-tag 'comment (lex-delimited "dnl" #:until "\n")) | |
361 | 361 | (lex-tag 'comment (lex-delimited "DNL" #:until "\n")) | |
362 | + | lex-whitespace | |
362 | 363 | lex-macro | |
363 | 364 | base-lexer))) | |
364 | 365 |