rouge 4.7.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +11 -4
  3. data/bin/rougify +3 -4
  4. data/lib/rouge/cli.rb +7 -10
  5. data/lib/rouge/demos/abap +30 -4
  6. data/lib/rouge/demos/dylan +8 -0
  7. data/lib/rouge/demos/kick_assembler +14 -0
  8. data/lib/rouge/demos/pdf +29 -0
  9. data/lib/rouge/demos/thrift +15 -0
  10. data/lib/rouge/demos/veryl +24 -0
  11. data/lib/rouge/eager.rb +3 -0
  12. data/lib/rouge/formatters/html.rb +8 -1
  13. data/lib/rouge/formatters/html_debug.rb +16 -0
  14. data/lib/rouge/formatters/html_legacy.rb +15 -1
  15. data/lib/rouge/formatters/html_legacy_table.rb +57 -0
  16. data/lib/rouge/formatters/html_line_highlighter.rb +11 -4
  17. data/lib/rouge/formatters/html_line_table.rb +8 -3
  18. data/lib/rouge/formatters/html_linewise.rb +11 -2
  19. data/lib/rouge/formatters/html_pygments.rb +6 -1
  20. data/lib/rouge/formatters/html_table.rb +47 -21
  21. data/lib/rouge/formatters/terminal256.rb +3 -3
  22. data/lib/rouge/formatters/tex.rb +1 -1
  23. data/lib/rouge/guesser.rb +1 -1
  24. data/lib/rouge/guessers/disambiguation.rb +2 -2
  25. data/lib/rouge/guessers/glob_mapping.rb +2 -2
  26. data/lib/rouge/guessers/modeline.rb +2 -2
  27. data/lib/rouge/lexer.rb +40 -21
  28. data/lib/rouge/lexers/abap/builtins.rb +187 -0
  29. data/lib/rouge/lexers/abap.rb +70 -178
  30. data/lib/rouge/lexers/ada.rb +1 -1
  31. data/lib/rouge/lexers/apache/keywords.rb +3 -11
  32. data/lib/rouge/lexers/apache.rb +25 -24
  33. data/lib/rouge/lexers/apex.rb +2 -2
  34. data/lib/rouge/lexers/apiblueprint.rb +2 -2
  35. data/lib/rouge/lexers/bicep.rb +2 -2
  36. data/lib/rouge/lexers/biml.rb +36 -9
  37. data/lib/rouge/lexers/brightscript.rb +3 -4
  38. data/lib/rouge/lexers/c.rb +9 -5
  39. data/lib/rouge/lexers/console.rb +11 -5
  40. data/lib/rouge/lexers/cpp.rb +10 -12
  41. data/lib/rouge/lexers/crystal.rb +1 -1
  42. data/lib/rouge/lexers/css.rb +21 -2
  43. data/lib/rouge/lexers/cuda.rb +4 -4
  44. data/lib/rouge/lexers/cython.rb +26 -50
  45. data/lib/rouge/lexers/dafny.rb +1 -1
  46. data/lib/rouge/lexers/dart.rb +2 -0
  47. data/lib/rouge/lexers/datastudio.rb +1 -1
  48. data/lib/rouge/lexers/digdag.rb +2 -3
  49. data/lib/rouge/lexers/dylan.rb +109 -0
  50. data/lib/rouge/lexers/ecl.rb +3 -3
  51. data/lib/rouge/lexers/elixir.rb +14 -9
  52. data/lib/rouge/lexers/escape.rb +1 -1
  53. data/lib/rouge/lexers/factor.rb +1 -1
  54. data/lib/rouge/lexers/freefem.rb +2 -2
  55. data/lib/rouge/lexers/ghc_cmm.rb +1 -1
  56. data/lib/rouge/lexers/ghc_core.rb +1 -1
  57. data/lib/rouge/lexers/gherkin/keywords.rb +10 -6
  58. data/lib/rouge/lexers/gherkin.rb +28 -26
  59. data/lib/rouge/lexers/gjs.rb +2 -2
  60. data/lib/rouge/lexers/glsl/builtins.rb +17 -0
  61. data/lib/rouge/lexers/glsl.rb +50 -113
  62. data/lib/rouge/lexers/go.rb +1 -1
  63. data/lib/rouge/lexers/gradle.rb +2 -2
  64. data/lib/rouge/lexers/groovy.rb +6 -0
  65. data/lib/rouge/lexers/gts.rb +2 -2
  66. data/lib/rouge/lexers/hack.rb +4 -6
  67. data/lib/rouge/lexers/haxe.rb +2 -2
  68. data/lib/rouge/lexers/hlsl.rb +6 -6
  69. data/lib/rouge/lexers/hocon.rb +2 -2
  70. data/lib/rouge/lexers/hql.rb +15 -19
  71. data/lib/rouge/lexers/idris.rb +1 -1
  72. data/lib/rouge/lexers/igorpro/builtins.rb +1530 -0
  73. data/lib/rouge/lexers/igorpro.rb +49 -520
  74. data/lib/rouge/lexers/irb.rb +3 -3
  75. data/lib/rouge/lexers/isbl.rb +7 -43
  76. data/lib/rouge/lexers/j.rb +1 -1
  77. data/lib/rouge/lexers/json5.rb +2 -2
  78. data/lib/rouge/lexers/json_doc.rb +2 -2
  79. data/lib/rouge/lexers/jsp.rb +119 -119
  80. data/lib/rouge/lexers/jsx.rb +2 -2
  81. data/lib/rouge/lexers/kick_assembler.rb +100 -0
  82. data/lib/rouge/lexers/kotlin.rb +5 -0
  83. data/lib/rouge/lexers/lasso/keywords.rb +6 -6
  84. data/lib/rouge/lexers/lasso.rb +9 -11
  85. data/lib/rouge/lexers/liquid.rb +5 -6
  86. data/lib/rouge/lexers/llvm/keywords.rb +3 -12
  87. data/lib/rouge/lexers/llvm.rb +5 -16
  88. data/lib/rouge/lexers/lua/keywords.rb +11 -13
  89. data/lib/rouge/lexers/lua.rb +8 -7
  90. data/lib/rouge/lexers/lutin.rb +5 -4
  91. data/lib/rouge/lexers/m68k.rb +3 -3
  92. data/lib/rouge/lexers/mason.rb +110 -110
  93. data/lib/rouge/lexers/mathematica/keywords.rb +1 -3
  94. data/lib/rouge/lexers/mathematica.rb +6 -7
  95. data/lib/rouge/lexers/matlab/keywords.rb +2 -2
  96. data/lib/rouge/lexers/matlab.rb +5 -5
  97. data/lib/rouge/lexers/meson.rb +1 -1
  98. data/lib/rouge/lexers/mojo.rb +6 -2
  99. data/lib/rouge/lexers/moonscript.rb +19 -17
  100. data/lib/rouge/lexers/nesasm.rb +6 -6
  101. data/lib/rouge/lexers/nial.rb +7 -8
  102. data/lib/rouge/lexers/nim.rb +3 -3
  103. data/lib/rouge/lexers/nix.rb +10 -8
  104. data/lib/rouge/lexers/objective_c.rb +3 -3
  105. data/lib/rouge/lexers/objective_cpp.rb +3 -2
  106. data/lib/rouge/lexers/ocaml.rb +2 -2
  107. data/lib/rouge/lexers/openedge.rb +9 -9
  108. data/lib/rouge/lexers/pdf.rb +109 -0
  109. data/lib/rouge/lexers/php/keywords.rb +136 -138
  110. data/lib/rouge/lexers/php.rb +58 -9
  111. data/lib/rouge/lexers/plsql.rb +8 -9
  112. data/lib/rouge/lexers/postscript.rb +1 -1
  113. data/lib/rouge/lexers/powershell.rb +1 -1
  114. data/lib/rouge/lexers/python.rb +110 -65
  115. data/lib/rouge/lexers/qml.rb +2 -2
  116. data/lib/rouge/lexers/reasonml.rb +2 -2
  117. data/lib/rouge/lexers/rego.rb +53 -53
  118. data/lib/rouge/lexers/rescript.rb +2 -2
  119. data/lib/rouge/lexers/robot_framework.rb +12 -12
  120. data/lib/rouge/lexers/{coq.rb → rocq.rb} +15 -6
  121. data/lib/rouge/lexers/ruby.rb +33 -7
  122. data/lib/rouge/lexers/rust.rb +1 -0
  123. data/lib/rouge/lexers/sas.rb +164 -165
  124. data/lib/rouge/lexers/sass/common.rb +1 -1
  125. data/lib/rouge/lexers/sass.rb +2 -2
  126. data/lib/rouge/lexers/scss.rb +2 -2
  127. data/lib/rouge/lexers/sed.rb +1 -1
  128. data/lib/rouge/lexers/shell.rb +5 -5
  129. data/lib/rouge/lexers/slice.rb +2 -2
  130. data/lib/rouge/lexers/sparql.rb +1 -1
  131. data/lib/rouge/lexers/sqf/keywords.rb +5 -3
  132. data/lib/rouge/lexers/sqf.rb +3 -4
  133. data/lib/rouge/lexers/stan.rb +9 -15
  134. data/lib/rouge/lexers/svelte.rb +2 -2
  135. data/lib/rouge/lexers/swift.rb +2 -2
  136. data/lib/rouge/lexers/tcl.rb +1 -1
  137. data/lib/rouge/lexers/terraform.rb +2 -2
  138. data/lib/rouge/lexers/thrift.rb +120 -0
  139. data/lib/rouge/lexers/tsx.rb +3 -3
  140. data/lib/rouge/lexers/ttcn3.rb +1 -1
  141. data/lib/rouge/lexers/twig.rb +2 -2
  142. data/lib/rouge/lexers/typescript.rb +3 -3
  143. data/lib/rouge/lexers/varnish.rb +8 -8
  144. data/lib/rouge/lexers/veryl.rb +109 -0
  145. data/lib/rouge/lexers/viml/keywords.rb +5 -7
  146. data/lib/rouge/lexers/viml.rb +8 -10
  147. data/lib/rouge/lexers/vue.rb +2 -2
  148. data/lib/rouge/lexers/xquery.rb +2 -1
  149. data/lib/rouge/lexers/yaml.rb +13 -1
  150. data/lib/rouge/lexers/yang.rb +42 -74
  151. data/lib/rouge/lexers/zig.rb +10 -10
  152. data/lib/rouge/plugins/redcarpet.rb +3 -2
  153. data/lib/rouge/regex_lexer.rb +25 -14
  154. data/lib/rouge/themes/gruvbox.rb +3 -0
  155. data/lib/rouge/token.rb +1 -1
  156. data/lib/rouge/util.rb +1 -1
  157. data/lib/rouge/version.rb +1 -1
  158. data/lib/rouge.rb +70 -59
  159. data/lib/rubocop/cop/rouge/no_building_alternation_pattern_in_regexp.rb +71 -0
  160. data/lib/rubocop/cop/rouge/no_huge_collections.rb +37 -0
  161. data/rouge.gemspec +8 -5
  162. metadata +40 -9
  163. data/lib/rouge/lexers/isbl/builtins.rb +0 -17
  164. data/lib/rouge/lexers/matlab/builtins.rb +0 -11
  165. /data/lib/rouge/demos/{coq → rocq} +0 -0
