move unquoted string prec to constant

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-09 09:01:12 +03:00
parent f7e1a9d597
commit 25adf22f55
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -1,5 +1,6 @@
const PREC = { const PREC = {
COMMENT: -2, COMMENT: -2,
UNQUOTED_STRING: 5,
CONTAINER: 9, CONTAINER: 9,
CONNECTION: 9, CONNECTION: 9,
SHAPE: 11, SHAPE: 11,
@ -252,7 +253,8 @@ module.exports = grammar({
_dot: ($) => seq($.dot), _dot: ($) => seq($.dot),
dot: ($) => token("."), dot: ($) => token("."),
_unquoted_string: ($) => token(prec(5, /[\w\-?!]([^'"`\n;{}]*[\w\-?!])?/)), _unquoted_string: ($) =>
token(prec(PREC.UNQUOTED_STRING, /[\w\-?!]([^'"`\n;{}]*[\w\-?!])?/)),
string: ($) => string: ($) =>
choice( choice(