rouge 3.16.0 → 3.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rougify +2 -2
  3. data/lib/rouge.rb +67 -53
  4. data/lib/rouge/demos/augeas +16 -0
  5. data/lib/rouge/demos/bibtex +12 -0
  6. data/lib/rouge/demos/brightscript +6 -0
  7. data/lib/rouge/demos/cypher +5 -0
  8. data/lib/rouge/demos/datastudio +21 -0
  9. data/lib/rouge/demos/ecl +18 -0
  10. data/lib/rouge/demos/ghc-cmm +23 -0
  11. data/lib/rouge/demos/hlsl +20 -0
  12. data/lib/rouge/demos/isbl +4 -0
  13. data/lib/rouge/demos/janet +3 -0
  14. data/lib/rouge/demos/livescript +15 -0
  15. data/lib/rouge/demos/rego +8 -0
  16. data/lib/rouge/demos/solidity +13 -0
  17. data/lib/rouge/demos/ssh +4 -0
  18. data/lib/rouge/demos/vcl +12 -0
  19. data/lib/rouge/demos/velocity +9 -0
  20. data/lib/rouge/demos/yang +17 -0
  21. data/lib/rouge/demos/zig +6 -0
  22. data/lib/rouge/lexer.rb +2 -1
  23. data/lib/rouge/lexers/apache.rb +22 -12
  24. data/lib/rouge/lexers/apache/keywords.rb +24 -0
  25. data/lib/rouge/lexers/augeas.rb +93 -0
  26. data/lib/rouge/lexers/batchfile.rb +1 -1
  27. data/lib/rouge/lexers/bibtex.rb +115 -0
  28. data/lib/rouge/lexers/brightscript.rb +147 -0
  29. data/lib/rouge/lexers/cmake.rb +1 -0
  30. data/lib/rouge/lexers/coffeescript.rb +47 -15
  31. data/lib/rouge/lexers/console.rb +53 -37
  32. data/lib/rouge/lexers/cpp.rb +21 -7
  33. data/lib/rouge/lexers/css.rb +3 -1
  34. data/lib/rouge/lexers/cypher.rb +108 -0
  35. data/lib/rouge/lexers/datastudio.rb +138 -0
  36. data/lib/rouge/lexers/diff.rb +1 -1
  37. data/lib/rouge/lexers/docker.rb +1 -1
  38. data/lib/rouge/lexers/ecl.rb +175 -0
  39. data/lib/rouge/lexers/fsharp.rb +1 -0
  40. data/lib/rouge/lexers/ghc_cmm.rb +340 -0
  41. data/lib/rouge/lexers/gherkin.rb +1 -1
  42. data/lib/rouge/lexers/gherkin/keywords.rb +9 -6
  43. data/lib/rouge/lexers/haskell.rb +27 -19
  44. data/lib/rouge/lexers/hlsl.rb +166 -0
  45. data/lib/rouge/lexers/html.rb +7 -7
  46. data/lib/rouge/lexers/isbl.rb +97 -0
  47. data/lib/rouge/lexers/isbl/builtins.rb +17 -0
  48. data/lib/rouge/lexers/janet.rb +217 -0
  49. data/lib/rouge/lexers/javascript.rb +4 -4
  50. data/lib/rouge/lexers/jinja.rb +22 -7
  51. data/lib/rouge/lexers/json.rb +3 -0
  52. data/lib/rouge/lexers/json_doc.rb +1 -0
  53. data/lib/rouge/lexers/jsx.rb +47 -59
  54. data/lib/rouge/lexers/julia.rb +4 -2
  55. data/lib/rouge/lexers/kotlin.rb +14 -2
  56. data/lib/rouge/lexers/lasso.rb +11 -12
  57. data/lib/rouge/lexers/lasso/keywords.rb +20 -0
  58. data/lib/rouge/lexers/livescript.rb +310 -0
  59. data/lib/rouge/lexers/llvm.rb +6 -33
  60. data/lib/rouge/lexers/llvm/keywords.rb +25 -0
  61. data/lib/rouge/lexers/lua.rb +2 -2
  62. data/lib/rouge/lexers/lua/keywords.rb +28 -0
  63. data/lib/rouge/lexers/markdown.rb +9 -5
  64. data/lib/rouge/lexers/mathematica.rb +2 -2
  65. data/lib/rouge/lexers/mathematica/keywords.rb +17 -0
  66. data/lib/rouge/lexers/matlab.rb +3 -4
  67. data/lib/rouge/lexers/matlab/builtins.rb +11 -0
  68. data/lib/rouge/lexers/matlab/keywords.rb +15 -0
  69. data/lib/rouge/lexers/nasm.rb +42 -168
  70. data/lib/rouge/lexers/opentype_feature_file.rb +27 -42
  71. data/lib/rouge/lexers/pascal.rb +1 -1
  72. data/lib/rouge/lexers/perl.rb +21 -3
  73. data/lib/rouge/lexers/php.rb +48 -33
  74. data/lib/rouge/lexers/php/keywords.rb +202 -0
  75. data/lib/rouge/lexers/powershell.rb +5 -3
  76. data/lib/rouge/lexers/python.rb +58 -57
  77. data/lib/rouge/lexers/racket.rb +24 -1
  78. data/lib/rouge/lexers/rego.rb +60 -0
  79. data/lib/rouge/lexers/ruby.rb +16 -3
  80. data/lib/rouge/lexers/sass/common.rb +1 -0
  81. data/lib/rouge/lexers/scala.rb +1 -1
  82. data/lib/rouge/lexers/solidity.rb +185 -0
  83. data/lib/rouge/lexers/sparql.rb +5 -4
  84. data/lib/rouge/lexers/sqf.rb +2 -2
  85. data/lib/rouge/lexers/sqf/keywords.rb +12 -0
  86. data/lib/rouge/lexers/ssh.rb +33 -0
  87. data/lib/rouge/lexers/terraform.rb +15 -0
  88. data/lib/rouge/lexers/tsx.rb +10 -3
  89. data/lib/rouge/lexers/turtle.rb +1 -1
  90. data/lib/rouge/lexers/twig.rb +4 -4
  91. data/lib/rouge/lexers/typescript.rb +1 -8
  92. data/lib/rouge/lexers/typescript/common.rb +18 -4
  93. data/lib/rouge/lexers/varnish.rb +53 -16
  94. data/lib/rouge/lexers/velocity.rb +71 -0
  95. data/lib/rouge/lexers/viml.rb +6 -38
  96. data/lib/rouge/lexers/viml/keywords.rb +11 -4
  97. data/lib/rouge/lexers/vue.rb +4 -1
  98. data/lib/rouge/lexers/xml.rb +5 -3
  99. data/lib/rouge/lexers/yaml.rb +5 -3
  100. data/lib/rouge/lexers/yang.rb +147 -0
  101. data/lib/rouge/lexers/zig.rb +139 -0
  102. data/lib/rouge/version.rb +1 -1
  103. metadata +47 -10
  104. data/lib/rouge/demos/varnish +0 -55
  105. data/lib/rouge/lexers/apache/keywords.yml +0 -764
  106. data/lib/rouge/lexers/lasso/keywords.yml +0 -446
  107. data/lib/rouge/lexers/lua/builtins.rb +0 -24
  108. data/lib/rouge/lexers/mathematica/builtins.rb +0 -13
  109. data/lib/rouge/lexers/matlab/builtins.yml +0 -3515
  110. data/lib/rouge/lexers/php/builtins.rb +0 -203
  111. data/lib/rouge/lexers/sqf/commands.rb +0 -15