@@ -12,7 +12,7 @@ module Rouge
12
12
  desc 'The Ada 2012 programming language'
13
13
 
14
14
  # Ada identifiers are Unicode with underscores only allowed as separators.
15
- ID = /\b[[:alpha:]](?:\p{Pc}?[[:alnum:]])*\b/
15
+ ID = /[[:alpha:]](?:\p{Pc}?[[:alnum:]])*\b/
16
16
 
17
17
  # Numerals can also contain underscores.
18
18
  NUM = /\d(_?\d)*/
@@ -8,17 +8,9 @@
8
8
  module Rouge
9
9
  module Lexers
10
10
  class Apache
11
- def self.directives
12
- @directives ||= Set.new ["acceptfilter", "acceptpathinfo", "accessfilename", "action", "addalt", "addaltbyencoding", "addaltbytype", "addcharset", "adddefaultcharset", "adddescription", "addencoding", "addhandler", "addicon", "addiconbyencoding", "addiconbytype", "addinputfilter", "addlanguage", "addmoduleinfo", "addoutputfilter", "addoutputfilterbytype", "addtype", "alias", "aliasmatch", "allow", "allowconnect", "allowencodedslashes", "allowmethods", "allowoverride", "allowoverridelist", "anonymous", "anonymous_logemail", "anonymous_mustgiveemail", "anonymous_nouserid", "anonymous_verifyemail", "asyncrequestworkerfactor", "authbasicauthoritative", "authbasicfake", "authbasicprovider", "authbasicusedigestalgorithm", "authdbduserpwquery", "authdbduserrealmquery", "authdbmgroupfile", "authdbmtype", "authdbmuserfile", "authdigestalgorithm", "authdigestdomain", "authdigestnoncelifetime", "authdigestprovider", "authdigestqop", "authdigestshmemsize", "authformauthoritative", "authformbody", "authformdisablenostore", "authformfakebasicauth", "authformlocation", "authformloginrequiredlocation", "authformloginsuccesslocation", "authformlogoutlocation", "authformmethod", "authformmimetype", "authformpassword", "authformprovider", "authformsitepassphrase", "authformsize", "authformusername", "authgroupfile", "authldapauthorizeprefix", "authldapbindauthoritative", "authldapbinddn", "authldapbindpassword", "authldapcharsetconfig", "authldapcompareasuser", "authldapcomparednonserver", "authldapdereferencealiases", "authldapgroupattribute", "authldapgroupattributeisdn", "authldapinitialbindasuser", "authldapinitialbindpattern", "authldapmaxsubgroupdepth", "authldapremoteuserattribute", "authldapremoteuserisdn", "authldapsearchasuser", "authldapsubgroupattribute", "authldapsubgroupclass", "authldapurl", "authmerging", "authname", "authncachecontext", "authncacheenable", "authncacheprovidefor", "authncachesocache", "authncachetimeout", "authnzfcgicheckauthnprovider", "authnzfcgidefineprovider", "authtype", "authuserfile", "authzdbdlogintoreferer", "authzdbdquery", "authzdbdredirectquery", "authzdbmtype", "authzsendforbiddenonfailure", "balancergrowth", "balancerinherit", "balancermember", "balancerpersist", "brotlialteretag", "brotlicompressionmaxinputblock", "brotlicompressionquality", "brotlicompressionwindow", "brotlifilternote", "browsermatch", "browsermatchnocase", "bufferedlogs", "buffersize", "cachedefaultexpire", "cachedetailheader", "cachedirlength", "cachedirlevels", "cachedisable", "cacheenable", "cachefile", "cacheheader", "cacheignorecachecontrol", "cacheignoreheaders", "cacheignorenolastmod", "cacheignorequerystring", "cacheignoreurlsessionidentifiers", "cachekeybaseurl", "cachelastmodifiedfactor", "cachelock", "cachelockmaxage", "cachelockpath", "cachemaxexpire", "cachemaxfilesize", "cacheminexpire", "cacheminfilesize", "cachenegotiateddocs", "cachequickhandler", "cachereadsize", "cachereadtime", "cacheroot", "cachesocache", "cachesocachemaxsize", "cachesocachemaxtime", "cachesocachemintime", "cachesocachereadsize", "cachesocachereadtime", "cachestaleonerror", "cachestoreexpired", "cachestorenostore", "cachestoreprivate", "cgidscripttimeout", "cgimapextension", "cgipassauth", "cgivar", "charsetdefault", "charsetoptions", "charsetsourceenc", "checkcaseonly", "checkspelling", "chrootdir", "contentdigest", "cookiedomain", "cookieexpires", "cookiename", "cookiestyle", "cookietracking", "coredumpdirectory", "customlog", "dav", "davdepthinfinity", "davgenericlockdb", "davlockdb", "davmintimeout", "dbdexptime", "dbdinitsql", "dbdkeep", "dbdmax", "dbdmin", "dbdparams", "dbdpersist", "dbdpreparesql", "dbdriver", "defaulticon", "defaultlanguage", "defaultruntimedir", "defaulttype", "define", "deflatebuffersize", "deflatecompressionlevel", "deflatefilternote", "deflateinflatelimitrequestbody", "deflateinflateratioburst", "deflateinflateratiolimit", "deflatememlevel", "deflatewindowsize", "deny", "directorycheckhandler", "directoryindex", "directoryindexredirect", "directoryslash", "documentroot", "dtraceprivileges", "dumpioinput", "dumpiooutput", "enableexceptionhook", "enablemmap", "enablesendfile", "error", "errordocument", "errorlog", "errorlogformat", "example", "expiresactive", "expiresbytype", "expiresdefault", "extendedstatus", "extfilterdefine", "extfilteroptions", "fallbackresource", "fileetag", "filterchain", "filterdeclare", "filterprotocol", "filterprovider", "filtertrace", "forcelanguagepriority", "forcetype", "forensiclog", "globallog", "gprofdir", "gracefulshutdowntimeout", "group", "h2copyfiles", "h2direct", "h2earlyhints", "h2maxsessionstreams", "h2maxworkeridleseconds", "h2maxworkers", "h2minworkers", "h2moderntlsonly", "h2push", "h2pushdiarysize", "h2pushpriority", "h2pushresource", "h2serializeheaders", "h2streammaxmemsize", "h2tlscooldownsecs", "h2tlswarmupsize", "h2upgrade", "h2windowsize", "header", "headername", "heartbeataddress", "heartbeatlisten", "heartbeatmaxservers", "heartbeatstorage", "heartbeatstorage", "hostnamelookups", "httpprotocoloptions", "identitycheck", "identitychecktimeout", "imapbase", "imapdefault", "imapmenu", "include", "includeoptional", "indexheadinsert", "indexignore", "indexignorereset", "indexoptions", "indexorderdefault", "indexstylesheet", "inputsed", "isapiappendlogtoerrors", "isapiappendlogtoquery", "isapicachefile", "isapifakeasync", "isapilognotsupported", "isapireadaheadbuffer", "keepalive", "keepalivetimeout", "keptbodysize", "languagepriority", "ldapcacheentries", "ldapcachettl", "ldapconnectionpoolttl", "ldapconnectiontimeout", "ldaplibrarydebug", "ldapopcacheentries", "ldapopcachettl", "ldapreferralhoplimit", "ldapreferrals", "ldapretries", "ldapretrydelay", "ldapsharedcachefile", "ldapsharedcachesize", "ldaptimeout", "ldaptrustedclientcert", "ldaptrustedglobalcert", "ldaptrustedmode", "ldapverifyservercert", "limitinternalrecursion", "limitrequestbody", "limitrequestfields", "limitrequestfieldsize", "limitrequestline", "limitxmlrequestbody", "listen", "listenbacklog", "listencoresbucketsratio", "loadfile", "loadmodule", "logformat", "logiotrackttfb", "loglevel", "logmessage", "luaauthzprovider", "luacodecache", "luahookaccesschecker", "luahookauthchecker", "luahookcheckuserid", "luahookfixups", "luahookinsertfilter", "luahooklog", "luahookmaptostorage", "luahooktranslatename", "luahooktypechecker", "luainherit", "luainputfilter", "luamaphandler", "luaoutputfilter", "luapackagecpath", "luapackagepath", "luaquickhandler", "luaroot", "luascope", "maxconnectionsperchild", "maxkeepaliverequests", "maxmemfree", "maxrangeoverlaps", "maxrangereversals", "maxranges", "maxrequestworkers", "maxspareservers", "maxsparethreads", "maxthreads", "mdbaseserver", "mdcachallenges", "mdcertificateagreement", "mdcertificateauthority", "mdcertificateprotocol", "mddrivemode", "mdhttpproxy", "mdmember", "mdmembers", "mdmuststaple", "mdnotifycmd", "mdomain", "mdportmap", "mdprivatekeys", "mdrenewwindow", "mdrequirehttps", "mdstoredir", "memcacheconnttl", "mergetrailers", "metadir", "metafiles", "metasuffix", "mimemagicfile", "minspareservers", "minsparethreads", "mmapfile", "modemstandard", "modmimeusepathinfo", "multiviewsmatch", "mutex", "namevirtualhost", "noproxy", "nwssltrustedcerts", "nwsslupgradeable", "options", "order", "outputsed", "passenv", "pidfile", "privilegesmode", "protocol", "protocolecho", "protocols", "protocolshonororder", "proxyaddheaders", "proxybadheader", "proxyblock", "proxydomain", "proxyerroroverride", "proxyexpressdbmfile", "proxyexpressdbmtype", "proxyexpressenable", "proxyfcgibackendtype", "proxyfcgisetenvif", "proxyftpdircharset", "proxyftpescapewildcards", "proxyftplistonwildcard", "proxyhcexpr", "proxyhctemplate", "proxyhctpsize", "proxyhtmlbufsize", "proxyhtmlcharsetout", "proxyhtmldoctype", "proxyhtmlenable", "proxyhtmlevents", "proxyhtmlextended", "proxyhtmlfixups", "proxyhtmlinterp", "proxyhtmllinks", "proxyhtmlmeta", "proxyhtmlstripcomments", "proxyhtmlurlmap", "proxyiobuffersize", "proxymaxforwards", "proxypass", "proxypassinherit", "proxypassinterpolateenv", "proxypassmatch", "proxypassreverse", "proxypassreversecookiedomain", "proxypassreversecookiepath", "proxypreservehost", "proxyreceivebuffersize", "proxyremote", "proxyremotematch", "proxyrequests", "proxyscgiinternalredirect", "proxyscgisendfile", "proxyset", "proxysourceaddress", "proxystatus", "proxytimeout", "proxyvia", "qualifyredirecturl", "readmename", "receivebuffersize", "redirect", "redirectmatch", "redirectpermanent", "redirecttemp", "reflectorheader", "registerhttpmethod", "remoteipheader", "remoteipinternalproxy", "remoteipinternalproxylist", "remoteipproxiesheader", "remoteipproxyprotocol", "remoteipproxyprotocolexceptions", "remoteiptrustedproxy", "remoteiptrustedproxylist", "removecharset", "removeencoding", "removehandler", "removeinputfilter", "removelanguage", "removeoutputfilter", "removetype", "requestheader", "requestreadtimeout", "require", "rewritebase", "rewritecond", "rewriteengine", "rewritemap", "rewriteoptions", "rewriterule", "rlimitcpu", "rlimitmem", "rlimitnproc", "satisfy", "scoreboardfile", "script", "scriptalias", "scriptaliasmatch", "scriptinterpretersource", "scriptlog", "scriptlogbuffer", "scriptloglength", "scriptsock", "securelisten", "seerequesttail", "sendbuffersize", "serveradmin", "serveralias", "serverlimit", "servername", "serverpath", "serverroot", "serversignature", "servertokens", "session", "sessioncookiename", "sessioncookiename2", "sessioncookieremove", "sessioncryptocipher", "sessioncryptodriver", "sessioncryptopassphrase", "sessioncryptopassphrasefile", "sessiondbdcookiename", "sessiondbdcookiename2", "sessiondbdcookieremove", "sessiondbddeletelabel", "sessiondbdinsertlabel", "sessiondbdperuser", "sessiondbdselectlabel", "sessiondbdupdatelabel", "sessionenv", "sessionexclude", "sessionheader", "sessioninclude", "sessionmaxage", "setenv", "setenvif", "setenvifexpr", "setenvifnocase", "sethandler", "setinputfilter", "setoutputfilter", "ssiendtag", "ssierrormsg", "ssietag", "ssilastmodified", "ssilegacyexprparser", "ssistarttag", "ssitimeformat", "ssiundefinedecho", "sslcacertificatefile", "sslcacertificatepath", "sslcadnrequestfile", "sslcadnrequestpath", "sslcarevocationcheck", "sslcarevocationfile", "sslcarevocationpath", "sslcertificatechainfile", "sslcertificatefile", "sslcertificatekeyfile", "sslciphersuite", "sslcompression", "sslcryptodevice", "sslengine", "sslfips", "sslhonorcipherorder", "sslinsecurerenegotiation", "sslocspdefaultresponder", "sslocspenable", "sslocspnoverify", "sslocspoverrideresponder", "sslocspproxyurl", "sslocsprespondercertificatefile", "sslocsprespondertimeout", "sslocspresponsemaxage", "sslocspresponsetimeskew", "sslocspuserequestnonce", "sslopensslconfcmd", "ssloptions", "sslpassphrasedialog", "sslprotocol", "sslproxycacertificatefile", "sslproxycacertificatepath", "sslproxycarevocationcheck", "sslproxycarevocationfile", "sslproxycarevocationpath", "sslproxycheckpeercn", "sslproxycheckpeerexpire", "sslproxycheckpeername", "sslproxyciphersuite", "sslproxyengine", "sslproxymachinecertificatechainfile", "sslproxymachinecertificatefile", "sslproxymachinecertificatepath", "sslproxyprotocol", "sslproxyverify", "sslproxyverifydepth", "sslrandomseed", "sslrenegbuffersize", "sslrequire", "sslrequiressl", "sslsessioncache", "sslsessioncachetimeout", "sslsessionticketkeyfile", "sslsessiontickets", "sslsrpunknownuserseed", "sslsrpverifierfile", "sslstaplingcache", "sslstaplingerrorcachetimeout", "sslstaplingfaketrylater", "sslstaplingforceurl", "sslstaplingrespondertimeout", "sslstaplingresponsemaxage", "sslstaplingresponsetimeskew", "sslstaplingreturnrespondererrors", "sslstaplingstandardcachetimeout", "sslstrictsnivhostcheck", "sslusername", "sslusestapling", "sslverifyclient", "sslverifydepth", "startservers", "startthreads", "substitute", "substituteinheritbefore", "substitutemaxlinelength", "suexec", "suexecusergroup", "threadlimit", "threadsperchild", "threadstacksize", "timeout", "traceenable", "transferlog", "typesconfig", "undefine", "undefmacro", "unsetenv", "use", "usecanonicalname", "usecanonicalphysicalport", "user", "userdir", "vhostcgimode", "vhostcgiprivs", "vhostgroup", "vhostprivs", "vhostsecure", "vhostuser", "virtualdocumentroot", "virtualdocumentrootip", "virtualscriptalias", "virtualscriptaliasip", "watchdoginterval", "xbithack", "xml2encalias", "xml2encdefault", "xml2startparse"]
13
- end
14
-
15
- def self.sections
16
- @sections ||= Set.new ["authnprovideralias", "authzprovideralias", "directory", "directorymatch", "else", "elseif", "files", "filesmatch", "if", "ifdefine", "ifmodule", "ifversion", "limit", "limitexcept", "location", "locationmatch", "macro", "mdomainset", "proxy", "proxymatch", "requireall", "requireany", "requirenone", "virtualhost"]
17
- end
18
-
19
- def self.values
20
- @values ||= Set.new ["add", "addaltclass", "addsuffix", "alias", "all", "allow", "allowanyuri", "allownoslash", "always", "and", "any", "ap_auth_internal_per_uri", "api_version", "append", "ascending", "attribute", "auth", "auth-int", "authconfig", "auto", "backend-address", "balancer_name", "balancer_route_changed", "balancer_session_route", "balancer_session_sticky", "balancer_worker_name", "balancer_worker_route", "base", "basedn", "basic", "before", "block", "boolean", "byte", "byteranges", "cache", "cache-hit", "cache-invalidate", "cache-miss", "cache-revalidate", "cgi", "chain", "change", "charset", "circle", "cmd", "conditional-expression", "condpattern", "conn", "conn_remote_addr", "cookie", "cookie2", "current-uri", "date", "date_gmt", "date_local", "db", "dbm", "decoding", "default", "deny", "descending", "description", "descriptionwidth", "digest", "disabled", "disableenv", "dns", "document_args", "document_name", "document_root", "document_uri", "domain", "double", "duration", "early", "echo", "echomsg", "edit", "edit*", "email", "enableenv", "encoding", "env", "environment-variable-name", "errmsg", "error", "errorlog", "errorlogformat", "execcgi", "expr", "fallback", "fancyindexing", "fast", "file", "file-group", "file-owner", "fileinfo", "filename", "filter", "filter-name", "filter_name", "filters", "finding", "first-dot", "foldersfirst", "followsymlinks", "forever", "form", "formatted", "fpm", "from", "ftype", "full", "function_name", "gdbm", "generic", "gone", "handlers", "hit", "hook_function_name", "host", "hostname", "hse_append_log_parameter", "hse_req_done_with_session", "hse_req_is_connected", "hse_req_is_keep_conn", "hse_req_map_url_to_path", "hse_req_send_response_header", "hse_req_send_response_header_ex", "hse_req_send_url", "hse_req_send_url_redirect_resp", "html", "htmltable", "https", "iconheight", "iconsarelinks", "iconwidth", "ignore", "ignorecase", "ignoreclient", "ignorecontextinfo", "ignoreinherit", "imal", "in", "includes", "includesnoexec", "indexes", "inherit", "inheritbefore", "inheritdown", "inheritdownbefore", "inode", "input", "int", "integer", "intype", "ipaddr", "is_subreq", "iserror", "last-dot", "last_modified", "ldap", "leaf", "legacyprefixdocroot", "level", "limit", "log_function_name", "major", "manual", "map", "map1", "map2", "max", "md5", "md5-sess", "menu", "merge", "mergebase", "minor", "miss", "mod_cache_disk", "mod_cache_socache", "mode", "mtime", "multiviews", "mutual-failure", "mysql", "name", "namewidth", "ndbm", "negotiatedonly", "never", "no", "nochange", "nocontent", "nodecode", "none", "nonfatal", "note", "number-of-ranges", "odbc", "off", "on", "once", "onerror", "onfail", "option", "optional", "options", "or", "oracle", "order", "original-uri", "os", "output", "outtype", "parent-first", "parent-last", "path", "path_info", "permanent", "pipe", "point", "poly", "postgresql", "prefer", "preservescontentlength", "prg", "protocol", "provider-name", "provider_name", "proxy", "proxy-chain-auth", "proxy-fcgi-pathinfo", "proxy-initial-not-pooled", "proxy-interim-response", "proxy-nokeepalive", "proxy-scgi-pathinfo", "proxy-sendcl", "proxy-sendextracrlf", "proxy-source-port", "proxy-status", "qs", "query_string_unescaped", "range", "ratio", "rect", "referer", "regex", "registry", "registry-strict", "remote_addr", "remote_host", "remote_ident", "remote_user", "remove", "request", "request_filename", "request_rec", "request_scheme", "request_uri", "reset", "revalidate", "rewritecond", "rfc2109", "rnd", "scanhtmltitles", "scope", "script", "sdbm", "searching", "secure", "seeother", "selective", "semiformatted", "server", "server_addr", "server_admin", "server_name", "set", "setifempty", "showforbidden", "size", "sizefmt", "sqlite2", "sqlite3", "ssl", "ssl-access-forbidden", "ssl-secure-reneg", "startbody", "stat", "string", "string1", "subnet", "suppresscolumnsorting", "suppressdescription", "suppresshtmlpreamble", "suppressicon", "suppresslastmodified", "suppressrules", "suppresssize", "symlinksifownermatch", "temp", "temporary", "test_condition1", "the_request", "thread", "timefmt", "tls", "to-pattern", "trackmodified", "transform", "txt", "type", "uctonly", "uid", "unescape", "unformatted", "unlimited", "unset", "uri-pattern", "url", "url-of-terms-of-service", "url-path", "useolddateformat", "value", "value-expression", "var", "versionsort", "virtual", "x-forwarded-for", "x-forwarded-host", "x-forwarded-server", "xhtml"]
21
- end
11
+ DIRECTIVES = Set["accepterrorsnonfatal", "acceptfilter", "acceptmutex", "acceptpathinfo", "accessfilename", "action", "addalt", "addaltbyencoding", "addaltbytype", "addcharset", "adddefaultcharset", "adddescription", "addencoding", "addhandler", "addicon", "addiconbyencoding", "addiconbytype", "addinputfilter", "addlanguage", "addmoduleinfo", "addoutputfilter", "addoutputfilterbytype", "addtype", "alias", "aliasmatch", "aliaspreservepath", "allow", "allowconnect", "allowencodedslashes", "allowhandlers", "allowmethods", "allowoverride", "allowoverridelist", "anonymous", "anonymous_logemail", "anonymous_mustgiveemail", "anonymous_nouserid", "anonymous_verifyemail", "asyncfilter", "authbasicauthoritative", "authbasicfake", "authbasicprovider", "authbasicusedigestalgorithm", "authbearerauthoritative", "authbearerprovider", "authbearerproxy", "authdbduserpwquery", "authdbduserrealmquery", "authdbmgroupfile", "authdbmtype", "authdbmuserfile", "authdigestalgorithm", "authdigestdomain", "authdigestnccheck", "authdigestnonceformat", "authdigestnoncelifetime", "authdigestprovider", "authdigestqop", "authdigestshmemsize", "authformauthoritative", "authformbody", "authformdisablenostore", "authformfakebasicauth", "authformlocation", "authformloginrequiredlocation", "authformloginsuccesslocation", "authformlogoutlocation", "authformmethod", "authformmimetype", "authformpassword", "authformprovider", "authformsitepassphrase", "authformsize", "authformusername", "authgroupfile", "authldapauthorizeprefix", "authldapbindauthoritative", "authldapbinddn", "authldapbindpassword", "authldapcharsetconfig", "authldapcompareasuser", "authldapcomparednonserver", "authldapdereferencealiases", "authldapgroupattribute", "authldapgroupattributeisdn", "authldapinitialbindasuser", "authldapinitialbindpattern", "authldapmaxsubgroupdepth", "authldapremoteuserattribute", "authldapremoteuserisdn", "authldapsearchasuser", "authldapsubgroupattribute", "authldapsubgroupclass", "authldapurl", "authmerging", "authname", "authncachecontext", "authncacheenable", "authncacheprovidefor", "authncachesocache", "authncachetimeout", "authnzfcgicheckauthnprovider", "authnzfcgidefineprovider", "authtjwtclaim", "authtjwtdriver", "authtjwtsign", "authtjwtverify", "authtype", "authuserfile", "authzdbdlogintoreferer", "authzdbdquery", "authzdbdredirectquery", "authzdbmauthoritative", "authzdbmtype", "authzgroupfileauthoritative", "authzownerauthoritative", "authzsendforbiddenonfailure", "authzuserauthoritative", "balancergrowth", "balancerinherit", "balancermember", "balancerpersist", "brotlialteretag", "brotlicompressionmaxinputblock", "brotlicompressionquality", "brotlicompressionwindow", "brotlifilternote", "browsermatch", "browsermatchnocase", "bufferedlogs", "buffersize", "cachedefaultexpire", "cachedetailheader", "cachedirlength", "cachedirlevels", "cachedisable", "cacheenable", "cachefile", "cacheheader", "cacheignorecachecontrol", "cacheignoreheaders", "cacheignorenolastmod", "cacheignorequerystring", "cacheignoreurlsessionidentifiers", "cachekeybaseurl", "cachelastmodifiedfactor", "cachelock", "cachelockmaxage", "cachelockpath", "cachemaxexpire", "cachemaxfilesize", "cacheminexpire", "cacheminfilesize", "cachenegotiateddocs", "cachequickhandler", "cachereadsize", "cachereadtime", "cacheroot", "cachesocache", "cachesocachemaxsize", "cachesocachemaxtime", "cachesocachemintime", "cachesocachereadsize", "cachesocachereadtime", "cachestaleonerror", "cachestoreexpired", "cachestorenostore", "cachestoreprivate", "cgidscripttimeout", "cgimapextension", "cgipassauth", "cgiscripttimeout", "cgivar", "charsetdefault", "charsetoptions", "charsetsourceenc", "checkbasenamematch", "checkcaseonly", "checkspelling", "chrootdir", "contentdigest", "cookiedomain", "cookieexpires", "cookiehttponly", "cookielog", "cookiename", "cookiesamesite", "cookiesecure", "cookiestyle", "cookietracking", "coredumpdirectory", "cryptocipher", "cryptodriver", "cryptoiv", "cryptokey", "cryptosize", "ctauditstorage", "ctlogclient", "ctlogconfigdb", "ctmaxsctage", "ctproxyawareness", "ctsctstorage", "ctserverhellosctlimit", "ctstaticlogconfig", "ctstaticscts", "customlog", "dav", "davbasepath", "davdepthinfinity", "davgenericlockdb", "davlockdb", "davlockdbtype", "davlockdiscovery", "davmintimeout", "davmsext", "davquota", "dbdexptime", "dbdinitsql", "dbdkeep", "dbdmax", "dbdmin", "dbdparams", "dbdpersist", "dbdpreparesql", "dbdriver", "defaulticon", "defaultlanguage", "defaultruntimedir", "defaultstatedir", "defaulttype", "define", "deflatealteretag", "deflatebuffersize", "deflatecompressionlevel", "deflatefilternote", "deflateinflatelimitrequestbody", "deflateinflateratioburst", "deflateinflateratiolimit", "deflatememlevel", "deflatewindowsize", "deny", "directorycheckhandler", "directoryindex", "directoryindexredirect", "directoryslash", "documentroot", "dtraceprivileges", "dumpioinput", "dumpiologlevel", "dumpiooutput", "enableexceptionhook", "enablemmap", "enablesendfile", "error", "errordocument", "errorlog", "errorlogformat", "example", "expiresactive", "expiresbytype", "expiresdefault", "extendedstatus", "extfilterdefine", "extfilteroptions", "fallbackresource", "fileetag", "filterchain", "filterdeclare", "filterprotocol", "filterprovider", "filtertrace", "firehoseconnectioninput", "firehoseconnectionoutput", "firehoseproxyconnectioninput", "firehoseproxyconnectionoutput", "firehoserequestinput", "firehoserequestoutput", "flushmaxpipelined", "flushmaxthreshold", "forcelanguagepriority", "forcetype", "forensiclog", "globallog", "gprofdir", "gracefulshutdowntimeout", "group", "h2copyfiles", "h2direct", "h2earlyhint", "h2earlyhints", "h2maxdataframelen", "h2maxheaderblocklen", "h2maxsessionstreams", "h2maxstreamerrors", "h2maxworkeridleseconds", "h2maxworkers", "h2minworkers", "h2moderntlsonly", "h2outputbuffering", "h2padding", "h2proxyrequests", "h2push", "h2pushdiarysize", "h2pushpriority", "h2pushresource", "h2serializeheaders", "h2streammaxmemsize", "h2streamtimeout", "h2tlscooldownsecs", "h2tlswarmupsize", "h2upgrade", "h2websockets", "h2windowsize", "header", "headername", "heartbeataddress", "heartbeatlisten", "heartbeatmaxservers", "heartbeatstorage", "hostnamelookups", "httpprotocoloptions", "identitycheck", "identitychecktimeout", "imapbase", "imapdefault", "imapmenu", "include", "includeoptional", "indexforbiddenreturn404", "indexheadinsert", "indexignore", "indexignorereset", "indexoptions", "indexorderdefault", "indexstylesheet", "inputsed", "isapiappendlogtoerrors", "isapiappendlogtoquery", "isapicachefile", "isapifakeasync", "isapilognotsupported", "isapireadaheadbuffer", "keepalive", "keepalivetimeout", "keptbodysize", "languagepriority", "ldapcacheentries", "ldapcachettl", "ldapconnectionpoolttl", "ldapconnectiontimeout", "ldaplibrarydebug", "ldapopcacheentries", "ldapopcachettl", "ldapreferralhoplimit", "ldapreferrals", "ldapretries", "ldapretrydelay", "ldapsharedcachefile", "ldapsharedcachesize", "ldaptimeout", "ldaptrustedclientcert", "ldaptrustedglobalcert", "ldaptrustedmode", "ldapverifyservercert", "limitinternalrecursion", "limitrequestbody", "limitrequestfields", "limitrequestfieldsize", "limitrequestline", "limitxmlrequestbody", "listen", "listenbacklog", "listencoresbucketsratio", "listentcpdeferaccept", "loadfile", "loadmodule", "lockfile", "logformat", "logiotrackttfb", "logiotrackttfu", "loglevel", "logleveloverride", "logmessage", "luaauthzprovider", "luacodecache", "luahookaccesschecker", "luahookauthchecker", "luahookcheckuserid", "luahookfixups", "luahookinsertfilter", "luahooklog", "luahookmaptostorage", "luahookpretranslate", "luahooktranslatename", "luahooktypechecker", "luainherit", "luainputfilter", "luamaphandler", "luaoutputfilter", "luapackagecpath", "luapackagepath", "luaquickhandler", "luaroot", "luascope", "macroignorebadnesting", "macroignoreemptyargs", "maxclients", "maxconnectionsperchild", "maxkeepaliverequests", "maxmemfree", "maxrangeoverlaps", "maxrangereversals", "maxranges", "maxrequestsperchild", "maxrequestworkers", "maxspareservers", "maxsparethreads", "maxthreads", "mdactivationdelay", "mdbaseserver", "mdcacertificatefile", "mdcachallenges", "mdcertificateagreement", "mdcertificateauthority", "mdcertificatecheck", "mdcertificatefile", "mdcertificatekeyfile", "mdcertificatemonitor", "mdcertificateprotocol", "mdcertificatestatus", "mdchallengedns01", "mdchallengedns01version", "mdcheckinterval", "mdcontactemail", "mddrivemode", "mdexternalaccountbinding", "mdhttpproxy", "mdinitialdelay", "mdmatchnames", "mdmember", "mdmembers", "mdmessagecmd", "mdmuststaple", "mdnotifycmd", "mdomain", "mdportmap", "mdprivatekeys", "mdprofile", "mdprofilemandatory", "mdrenewmode", "mdrenewviaari", "mdrenewwindow", "mdrequirehttps", "mdretrydelay", "mdretryfailover", "mdserverstatus", "mdstapleothers", "mdstapling", "mdstaplingkeepresponse", "mdstaplingrenewwindow", "mdstoredir", "mdstorelocks", "mdwarnwindow", "memcacheconnttl", "mergeslashes", "mergetrailers", "metadir", "metafiles", "metasuffix", "mimemagicfile", "mimeoptions", "minspareservers", "minsparethreads", "mmapfile", "modemstandard", "modmimeusepathinfo", "multiviewsmatch", "mutex", "namevirtualhost", "noproxy", "nwssltrustedcerts", "nwsslupgradeable", "options", "order", "outputsed", "passenv", "pidfile", "policyconditional", "policyconditionalurl", "policyenvironment", "policyfilter", "policykeepalive", "policykeepaliveurl", "policylength", "policylengthurl", "policymaxage", "policymaxageurl", "policynocache", "policynocacheurl", "policytype", "policytypeurl", "policyvalidation", "policyvalidationurl", "policyvary", "policyvaryurl", "policyversion", "policyversionurl", "privilegesmode", "protocol", "protocolecho", "protocols", "protocolshonororder", "proxy100continue", "proxyaddheaders", "proxybadheader", "proxyblock", "proxydomain", "proxyerroroverride", "proxyexpressdbmfile", "proxyexpressdbmtype", "proxyexpressenable", "proxyfcgibackendtype", "proxyfcgisetenvif", "proxyftpdircharset", "proxyftpescapewildcards", "proxyftplistonwildcard", "proxyhcexpr", "proxyhctemplate", "proxyhctpsize", "proxyhtmlbufsize", "proxyhtmlcharsetout", "proxyhtmldoctype", "proxyhtmlenable", "proxyhtmlevents", "proxyhtmlextended", "proxyhtmlfixups", "proxyhtmlinterp", "proxyhtmllinks", "proxyhtmlmeta", "proxyhtmlstripcomments", "proxyhtmlurlmap", "proxyiobuffersize", "proxymaxforwards", "proxypass", "proxypassinherit", "proxypassinterpolateenv", "proxypassmatch", "proxypassreverse", "proxypassreversecookiedomain", "proxypassreversecookiepath", "proxypreservehost", "proxyreceivebuffersize", "proxyremote", "proxyremotematch", "proxyrequests", "proxyscgiinternalredirect", "proxyscgisendfile", "proxyset", "proxysourceaddress", "proxystatus", "proxytimeout", "proxyvia", "proxywebsocketasync", "proxywebsocketasyncdelay", "proxywebsocketfallbacktoproxyhttp", "proxywebsocketidletimeout", "qualifyredirecturl", "readbuffersize", "readmename", "receivebuffersize", "redirect", "redirectmatch", "redirectpermanent", "redirectrelative", "redirecttemp", "redisconnpoolttl", "redistimeout", "reflectorheader", "regexdefaultoptions", "registerhttpmethod", "remoteipheader", "remoteipinternalproxy", "remoteipinternalproxylist", "remoteipproxiesheader", "remoteipproxyprotocol", "remoteipproxyprotocolexceptions", "remoteiptrustedproxy", "remoteiptrustedproxylist", "removecharset", "removeencoding", "removehandler", "removeinputfilter", "removelanguage", "removeoutputfilter", "removetype", "requestheader", "requestreadtimeout", "require", "rewritebase", "rewritecond", "rewriteengine", "rewritemap", "rewriteoptions", "rewriterule", "rlimitcpu", "rlimitmem", "rlimitnproc", "satisfy", "scoreboardfile", "script", "scriptalias", "scriptaliasmatch", "scriptinterpretersource", "scriptlog", "scriptlogbuffer", "scriptloglength", "scriptsock", "securelisten", "seerequesttail", "sendbuffersize", "serveradmin", "serveralias", "serverlimit", "servername", "serverpath", "serverroot", "serversignature", "servertokens", "session", "sessioncookiemaxage", "sessioncookiename", "sessioncookiename2", "sessioncookieremove", "sessioncryptocipher", "sessioncryptodriver", "sessioncryptopassphrase", "sessioncryptopassphrasefile", "sessiondbdcookiename", "sessiondbdcookiename2", "sessiondbdcookieremove", "sessiondbddeletelabel", "sessiondbdinsertlabel", "sessiondbdperuser", "sessiondbdselectlabel", "sessiondbdupdatelabel", "sessionenv", "sessionexclude", "sessionexpiryupdateinterval", "sessionheader", "sessioninclude", "sessionmaxage", "setenv", "setenvif", "setenvifexpr", "setenvifnocase", "sethandler", "setinputfilter", "setoutputfilter", "ssiaccessenable", "ssiendtag", "ssierrormsg", "ssietag", "ssilastmodified", "ssilegacyexprparser", "ssistarttag", "ssitimeformat", "ssiundefinedecho", "sslcacertificatefile", "sslcacertificatepath", "sslcadnrequestfile", "sslcadnrequestpath", "sslcarevocationcheck", "sslcarevocationfile", "sslcarevocationpath", "sslcertificatechainfile", "sslcertificatefile", "sslcertificatekeyfile", "sslciphersuite", "sslclienthellovars", "sslcompression", "sslcryptodevice", "sslechkeydir", "sslengine", "sslfips", "sslhonorcipherorder", "sslinsecurerenegotiation", "sslocspdefaultresponder", "sslocspenable", "sslocspnoverify", "sslocspoverrideresponder", "sslocspproxyurl", "sslocsprespondercertificatefile", "sslocsprespondertimeout", "sslocspresponsemaxage", "sslocspresponsetimeskew", "sslocspuserequestnonce", "sslopensslconfcmd", "ssloptions", "sslpassphrasedialog", "sslpolicy", "sslprotocol", "sslproxycacertificatefile", "sslproxycacertificatepath", "sslproxycarevocationcheck", "sslproxycarevocationfile", "sslproxycarevocationpath", "sslproxycheckpeercn", "sslproxycheckpeerexpire", "sslproxycheckpeername", "sslproxyciphersuite", "sslproxyengine", "sslproxymachinecertificatechainfile", "sslproxymachinecertificatefile", "sslproxymachinecertificatepath", "sslproxypolicy", "sslproxyprotocol", "sslproxyverify", "sslproxyverifydepth", "sslrandomseed", "sslrenegbuffersize", "sslrequire", "sslrequiressl", "sslsessioncache", "sslsessioncachetimeout", "sslsessionticketkeyfile", "sslsessiontickets", "sslsrpunknownuserseed", "sslsrpverifierfile", "sslstaplingcache", "sslstaplingerrorcachetimeout", "sslstaplingfaketrylater", "sslstaplingforceurl", "sslstaplingrespondertimeout", "sslstaplingresponsemaxage", "sslstaplingresponsetimeskew", "sslstaplingreturnrespondererrors", "sslstaplingstandardcachetimeout", "sslstrictsnivhostcheck", "sslusername", "sslusestapling", "sslverifyclient", "sslverifydepth", "sslvhostsnipolicy", "startservers", "startthreads", "stricthostcheck", "substitute", "substituteinheritbefore", "substitutemaxlinelength", "suexec", "suexecusergroup", "threadlimit", "threadsperchild", "threadstacksize", "timeout", "traceenable", "transferlog", "typesconfig", "unclist", "undefine", "undefmacro", "unsetenv", "use", "usecanonicalname", "usecanonicalphysicalport", "user", "userdir", "vhostcgimode", "vhostcgiprivs", "vhostgroup", "vhostprivs", "vhostsecure", "vhostuser", "virtualdocumentroot", "virtualdocumentrootip", "virtualscriptalias", "virtualscriptaliasip", "warning", "watchdoginterval", "xbithack", "xml2encalias", "xml2encdefault", "xml2startparse"]
12
+ VALUES = Set["accepted", "add", "addsuffix", "all", "alllastextension", "allowanyuri", "allownoslash", "always", "and", "any", "api_version", "append", "ascending", "auth", "auth-int", "authbasicprovider", "authn", "authnz", "authonly", "authz", "auto", "base", "basic", "before", "block", "byteranges", "cache", "cgi", "chain", "change", "charset", "check_user_id", "circle", "cmd", "conn", "conn_remote_addr", "connection", "cookie", "cookie2", "current-uri", "date", "date_gmt", "date_local", "db", "debuglevel", "decoding", "default", "descending", "description", "descriptionwidth", "digest", "directory", "disable", "disabled", "disableenv", "dns", "document_args", "document_name", "document_path_info", "document_uri", "dollar_endonly", "dotall", "double", "duration", "early", "echo", "echomsg", "edit", "edit*", "email", "enable", "enableenv", "encoding", "entier", "env", "errmsg", "error", "es", "execcgi", "expr", "extended", "fallback", "fancyindexing", "fast", "fcntl", "file", "filter_name", "filters", "finding", "flock", "foldersfirst", "followsymlinks", "forever", "form", "formatted", "fpm", "from", "ftype", "full", "function_name", "gdbm", "generic", "gone", "handlers", "hook_function_name", "host", "hse_append_log_parameter", "hse_req_done_with_session", "hse_req_is_connected", "hse_req_is_keep_conn", "hse_req_map_url_to_path", "hse_req_send_response_header", "hse_req_send_response_header_ex", "hse_req_send_url", "hse_req_send_url_redirect_resp", "html", "html5or", "htmltable", "https", "icase", "iconheight", "iconsarelinks", "iconwidth", "ignore", "ignorecase", "ignoreclient", "ignorecontextinfo", "ignoreinherit", "imal", "includes", "includesnoexec", "indexes", "inherit", "inheritbefore", "inheritdown", "inheritdownbefore", "input", "insecure", "integer", "intype", "is_subreq", "iserror", "last_modified", "lax", "leaf", "legacyprefixdocroot", "level", "log", "log_function_name", "longurloptimization", "major", "manual", "map", "max", "md5", "md5-sess", "menu", "merge", "mergebase", "minor", "mode", "modele-uri", "ms", "multiviews", "mutual-failure", "name", "namewidth", "ndbm", "negotiatedonly", "netscape", "network", "never", "no", "noalllastextension", "nochange", "nocontent", "nodecode", "nom_fonction_hook", "none", "note", "notfound", "notypeslastextension", "off", "on", "once", "onerror", "onfail", "optional", "or", "original-uri", "os", "output", "outtype", "parent-first", "parent-last", "permanent", "point", "poly", "posixsem", "prefer", "preservescontentlength", "provider_name", "proxy", "proxyhtmldoctype", "pthread", "qs", "query_string_unescaped", "range", "ratio", "rect", "referer", "registry", "registry-strict", "remote_addr", "remove", "request", "request_filename", "request_hostname", "request_scheme", "request_uri", "request_user", "request_useragent_ip", "require", "reset", "rfc2109", "rfc2965", "scanhtmltitles", "script", "sdbm", "searching", "secure", "seeother", "selective", "sem", "semiformatted", "server", "server_hostname", "servernames", "set", "setifempty", "showforbidden", "size", "sizefmt", "ssl", "ssl-access-forbidden", "ssl-secure-reneg", "startbody", "stat", "strict", "suppresscolumnsorting", "suppressdescription", "suppresshtmlpreamble", "suppressicon", "suppresslastmodified", "suppressrules", "suppresssize", "symlinksifownermatch", "sysvsem", "temp", "temporary", "the_request", "thread", "timefmt", "tls", "trackmodified", "transform", "typeslastextension", "uctonly", "uid", "unformatted", "unlimited", "unset", "uri-pattern", "url", "user_name", "value", "var", "versionsort", "virtual", "x-forwarded-for", "x-forwarded-host", "x-forwarded-server", "xhtml"]
13
+ SECTIONS = Set["authnprovideralias", "authtprovideralias", "authzprovideralias", "directory", "directorymatch", "else", "elseif", "files", "filesmatch", "if", "ifdefine", "ifdirective", "iffile", "ifmodule", "ifsection", "ifversion", "limit", "limitexcept", "location", "locationmatch", "macro", "mdomainset", "proxy", "proxymatch", "requireall", "requireany", "requirenone", "sslpolicydefine", "virtualhost"]
22
14
  end
