From 829630152c462ddeaf9784daec2fd8ffbae79879 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 15 Jun 2025 14:27:53 -0400 Subject: [PATCH] Remove "type.extended" to reduce complexities --- syntax/stxC.go | 3 +-- syntax/stxHtml5.go | 3 ++- syntax/stxPhp.go | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/syntax/stxC.go b/syntax/stxC.go index ab67797..d0cab3a 100644 --- a/syntax/stxC.go +++ b/syntax/stxC.go @@ -8,9 +8,8 @@ func init() { rules: - identifier: "\\b[A-Z_][0-9A-Z_]+\\b" - statement: "([a-zA-Z][a-zA-Z0-9_]*)[[:space:]]*\\(" - - type: "\\b(float|double|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b" + - type: "\\b(float|double|char|bool|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\\b" - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b" - - type.extended: "\\b(bool)\\b" - statement: "\\b(typename|mutable|volatile|register|explicit)\\b" - statement: "\\b(for|if|while|do|else|case|default|switch)\\b" - statement: "\\b(try|throw|catch|operator|new|delete)\\b" diff --git a/syntax/stxHtml5.go b/syntax/stxHtml5.go index 3243c9f..be05eeb 100644 --- a/syntax/stxHtml5.go +++ b/syntax/stxHtml5.go @@ -8,7 +8,8 @@ func init() { rules: - error: "<[^!].*?>" - symbol: "(?i)<[/]?(a|a(bbr|ddress|rea|rticle|side|udio)|b|b(ase|d(i|o)|lockquote|r|utton)|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata|atalist|d|el|etails|fn|ialog|l|t)|em|embed|fieldset|fig(caption|ure)|form|iframe|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li|link|ma(in|p|rk)|menu|menuitem|met(a|er)|nav|noscript|o(bject|l|pt(group|ion)|utput)|p|param|picture|pre|progress|q|r(p|t|uby)|s|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u|ul|var|video|wbr)( .*)*?>" - - type.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" + # todo used in place of type.extended to reduce complexity (only unused rule in stxPhp.go) + - todo: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" - preproc: "(?i)<[/]?(script|style)( .*)*?>" - special: "&[^;[[:space:]]]*;" - symbol: "[:=]" diff --git a/syntax/stxPhp.go b/syntax/stxPhp.go index c1e8bef..ad37695 100644 --- a/syntax/stxPhp.go +++ b/syntax/stxPhp.go @@ -9,7 +9,8 @@ rules: - symbol.operator: "<|>" - error: "<[^!].*?>" - symbol: "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" - - type.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>" + # todo used in place of type.extended to reduce complexity + - todo: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>" - preproc: "(?i)<[/]?(script|style)( .*|>)*?>" - special: "&[^;[[:space:]]]*;" - symbol: "[:=]"