diff --git a/runtime/queries/properties/highlights.scm b/runtime/queries/properties/highlights.scm index d3c6ed79..3ba3a330 100644 --- a/runtime/queries/properties/highlights.scm +++ b/runtime/queries/properties/highlights.scm @@ -15,11 +15,15 @@ ((value) @constant.builtin.boolean (#any-of? @constant.builtin.boolean "true" "false" "enabled" "disabled")) -((value) @constant.numeric.integer - (#match? @constant.numeric.integer "^-?[0-9]+$")) - ((value) @constant.numeric.float - (#match? @constant.numeric.float "^-?[0-9]+\.[0-9]$")) + (#match? @constant.numeric.float "^[+-]?(([0-9]*\.[0-9]+([eE][+-]?[0-9]+)?)|([0-9]+[eE][+-]?[0-9]+))$")) + +((value) @constant.numeric.integer + ; according to the Java spec, hex literals must represent a 64bit int; + ; overflow (too long) is considered an error. + ; however, since these are just strings, + ; a long hex-literal could represent a BigInt, so we allow it + (#match? @constant.numeric.integer "^([+-]?[0-9]+)|(0[xX][0-9a-fA-F]+)$")) ((value) @string.special.path (#match? @string.special.path "^(\.{1,2})?/"))