23
15
  end
24
16
  end
@@ -12,31 +12,18 @@ module Rouge
12
12
  filenames '.htaccess', 'httpd.conf'
13
13
 
14
14
  # self-modifying method that loads the keywords file
15
- def self.directives
16
- Kernel::load File.join(Lexers::BASE_DIR, 'apache/keywords.rb')
17
- directives
15
+ lazy do
16
+ require_relative 'apache/keywords'
18
17
  end
19
18
 
20
- def self.sections
21
- Kernel::load File.join(Lexers::BASE_DIR, 'apache/keywords.rb')
22
- sections
23
- end
19
+ def name_for_token(token, tktype)
20
+ token = token.downcase
24
21
 
25
- def self.values
26
- Kernel::load File.join(Lexers::BASE_DIR, 'apache/keywords.rb')
27
- values
28
- end
22
+ return tktype if SECTIONS.include?(token)
23
+ return tktype if DIRECTIVES.include?(token)
24
+ return tktype if VALUES.include?(token)
29
25
 
30
- def name_for_token(token, tktype)
31
- if self.class.sections.include? token
32
- tktype
33
- elsif self.class.directives.include? token
34
- tktype
35
- elsif self.class.values.include? token
36
- tktype
37
- else
38
- Text
39
- end
26
+ Text
40
27
  end