@@ -0,0 +1,24 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ # DO NOT EDIT
5
+ # This file is automatically generated by `rake builtins:apache`.
6
+ # See tasks/builtins/apache.rake for more info.
7
+
8
+ module Rouge
9
+ module Lexers
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
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,93 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Lexers
6
+ class Augeas < RegexLexer
7
+ title "Augeas"
8
+ desc "The Augeas programming language (augeas.net)"
9
+
10
+ tag 'augeas'
11
+ aliases 'aug'
12
+ filenames '*.aug'
13
+ mimetypes 'text/x-augeas'
14
+
15
+ def self.reserved
16
+ @reserved ||= Set.new %w(
17
+ _ let del store value counter seq key label autoload incl excl
18
+ transform test get put in after set clear insa insb print_string
19
+ print_regexp print_endline print_tree lens_ctype lens_atype
20
+ lens_ktype lens_vtype lens_format_atype regexp_match
21
+ )
22
+ end
23
+
24
+ state :basic do
25
+ rule %r/\s+/m, Text
26
+ rule %r/\(\*/, Comment::Multiline, :comment
27
+ end
28
+
29
+ state :comment do
30
+ rule %r/\*\)/, Comment::Multiline, :pop!
31
+ rule %r/\(\*/, Comment::Multiline, :comment
32
+ rule %r/[^*)]+/, Comment::Multiline
33
+ rule %r/[*)]/, Comment::Multiline
34
+ end
35
+
36
+ state :root do
37
+ mixin :basic
38
+
39
+ rule %r/(:)(\w\w*)/ do
40
+ groups Punctuation, Keyword::Type
41
+ end
42
+
43
+ rule %r/\w[\w']*/ do |m|
44
+ name = m[0]
45
+ if name == "module"
46
+ token Keyword::Reserved
47
+ push :module
48
+ elsif self.class.reserved.include? name
49
+ token Keyword::Reserved
50
+ elsif name =~ /\A[A-Z]/
51
+ token Keyword::Namespace
52
+ else
53
+ token Name
54
+ end
55
+ end
56
+
57
+ rule %r/"/, Str, :string
58
+ rule %r/\//, Str, :regexp
59
+
60
+ rule %r([-*+.=?\|]+), Operator
61
+ rule %r/[\[\](){}:;]/, Punctuation
62
+ end
63
+
64
+ state :module do
65
+ rule %r/\s+/, Text
66
+ rule %r/[A-Z][a-zA-Z0-9_.]*/, Name::Namespace, :pop!
67
+ end
68
+
69
+ state :regexp do
70
+ rule %r/\//, Str::Regex, :pop!
71
+ rule %r/[^\\\/]+/, Str::Regex
72
+ rule %r/\\[\\\/]/, Str::Regex
73
+ rule %r/\\/, Str::Regex
74
+ end
75
+
76
+ state :string do
77
+ rule %r/"/, Str, :pop!
78
+ rule %r/\\/, Str::Escape, :escape
79
+ rule %r/[^\\"]+/, Str
80
+ end
81
+
82
+ state :escape do
83
+ rule %r/[abfnrtv"'&\\]/, Str::Escape, :pop!
84
+ rule %r/\^[\]\[A-Z@\^_]/, Str::Escape, :pop!
85
+ rule %r/o[0-7]+/i, Str::Escape, :pop!
86
+ rule %r/x[\da-f]+/i, Str::Escape, :pop!
87
+ rule %r/\d+/, Str::Escape, :pop!
88
+ rule %r/\s+/, Str::Escape, :pop!
89
+ rule %r/./, Str, :pop!
90
+ end
91
+ end
92
+ end
93
+ end
@@ -78,7 +78,7 @@ module Rouge
78
78
 
79
79
  state :basic do
80
80
  # Comments
81
- rule %r/\brem\b.*$/i, Comment
81
+ rule %r/@?\brem\b.*$/i, Comment
82
82
  # Empty Labels
83
83
  rule %r/^::.*$/, Comment
84
84
 
@@ -0,0 +1,115 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ # Regular expressions based on https://github.com/SaswatPadhi/prismjs-bibtex
5
+ # and https://github.com/alecthomas/chroma/blob/master/lexers/b/bibtex.go
6
+
7
+ module Rouge
8
+ module Lexers
9
+ class BibTeX < RegexLexer
10
+ title 'BibTeX'
11
+ desc "BibTeX"
12
+ tag 'bibtex'
13
+ aliases 'bib'
14
+ filenames '*.bib'
15
+
16
+ valid_punctuation = Regexp.quote("@!$&.\\:;<>?[]^`|~*/+-")
17
+ valid_name = /[a-z_#{valid_punctuation}][\w#{valid_punctuation}]*/io
18
+
19
+ state :root do
20
+ mixin :whitespace
21
+
22
+ rule %r/@(#{valid_name})/o do |m|
23
+ match = m[1].downcase
24
+
25
+ if match == "comment"
26
+ token Comment
27
+ elsif match == "preamble"
28
+ token Name::Class
29
+ push :closing_brace
30
+ push :value
31
+ push :opening_brace
32
+ elsif match == "string"
33
+ token Name::Class
34
+ push :closing_brace
35
+ push :field
36
+ push :opening_brace
37
+ else
38
+ token Name::Class
39
+ push :closing_brace
40
+ push :command_body
41
+ push :opening_brace
42
+ end
43
+ end
44
+
45
+ rule %r/.+/, Comment
46
+ end
47
+
48
+ state :opening_brace do
49
+ mixin :whitespace
50
+ rule %r/[{(]/, Punctuation, :pop!
51
+ end
52
+
53
+ state :closing_brace do
54
+ mixin :whitespace
55
+ rule %r/[})]/, Punctuation, :pop!
56
+ end
57
+
58
+ state :command_body do
59
+ mixin :whitespace
60
+ rule %r/[^\s\,\}]+/ do
61
+ token Name::Label
62
+ pop!
63
+ push :fields
64
+ end
65
+ end
66
+
67
+ state :fields do
68
+ mixin :whitespace
69
+ rule %r/,/, Punctuation, :field
70
+ rule(//) { pop! }
71
+ end
72
+
73
+ state :field do
74
+ mixin :whitespace
75
+ rule valid_name do
76
+ token Name::Attribute
77
+ push :value
78
+ push :equal_sign
79
+ end
80
+ rule(//) { pop! }
81
+ end
82
+
83
+ state :equal_sign do
84
+ mixin :whitespace
85
+ rule %r/=/, Punctuation, :pop!
86
+ end
87
+
88
+ state :value do
89
+ mixin :whitespace
90
+ rule valid_name, Name::Variable
91
+ rule %r/"/, Literal::String, :quoted_string
92
+ rule %r/\{/, Literal::String, :braced_string
93
+ rule %r/\d+/, Literal::Number
94
+ rule %r/#/, Punctuation
95
+ rule(//) { pop! }
96
+ end
97
+
98
+ state :quoted_string do
99
+ rule %r/\{/, Literal::String, :braced_string
100
+ rule %r/"/, Literal::String, :pop!
101
+ rule %r/[^\{\"]+/, Literal::String
102
+ end
103
+
104
+ state :braced_string do
105
+ rule %r/\{/, Literal::String, :braced_string
106
+ rule %r/\}/, Literal::String, :pop!
107
+ rule %r/[^\{\}]+/, Literal::String
108
+ end
109
+
110
+ state :whitespace do
111
+ rule %r/\s+/, Text
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,147 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Lexers
6
+ class Brightscript < RegexLexer
7
+ title "BrightScript"
8
+ desc "BrightScript Programming Language (https://developer.roku.com/en-ca/docs/references/brightscript/language/brightscript-language-reference.md)"
9
+ tag 'brightscript'
10
+ aliases 'bs', 'brs'
11
+ filenames '*.brs'
12
+
13
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/global-utility-functions.md
14
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/global-string-functions.md
15
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/global-math-functions.md
16
+ def self.name_builtin
17
+ @name_builtin ||= Set.new %w(
18
+ ABS ASC ATN CDBL CHR CINT CONTROL COPYFILE COS CREATEDIRECTORY CSNG
19
+ DELETEDIRECTORY DELETEFILE EXP FINDMEMBERFUNCTION FINDNODE FIX
20
+ FORMATDRIVEFORMATJSON GETINTERFACE INSTR INT LCASE LEFT LEN LISTDIR
21
+ LOG MATCHFILES MID MOVEFILE OBSERVEFIELD PARSEJSON PARSEXML
22
+ READASCIIFILE REBOOTSYSTEM RIGHT RND RUNGARBAGECOLLECTOR SGN SIN
23
+ SLEEP SQR STR STRI STRING STRINGI STRTOI SUBSTITUTE TANTEXTTOP TEXT
24
+ TRUCASE UPTIME VALVISIBLE VISIBLE WAIT
25
+ )
26
+ end
27
+
28
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/reserved-words.md
29
+ def self.keyword_reserved
30
+ @keyword_reserved ||= Set.new %w(
31
+ BOX CREATEOBJECT DIM EACH ELSE ELSEIF END ENDFUNCTION ENDIF ENDSUB
32
+ ENDWHILE EVAL EXIT EXITWHILE FALSE FOR FUNCTION GETGLOBALAA
33
+ GETLASTRUNCOMPILEERROR GETLASTRUNRUNTIMEERROR GOTO IF IN INVALID LET
34
+ LINE_NUM M NEXT OBJFUN POS PRINT REM RETURN RUN STEP STOP SUB TAB TO
35
+ TRUE TYPE WHILE
36
+ )
37
+ end
38
+
39
+ # These keywords are present in BrightScript, but not supported in standard .brs files
40
+ def self.keyword_reserved_unsupported
41
+ @keyword_reserved_unsupported ||= Set.new %w(
42
+ CLASS CONST IMPORT LIBRARY NAMESPACE PRIVATE PROTECTED PUBLIC
43
+ )
44
+ end
45
+
46
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md
47
+ def self.keyword_type
48
+ @keyword_type ||= Set.new %w(
49
+ BOOLEAN DIM DOUBLE DYNAMIC FLOAT FUNCTION INTEGER INTERFACE INVALID
50
+ LONGINTEGER OBJECT STRING VOID
51
+ )
52
+ end
53
+
54
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md#operators
55
+ def self.operator_word
56
+ @operator_word ||= Set.new %w(
57
+ AND AS MOD NOT OR THEN
58
+ )
59
+ end
60
+
61
+ # Scene graph components configured as builtins. See BrightScript component documentation e.g.
62
+ # https://developer.roku.com/en-ca/docs/references/brightscript/components/roappinfo.md
63
+ def self.builtins
64
+ @builtins ||= Set.new %w(
65
+ roAppendFile roAppInfo roAppManager roArray roAssociativeArray
66
+ roAudioGuide roAudioMetadata roAudioPlayer roAudioPlayerEvent
67
+ roAudioResourceroBitmap roBoolean roBoolean roBrightPackage roBrSub
68
+ roButton roByteArray roCaptionRenderer roCaptionRendererEvent
69
+ roCecInterface roCECStatusEvent roChannelStore roChannelStoreEvent
70
+ roClockWidget roCodeRegistrationScreen
71
+ roCodeRegistrationScreenEventroCompositor roControlDown roControlPort
72
+ roControlPort roControlUp roCreateFile roDatagramReceiver
73
+ roDatagramSender roDataGramSocket roDateTime roDeviceInfo
74
+ roDeviceInfoEvent roDoubleroEVPCipher roEVPDigest roFileSystem
75
+ roFileSystemEvent roFloat roFont roFontMetrics roFontRegistry
76
+ roFunction roGlobal roGpio roGridScreen roGridScreenEvent
77
+ roHdmiHotPlugEventroHdmiStatus roHdmiStatusEvent roHMAC roHttpAgent
78
+ roImageCanvas roImageCanvasEvent roImageMetadata roImagePlayer
79
+ roImageWidgetroInput roInputEvent roInt roInt roInvalid roInvalid
80
+ roIRRemote roKeyboard roKeyboardPress roKeyboardScreen
81
+ roKeyboardScreenEventroList roListScreen roListScreenEvent
82
+ roLocalization roLongInteger roMessageDialog roMessageDialogEvent
83
+ roMessagePort roMicrophone roMicrophoneEvent roNetworkConfiguration
84
+ roOneLineDialog roOneLineDialogEventroParagraphScreen
85
+ roParagraphScreenEvent roPath roPinEntryDialog roPinEntryDialogEvent
86
+ roPinentryScreen roPosterScreen roPosterScreenEventroProgramGuide
87
+ roQuadravoxButton roReadFile roRectangleroRegexroRegion roRegistry
88
+ roRegistrySection roResourceManager roRSA roRssArticle roRssParser
89
+ roScreen roSearchHistory roSearchScreen roSearchScreenEvent
90
+ roSerialPort roSGNode roSGNodeEvent roSGScreenroSGScreenEvent
91
+ roSlideShowroSlideShowEvent roSNS5 roSocketAddress roSocketEvent
92
+ roSpringboardScreen roSpringboardScreenEventroSprite roStorageInfo
93
+ roStreamSocket roStringroSystemLogroSystemLogEvent roSystemTime
94
+ roTextFieldroTextScreen roTextScreenEvent roTextToSpeech
95
+ roTextToSpeechEvent roTextureManager roTextureRequest
96
+ roTextureRequestEventroTextWidget roTimer roTimespan roTouchScreen
97
+ roTunerroTunerEvent roUniversalControlEvent roUrlEvent roUrlTransfer
98
+ roVideoEvent roVideoInput roVideoMode roVideoPlayer roVideoPlayerEvent
99
+ roVideoScreen roVideoScreenEventroWriteFile roXMLElement roXMLList
100
+ )
101
+ end
102
+
103
+ id = /[$a-z_][a-z0-9_]*/io
104
+
105
+ state :root do
106
+ rule %r/\s+/m, Text::Whitespace
107
+
108
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md#comments
109
+ rule %r/\'.*/, Comment::Single
110
+ rule %r/REM.*/i, Comment::Single
111
+
112
+ # https://developer.roku.com/en-ca/docs/references/brightscript/language/expressions-variables-types.md#operators
113
+ rule %r([~!%^&*+=\|?:<>/-]), Operator
114
+
115
+ rule %r/\d*\.\d+(e-?\d+)?/i, Num::Float
116
+ rule %r/\d+[lu]*/i, Num::Integer
117
+
118
+ rule %r/".*?"/, Str::Double
119
+
120
+ rule %r/#{id}(?=\s*[(])/, Name::Function
121
+
122
+ rule %r/[()\[\],.;{}]/, Punctuation
123
+
124
+ rule id do |m|
125
+ caseSensitiveChunk = m[0]
126
+ caseInsensitiveChunk = m[0].upcase
127
+
128
+ if self.class.builtins.include?(caseSensitiveChunk)
129
+ token Keyword::Reserved
130
+ elsif self.class.keyword_reserved.include?(caseInsensitiveChunk)
131
+ token Keyword::Reserved
132
+ elsif self.class.keyword_reserved_unsupported.include?(caseInsensitiveChunk)
133
+ token Keyword::Reserved
134
+ elsif self.class.keyword_type.include?(caseInsensitiveChunk)
135
+ token Keyword::Type
136
+ elsif self.class.name_builtin.include?(caseInsensitiveChunk)
137
+ token Name::Builtin
138
+ elsif self.class.operator_word.include?(caseInsensitiveChunk)
139
+ token Operator::Word
140
+ else
141
+ token Name
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -164,6 +164,7 @@ module Rouge
164
164
  goto :bracket_string
165
165
  end
166
166
 
167
+ rule %r/\\"/, Text
167
168
  rule %r/"/, Str::Double, :quoted_argument
168
169
 
169
170
  rule %r/([A-Za-z_][A-Za-z0-9_]*)(#{SPACE}*)(\()/ do |m|
@@ -49,33 +49,54 @@ module Rouge
49
49
 
50
50
  id = /[$a-zA-Z_][a-zA-Z0-9_]*/
51
51
 
52
- state :comments_and_whitespace do
53
- rule %r/\s+/m, Text
52
+ state :comments do
54
53
  rule %r/###[^#].*?###/m, Comment::Multiline
55
54
  rule %r/#.*$/, Comment::Single
56
55
  end
57
56
 
58
- state :multiline_regex do
59
- # this order is important, so that #{ isn't interpreted
60
- # as a comment
61
- mixin :has_interpolation
62
- mixin :comments_and_whitespace
57
+ state :whitespace do
58
+ rule %r/\s+/m, Text
59
+ end
63
60
 
64
- rule %r(///([gim]+\b|\B)), Str::Regex, :pop!
65
- rule %r(/), Str::Regex
66
- rule %r([^/#]+), Str::Regex
61
+ state :regex_comment do
62
+ rule %r/^#(?!\{).*$/, Comment::Single
63
+ rule %r/(\s+)(#(?!\{).*)$/ do
64
+ groups Text, Comment::Single
65
+ end
67
66
  end
68
67
 
69
- state :slash_starts_regex do
70
- mixin :comments_and_whitespace
68
+ state :multiline_regex_begin do
71
69
  rule %r(///) do
72
70
  token Str::Regex
73
71
  goto :multiline_regex
74
72
  end
73
+ end
74
+
75
+ state :multiline_regex_end do
76
+ rule %r(///([gimy]+\b|\B)), Str::Regex, :pop!
77
+ end
78
+
79
+ state :multiline_regex do
80
+ mixin :multiline_regex_end
81
+ mixin :regex_comment
82
+ mixin :has_interpolation
83
+ mixin :comments
84
+ mixin :whitespace
85
+ mixin :code_escape
86
+
87
+ rule %r/\\\D/, Str::Escape
88
+ rule %r/\\\d+/, Name::Variable
89
+ rule %r/./m, Str::Regex
90
+ end
91
+
92
+ state :slash_starts_regex do
93
+ mixin :comments
94
+ mixin :whitespace
95
+ mixin :multiline_regex_begin
75
96
 
76
97
  rule %r(
77
98
  /(\\.|[^\[/\\\n]|\[(\\.|[^\]\\\n])*\])+/ # a regex
78
- ([gim]+\b|\B)
99
+ ([gimy]+\b|\B)
79
100
  )x, Str::Regex, :pop!
80
101
 
81
102
  rule(//) { pop! }
@@ -83,7 +104,9 @@ module Rouge
83
104
 
84
105
  state :root do
85
106
  rule(%r(^(?=\s|/|<!--))) { push :slash_starts_regex }
86
- mixin :comments_and_whitespace
107
+ mixin :comments
108
+ mixin :whitespace
109
+
87
110
  rule %r(
88
111
  [+][+]|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\bin\b|\bof\b|
89
112
  [?]|:|=|[|][|]|\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*`%&|^/])=?
@@ -129,10 +152,19 @@ module Rouge
129
152
  rule %r/'/, Str, :sqs
130
153
  end
131
154
 
155
+ state :code_escape do
156
+ rule %r(\\(
157
+ c[A-Z]|
158
+ x[0-9a-fA-F]{2}|
159
+ u[0-9a-fA-F]{4}|
160
+ u\{[0-9a-fA-F]{4}\}
161
+ ))x, Str::Escape
162
+ end
163
+
132
164
  state :strings do
133
165
  # all coffeescript strings are multi-line
134
166
  rule %r/[^#\\'"]+/m, Str
135
-
167
+ mixin :code_escape
136
168
  rule %r/\\./, Str::Escape
137
169
  rule %r/#/, Str
138
170
  end