Sitemap parser: Fix negative numbers not allowed for visibility (#1928)

The sitemap DSL parser was not able to correctly recognize negative numbers.

Regression from https://github.com/openhab/openhab-webui/pull/1843 where explicit
recognition of hyphens was introduced for new icon syntax.

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
pull/1934/head
Mark Herwege 2023-06-18 19:06:56 +02:00 committed by GitHub
parent 81e12f5f44
commit 49de601b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -20,7 +20,6 @@
lwidget: ['Text ', 'Group ', 'Image ', 'Frame '],
lparen: '(',
rparen: ')',
colon: ':',
lbrace: '{',
rbrace: '}',
lbracket: '[',
@ -32,13 +31,13 @@
lt: '<',
gt: '>',
equals: '=',
comma: ',',
colon: ':',
hyphen: '-',
NL: { match: /\n/, lineBreaks: true },
boolean: /(?:true)|(?:false)/,
identifier: /(?:[A-Za-z_][A-Za-z0-9_]*)|(?:[0-9]+[A-Za-z_][A-Za-z0-9_]*)/,
number: /\-?[0-9]+(?:\.[0-9]*)?/,
number: /-?[0-9]+(?:\.[0-9]*)?/,
comma: ',',
colon: ':',
hyphen: '-',
string: { match: /"(?:\\["\\]|[^\n"\\])*"/, value: x => x.slice(1, -1) }
})
const requiresItem = ['Group', 'Chart', 'Switch', 'Mapview', 'Slider', 'Selection', 'Setpoint', 'Input ', 'Colorpicker', 'Default']