41
28
 
42
29
  state :whitespace do
@@ -48,12 +35,12 @@ module Rouge
48
35
  mixin :whitespace
49
36
 
50
37
  rule %r/(<\/?)(\w+)/ do |m|
51
- groups Punctuation, name_for_token(m[2].downcase, Name::Label)
38
+ groups Punctuation, name_for_token(m[2], Name::Label)
52
39
  push :section
53
40
  end
54
41
 
55
42
  rule %r/\w+/ do |m|
56
- token name_for_token(m[0].downcase, Name::Class)
43
+ token name_for_token(m[0], Name::Class)
57
44
  push :directive
58
45
  end
59
46
  end
@@ -75,8 +62,22 @@ module Rouge
75
62
  mixin :whitespace
76
63
 
77
64
  rule %r/\S+/ do |m|
78
- token name_for_token(m[0].downcase, Literal::String::Symbol)
65
+ if VALUES.include?(m[0].downcase)
66
+ token Literal::String::Symbol
67
+ else
68
+ fallthrough!
69
+ end
79
70
  end
71
+
72
+ rule(%r/(?=\S)/) { push :value }
73
+ end
74
+
75
+ state :value do
76
+ rule %r/[ \t]+/, Text, :pop!
77
+ rule %r/[^\s%]+/, Text
78
+ rule %r/%{.*?}/, Name::Variable
79
+ rule %r/[%]/, Text
80
+ rule(/(?=\n)/) { pop! }
80
81
  end
