Skip to content

Commit 889e4db

Browse files
Sainanwell-in-that-case
authored andcommitted
Document strictness
1 parent 0e8722f commit 889e4db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lparser.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ static void check_match (LexState *ls, int what, int who, int where) {
295295
}
296296

297297

298+
/*
299+
** strictness = 1 allows only NAME & narrow tokens.
300+
** strictness = 0 also allows reserved non-value tokens (so, excl. 'true', 'parent', etc.)
301+
** strictness = -1 also allows value tokens
302+
*/
298303
[[nodiscard]] static bool isnametkn (LexState *ls, int strictness = 0) {
299304
return ls->t.token == TK_NAME || ls->t.IsNarrow()
300305
|| (strictness == 0 && ls->t.IsReservedNonValue())

0 commit comments

Comments
 (0)