From 17458be6d249bb90aeb80137aaa1af9ce2d2ca9c Mon Sep 17 00:00:00 2001 From: Lars Willighagen Date: Tue, 21 Sep 2021 22:48:20 +0200 Subject: [PATCH] Fix and simplify identifier character grammar - remove some of the "minus" syntax: it is only used in this part of the grammar AFAIK, and from my own experience, it can be confusing - add \x00-\x20 to the list of non-identifier chars --- SPEC.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SPEC.md b/SPEC.md index 816bab2..3a6b3ff 100644 --- a/SPEC.md +++ b/SPEC.md @@ -427,8 +427,9 @@ node-space := ws* escline ws* | ws+ node-terminator := single-line-comment | newline | ';' | eof identifier := string | bare-identifier -bare-identifier := ((identifier-char - digit - sign) identifier-char* | sign ((identifier-char - digit) identifier-char*)?) - keyword -identifier-char := unicode - linespace - [\/(){}<>;[]=,"] +bare-identifier := (identifier-initial identifier-char* | sign ((identifier-initial | sign) identifier-char*)?) - keyword +identifier-char := identifier-initial | digit | sign +identifier-initial := [A-Za-z] | [\x80-\u{10FFFF}] | [!#$%&'*.:?@^_`|~] keyword := boolean | 'null' prop := identifier '=' value value := type? (string | number | keyword)