Skip to content

Commit 8c575c6

Browse files
committed
fix
1 parent c745daa commit 8c575c6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

dictionary/parser.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ const hashSign = matchString("#", "hash sign");
3131
const backtick = matchString("`", "backtick");
3232
const colon = matchString(":", "colon");
3333

34-
const tokiPonaWord = lex(match(/[a-z][a-zA-Z]*/, "word"));
35-
const openParenthesis = lex(matchString("(", "open parenthesis"));
36-
const closeParenthesis = lex(matchString(")", "close parenthesis"));
37-
const openBracket = lex(matchString("[", "open bracket"));
38-
const closeBracket = lex(matchString("]", "close bracket"));
39-
const comma = lex(matchString(",", "comma"));
40-
const semicolon = lex(matchString(";", "semicolon"));
41-
const slash = lex(matchString("/", "slash"));
42-
4334
const character = match(/./u, "character");
4435
const wordCharacter = match(
4536
new RegExp(`[^${escapeRegex(RESERVED_SYMBOLS)}]`),
@@ -62,6 +53,15 @@ const ignore = allWithCheck(
6253
function lex<T>(parser: Parser<T>): Parser<T> {
6354
return parser.skip(ignore);
6455
}
56+
const tokiPonaWord = lex(match(/[a-z][a-zA-Z]*/, "word"));
57+
const openParenthesis = lex(matchString("(", "open parenthesis"));
58+
const closeParenthesis = lex(matchString(")", "close parenthesis"));
59+
const openBracket = lex(matchString("[", "open bracket"));
60+
const closeBracket = lex(matchString("]", "close bracket"));
61+
const comma = lex(matchString(",", "comma"));
62+
const semicolon = lex(matchString(";", "semicolon"));
63+
const slash = lex(matchString("/", "slash"));
64+
6565
const keyword = memoize(<T extends string>(keyword: T) =>
6666
lex(withPosition(match(/[a-z\-]+/, `"${keyword}"`)))
6767
.map((positioned) =>
@@ -294,7 +294,7 @@ const prepositionDefinition = checkedSimpleUnitWithTemplate(
294294
.map((preposition) => ({ type: "preposition", preposition }) as const);
295295
const numeralDefinition = checkedSimpleUnit("num")
296296
.mapWithPositionedError((num) => {
297-
const numeral = Number.parseInt(num);
297+
const numeral = Number.parseInt(num, 10);
298298
if (Number.isNaN(numeral)) {
299299
throw `"${num}" is not a number`;
300300
} else {

0 commit comments

Comments
 (0)