From fb66728b5936ed1baa094d8656ca401f88108d2a Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 15 Jun 2025 14:48:47 -0400 Subject: [PATCH] Replace "constant.string.url" to reduce complexities --- syntax/stxHtml5.go | 3 ++- syntax/stxPhp.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/syntax/stxHtml5.go b/syntax/stxHtml5.go index be05eeb..330f58e 100644 --- a/syntax/stxHtml5.go +++ b/syntax/stxHtml5.go @@ -21,7 +21,8 @@ rules: end: "<" rules: [] - symbol: "<|>" - - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + # constant.number is used in place of constant.string.url to reduce complexity + - constant.number: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - comment: "" - preproc: ""`) }} diff --git a/syntax/stxPhp.go b/syntax/stxPhp.go index ad37695..f4a2b2e 100644 --- a/syntax/stxPhp.go +++ b/syntax/stxPhp.go @@ -17,7 +17,8 @@ rules: - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" - constant.string: "\"[^\"]*\"" - constant.number: "(?i)#[0-9A-F]{6,6}" - - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" + # constant.number is used in place of constant.string.url to reduce complexity + - constant.number: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - comment: "" - default: "<\\?(php|=)\" end=\"\\?>" - identifier.macro: "([a-zA-Z0-9_-]+)\\("