81
82
  end
82
83
  end
@@ -30,8 +30,8 @@ module Rouge
30
30
  def self.soql
31
31
  @soql ||= Set.new %w(
32
32
  SELECT FROM WHERE UPDATE LIKE TYPEOF END USING SCOPE WITH DATA
33
- CATEGORY GROUP BY ROLLUP CUBE HAVING ORDER BY ASC DESC NULLS FIRST
34
- LAST LIMIT OFFSET FOR VIEW REFERENCE UPDATE TRACKING VIEWSTAT OR AND
33
+ CATEGORY GROUP BY ROLLUP CUBE HAVING ORDER ASC DESC NULLS FIRST
34
+ LAST LIMIT OFFSET FOR VIEW REFERENCE TRACKING VIEWSTAT OR AND
35
35
  )
36
36
  end
37
37
 
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'markdown'
4
+
3
5
  module Rouge
4
6
  module Lexers
5
- load_lexer 'markdown.rb'
6
-
7
7
  class APIBlueprint < Markdown
8
8
  title 'API Blueprint'
9
9
  desc 'Markdown based API description language.'
@@ -9,7 +9,7 @@ module Rouge
9
9
 
10
10
  def self.keywords
11
11
  @keywords ||= Set.new %w(
12
- as assert existing extends extension false for from func if import in metadata module
12
+ as assert existing extends extension false for from func if import in metadata module
13
13
  none null output param provider resource targetScope test true type using var void with
14
14
  )
