-
Notifications
You must be signed in to change notification settings - Fork 3
/
lexical.ts
45 lines (37 loc) · 1.2 KB
/
lexical.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-disable no-irregular-whitespace */
import { irohaChars } from "../../../law/num";
import { factory } from "../factory";
export const ptn$_ = "[ \t]*";
export const $_ = factory
.withName("OPTIONAL_WHITESPACES")
.regExp(new RegExp(`^${ptn$_}`))
;
export const ptn$__ = "[ \t]+";
export const $__ = factory
.withName("WHITESPACES")
.regExp(new RegExp(`^${ptn$__}`))
;
export const ptn$_EOL = "[ \t]*\r?\n";
export const $_EOL = factory
.withName("OPTIONAL_WHITESPACES_AND_EOL")
.regExp(new RegExp(`^${ptn$_EOL}`))
;
export const kanjiDigits = "〇一二三四五六七八九十百千";
export const $kanjiDigits = factory
.withName("kanjiDigits")
.regExp(new RegExp(`^[${kanjiDigits}]+`))
;
export const arabicDigits = "01234567890123456789";
export const $arabicDigits = factory
.withName("arabicDigits")
.regExp(new RegExp(`^[${arabicDigits}]+`))
;
export const romanDigits = "iIiIvVvVxXxX";
export const $romanDigits = factory
.withName("romanDigits")
.regExp(new RegExp(`^[${romanDigits}]+`))
;
export const $irohaChar = factory
.withName("irohaChar")
.regExp(new RegExp(`^[${irohaChars}]`))
;