15
15
  end
@@ -76,7 +76,7 @@ module Rouge
76
76
  # Ignore whitespace
77
77
  rule %r/\s+/, Text
78
78
  end
79
-
79
+
80
80
  state :comments do
81
81
  rule %r(//[^\n\r]+), Comment::Single
82
82
  rule %r(/\*.*?\*/)m, Comment::Multiline
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'xml'
4
+ require_relative 'csharp'
5
+
3
6
  module Rouge
4
7
  module Lexers
5
- load_lexer 'xml.rb'
6
-
7
8
  class BIML < XML
8
9
  title "BIML"
9
10
  desc "BIML, Business Intelligence Markup Language"
@@ -14,22 +15,48 @@ module Rouge
14
15
  return true if text =~ /<\s*Biml\b/
15
16
  end
16
17
 
18
+ start do
19
+ @csharp = CSharp.new(options)
20
+ end
21
+
22
+ state :biml_interp do
23
+ rule %r(<#[=]?)m do
24
+ token Name::Tag
25
+ push :directive_as_csharp
26
+ end
27
+ end
28
+
17
29
  prepend :root do
18
30
  rule %r(<#\@\s*)m, Name::Tag, :directive_tag
19
31
 
20
- rule %r(<#[=]?\s*)m, Name::Tag, :directive_as_csharp
32
+ mixin :biml_interp
21
33
  end
22
34
 
23
35
  prepend :attr do
24
- #TODO: how to deal with embedded <# tags inside a attribute string
25
- #rule %r("<#[=]?\s*)m, Name::Tag, :directive_as_csharp
36
+ rule(%r/"/) { token Str::Double; goto :biml_dq }
37
+ rule(%r/'/) { token Str::Double; goto :biml_sq }
38
+
39
+ mixin :biml_interp
40
+ end
41
+
42
+ state :biml_dq do
43
+ rule %r/[^<"]+/, Str::Double
44
+ mixin :biml_interp
45
+ rule %r/"/, Str::Double, :pop!
46
+ rule %r/</, Str::Double
47
+ end
48
+
49
+ state :biml_sq do
50
+ rule %r/[^<']+/, Str::Single
51
+ mixin :biml_interp
52
+ rule %r/'/, Str::Single, :pop!
53
+ rule %r/</, Str::Single
26
54
  end
27
55
 
28
56
  state :directive_as_csharp do
29
- rule %r/\s*#>\s*/m, Name::Tag, :pop!
30
- rule %r(.*?(?=\s*#>\s*))m do
31
- delegate CSharp
32
- end
57
+ rule(/[^#]+/) { delegate @csharp }
58
+ rule %r/#>/, Name::Tag, :pop!
59
+ rule(/[#>]/) { delegate @csharp }
33
60
  end
34
61
 
35
62
  state :directive_tag do
@@ -64,19 +64,18 @@ module Rouge
64
64
  @builtins ||= Set.new %w(
65
65
  roAppendFile roAppInfo roAppManager roArray roAssociativeArray
66
66
  roAudioGuide roAudioMetadata roAudioPlayer roAudioPlayerEvent
67
- roAudioResourceroBitmap roBoolean roBoolean roBrightPackage roBrSub
67
+ roAudioResourceroBitmap roBoolean roBrightPackage roBrSub
68
68
  roButton roByteArray roCaptionRenderer roCaptionRendererEvent
69
69
  roCecInterface roCECStatusEvent roChannelStore roChannelStoreEvent
70
70
  roClockWidget roCodeRegistrationScreen
71
- roCodeRegistrationScreenEventroCompositor roControlDown roControlPort
72
- roControlPort roControlUp roCreateFile roDatagramReceiver
71
+ roCodeRegistrationScreenEventroCompositor roControlDown roControlPort roControlUp roCreateFile roDatagramReceiver
73
72
  roDatagramSender roDataGramSocket roDateTime roDeviceInfo
74
73
  roDeviceInfoEvent roDoubleroEVPCipher roEVPDigest roFileSystem
75
74
  roFileSystemEvent roFloat roFont roFontMetrics roFontRegistry
76
75
  roFunction roGlobal roGpio roGridScreen roGridScreenEvent
77
76
  roHdmiHotPlugEventroHdmiStatus roHdmiStatusEvent roHMAC roHttpAgent
78
77
  roImageCanvas roImageCanvasEvent roImageMetadata roImagePlayer
79
- roImageWidgetroInput roInputEvent roInt roInt roInvalid roInvalid
78
+ roImageWidgetroInput roInputEvent roInt roInvalid
80
79
  roIRRemote roKeyboard roKeyboardPress roKeyboardScreen
81
80
  roKeyboardScreenEventroList roListScreen roListScreenEvent
82
81
  roLocalization roLongInteger roMessageDialog roMessageDialogEvent
@@ -17,9 +17,10 @@ module Rouge
17
17
 
18
18
  def self.keywords
19
19
  @keywords ||= Set.new %w(
20
- auto break case const continue default do else enum extern
21
- for goto if register restricted return sizeof static struct
22
- switch typedef union volatile virtual while
20
+ alignas alignof auto break case const constexpr continue
21
+ default do else enum extern for goto if register return
22
+ sizeof static static_assert struct switch typedef typeof
23
+ typeof_unqual union volatile while
23
24
 
24
25
  _Alignas _Alignof _Atomic _Generic _Imaginary
25
26
  _Noreturn _Static_assert _Thread_local
@@ -44,6 +45,8 @@ module Rouge
44
45
  uintmax_t
45
46
 
46
47
  char16_t char32_t
48
+
49
+ _BitInt _Decimal128 _Decimal32 _Decimal64 bool nullptr_t
47
50
  )
48
51
  end
49
52
 
@@ -52,7 +55,8 @@ module Rouge
52
55
  __asm __int8 __based __except __int16 __stdcall __cdecl
53
56
  __fastcall __int32 __declspec __finally __int61 __try __leave
54
57
  inline _inline __inline naked _naked __naked restrict _restrict
55
- __restrict thread _thread __thread typename _typename __typename
58
+ __restrict thread _thread __thread thread_local
59
+ typename _typename __typename
56
60
  )
57
61
  end
58
62
 
@@ -108,7 +112,7 @@ module Rouge
108
112
  rule %r([~!%^&*+=\|?:<>/-]), Operator
109
113
  rule %r/[()\[\],.;]/, Punctuation
110
114
  rule %r/\bcase\b/, Keyword, :case
111
- rule %r/(?:true|false|NULL)\b/, Name::Builtin
115
+ rule %r/(?:true|false|NULL|nullptr)\b/, Name::Builtin
112
116
  rule id do |m|
113
117
  name = m[0]
114
118
 
@@ -75,7 +75,7 @@ module Rouge
75
75
 
76
76
  def end_chars
77
77
  @end_chars ||= if @prompt.any?
78
- @prompt.reject { |c| c.empty? }
78
+ @prompt.reject { |c| c.empty? }.uniq.first(20)
79
79
  elsif allow_comments?
80
80
  %w($ > ;)
81
81
  else
@@ -85,7 +85,9 @@ module Rouge
85
85
 
86
86
  def error_regex
87
87
  @error_regex ||= if @error.any?
88
- /^(?:#{@error.map(&Regexp.method(:escape)).join('|')})/
88
+ #rubocop:disable Rouge/NoBuildingAlternationPatternInRegexp
89
+ /^(?:#{@error.first(20).map { |e| Regexp.escape(e) }.join('|')})/
90
+ #rubocop:enable Rouge/NoBuildingAlternationPatternInRegexp
89
91
  end
90
92
  end
91
93
 
@@ -144,7 +146,7 @@ module Rouge
144
146
  yield Text::Whitespace, $& unless $&.empty?
145
147
 
146
148
  lang_lexer.continue_lex($', &output)
147
- elsif comment_regex =~ input[0].strip
149
+ elsif allow_comments? && comment_regex =~ input[0].strip
148
150
  puts "console: matched comment #{input[0].inspect}" if @debug
149
151
  output_lexer.reset!
150
152
  lang_lexer.reset!
@@ -173,13 +175,17 @@ module Rouge
173
175
  end
174
176
 
175
177
  def prompt_regex
178
+ # [jneen] these characters can come from user input. They are escaped here,
179
+ # and we limit the user to 20.
180
+ #rubocop:disable Rouge/NoBuildingAlternationPatternInRegexp
176
181
  @prompt_regex ||= begin
177
- /^#{prompt_prefix_regex}(?:#{end_chars.map(&Regexp.method(:escape)).join('|')})/
182
+ /^#{prompt_prefix_regex}(?:#{end_chars.map { |c| Regexp.escape(c) }.join('|')})/
178
183
  end
184
+ #rubocop:enable Rouge/NoBuildingAlternationPatternInRegexp
179
185
  end
180
186
 
181
187
  def stream_tokens(input, &output)
182
- input = StringScanner.new(input)
188
+ input = StringScanner.new(input, fixed_anchor: true)
183
189
  lang_lexer.reset!
184
190
  output_lexer.reset!
185
191
 
@@ -1,10 +1,10 @@
1
1
  # -*- coding: utf-8 -*- #
2
2
  # frozen_string_literal: true
3
3
 
4
+ require_relative 'c'
5
+
4
6
  module Rouge
5
7
  module Lexers
6
- load_lexer 'c.rb'
7
-
8
8
  class Cpp < C
9
9
  title "C++"
10
10
  desc "The C++ programming language"
@@ -22,21 +22,19 @@ module Rouge
22
22
 
23
23
  def self.keywords
24
24
  @keywords ||= super + Set.new(%w(
25
- asm auto catch char8_t concept
26
- consteval constexpr constinit const_cast co_await co_return co_yield
27
- delete dynamic_cast explicit export friend
28
- mutable namespace new operator private protected public
29
- reinterpret_cast requires restrict size_of static_cast this throw throws
30
- typeid typename using virtual final override import module
31
-
32
- alignas alignof decltype noexcept static_assert
33
- thread_local try
25
+ and and_eq asm bitand bitor catch compl concept consteval
26
+ constinit const_cast co_await co_return co_yield decltype
27
+ delete dynamic_cast explicit export final friend import
28
+ module mutable namespace new noexcept not not_eq operator or
29
+ or_eq override private protected public reinterpret_cast
30
+ requires size_of static_cast this throw throws try typeid
31
+ typename using virtual xor xor_eq
34
32
  ))
35
33
  end
36
34
 
37
35
  def self.keywords_type
38
36
  @keywords_type ||= super + Set.new(%w(
39
- bool
37
+ char8_t
40
38
  ))
41
39
  end
42
40
 
@@ -80,7 +80,7 @@ module Rouge
80
80
  rule %r/\b[\p{Ll}_]\p{Word}*?[?!]?:\s+/, Str::Symbol, :expr_start
81
81
  rule %r/"/, Str::Double, :simple_string
82
82
  rule %r/(?<!\.)`/, Str::Backtick, :simple_backtick
83
- rule %r/(')(\\u[a-fA-F0-9]{4}|\\u\{[a-fA-F0-9]{1,6}\}|\\[abefnrtv])?(\\\\|\\'|[^'])*(')/ do
83
+ rule %r/(')(\\u[a-fA-F0-9]{4}|\\u\{[a-fA-F0-9]{1,6}\}|\\[abefnrtv])?(\\\\|\\'|[^'\n])*(')/ do
84
84
  groups Str::Single, Str::Escape, Str::Single, Str::Single
85
85
  end
86
86
  end
@@ -13,7 +13,19 @@ module Rouge
13
13
 
14
14
  # Documentation: https://www.w3.org/TR/CSS21/syndata.html#characters
15
15
 
16
- identifier = /[\p{L}_-][\p{Word}\p{Cf}-]*/
16
+ # [jneen] workaround for:
17
+ # https://bugs.ruby-lang.org/issues/21870#change-116371
18
+ #
19
+ # As of ruby 4+, \p{Word} matches ZWJ and ZWNJ, so the additional
20
+ # \p{Cf} is not needed.
21
+ #
22
+ # That being said... this still warns, but at least it's only once?
23
+ identifier = if RUBY_VERSION < '4'
24
+ /[\p{L}_-][\p{Word}\p{Cf}-]*/
25
+ else
26
+ /[\p{L}_-][\p{Word}-]*/
27
+ end
28
+
17
29
  number = /-?(?:[0-9]+(\.[0-9]+)?|\.[0-9]+)/
18
30
 
19
31
  def self.properties
@@ -126,7 +138,7 @@ module Rouge
126
138
  above absolute accumulate add additive all alpha alphabetic
127
139
  alternate alternate-reverse always armenian aural auto auto-fill
128
140
  auto-fit avoid backwards balance baseline behind below bidi-override
129
- blink block bold bolder border-box both bottom bottom break-spaces
141
+ blink block bold bolder border-box both bottom break-spaces
130
142
  capitalize center center-left center-right circle cjk-ideographic
131
143
  close-quote closest-corner closest-side collapse
132
144
  color color-burn color-dodge column column-reverse
@@ -192,6 +204,7 @@ module Rouge
192
204
  seagreen seashell sienna silver skyblue slateblue slategray snow
193
205
  springgreen steelblue tan teal thistle tomato
194
206
  turquoise violet wheat white whitesmoke yellow yellowgreen
207
+ rebeccapurple
195
208
  )
196
209
  end
197
210
 
@@ -245,6 +258,10 @@ module Rouge
245
258
  rule %r/(true|false)/i, Name::Constant
246
259
  rule %r/\-\-#{identifier}/, Literal
247
260
  rule %r([*+/-]), Operator
261
+ rule %r/(url(?:-prefix)?)([(])(.*?)([)])/ do
262
+ groups Name::Function, Punctuation, Str::Other, Punctuation
263
+ end
264
+
248
265
  rule(identifier) do |m|
249
266
  if self.class.colors.include? m[0].downcase
250
267
  token Name::Other
@@ -304,6 +321,8 @@ module Rouge
304
321
 
305
322
  push :stanza_value
306
323
  end
324
+
325
+ mixin :root
307
326
  end
308
327
 
309
328
  state :stanza_value do
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*- #
2
2
 
3
+ require_relative 'cpp'
4
+
3
5
  module Rouge
4
6
  module Lexers
5
- load_lexer 'cpp.rb'
6
-
7
7
  class CUDA < Cpp
8
8
  title "CUDA"
9
9
  desc "Compute Unified Device Architecture, used for programming with NVIDIA GPU"
@@ -24,8 +24,8 @@ module Rouge
24
24
  short1 short2 short3 short4 ushort1 ushort2 ushort3 ushort4
25
25
  int1 int2 int3 int4 uint1 uint2 uint3 uint4
26
26
  long1 long2 long3 long4 ulong1 ulong2 ulong3 ulong4
27
- longlong1 longlong2 longlong3 longlong4
28
- ulonglong1 ulonglong2 ulonglong3 ulonglong4
27
+ longlong1 longlong2 longlong3 longlong4
28
+ ulonglong1 ulonglong2 ulonglong3 ulonglong4
29
29
  float1 float2 float3 float4 double1 double2 double3 double4
30
30
  dim3
31
31
  ))