rouge 3.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +40 -0
- data/LICENSE +186 -0
- data/bin/rougify +18 -0
- data/lib/rouge.rb +93 -0
- data/lib/rouge/cli.rb +498 -0
- data/lib/rouge/demos/abap +6 -0
- data/lib/rouge/demos/actionscript +4 -0
- data/lib/rouge/demos/ada +26 -0
- data/lib/rouge/demos/apache +21 -0
- data/lib/rouge/demos/apex +9 -0
- data/lib/rouge/demos/apiblueprint +33 -0
- data/lib/rouge/demos/applescript +2 -0
- data/lib/rouge/demos/armasm +12 -0
- data/lib/rouge/demos/awk +4 -0
- data/lib/rouge/demos/batchfile +3 -0
- data/lib/rouge/demos/bbcbasic +6 -0
- data/lib/rouge/demos/biml +38 -0
- data/lib/rouge/demos/bpf +7 -0
- data/lib/rouge/demos/brainfuck +5 -0
- data/lib/rouge/demos/bsl +7 -0
- data/lib/rouge/demos/c +8 -0
- data/lib/rouge/demos/ceylon +7 -0
- data/lib/rouge/demos/cfscript +18 -0
- data/lib/rouge/demos/clean +6 -0
- data/lib/rouge/demos/clojure +5 -0
- data/lib/rouge/demos/cmake +7 -0
- data/lib/rouge/demos/cmhg +8 -0
- data/lib/rouge/demos/coffeescript +5 -0
- data/lib/rouge/demos/common_lisp +1 -0
- data/lib/rouge/demos/conf +4 -0
- data/lib/rouge/demos/console +6 -0
- data/lib/rouge/demos/coq +13 -0
- data/lib/rouge/demos/cpp +8 -0
- data/lib/rouge/demos/crystal +45 -0
- data/lib/rouge/demos/csharp +5 -0
- data/lib/rouge/demos/css +4 -0
- data/lib/rouge/demos/csvs +8 -0
- data/lib/rouge/demos/cuda +11 -0
- data/lib/rouge/demos/cython +6 -0
- data/lib/rouge/demos/d +16 -0
- data/lib/rouge/demos/dart +6 -0
- data/lib/rouge/demos/diff +7 -0
- data/lib/rouge/demos/digdag +19 -0
- data/lib/rouge/demos/docker +9 -0
- data/lib/rouge/demos/dot +5 -0
- data/lib/rouge/demos/ecl +18 -0
- data/lib/rouge/demos/eex +1 -0
- data/lib/rouge/demos/eiffel +30 -0
- data/lib/rouge/demos/elixir +1 -0
- data/lib/rouge/demos/elm +4 -0
- data/lib/rouge/demos/epp +4 -0
- data/lib/rouge/demos/erb +1 -0
- data/lib/rouge/demos/erlang +7 -0
- data/lib/rouge/demos/escape +3 -0
- data/lib/rouge/demos/factor +5 -0
- data/lib/rouge/demos/fortran +22 -0
- data/lib/rouge/demos/freefem +16 -0
- data/lib/rouge/demos/fsharp +12 -0
- data/lib/rouge/demos/gdscript +18 -0
- data/lib/rouge/demos/ghc-core +26 -0
- data/lib/rouge/demos/gherkin +17 -0
- data/lib/rouge/demos/glsl +14 -0
- data/lib/rouge/demos/go +7 -0
- data/lib/rouge/demos/gradle +10 -0
- data/lib/rouge/demos/graphql +17 -0
- data/lib/rouge/demos/groovy +9 -0
- data/lib/rouge/demos/hack +5 -0
- data/lib/rouge/demos/haml +5 -0
- data/lib/rouge/demos/handlebars +7 -0
- data/lib/rouge/demos/haskell +6 -0
- data/lib/rouge/demos/haxe +5 -0
- data/lib/rouge/demos/hcl +7 -0
- data/lib/rouge/demos/hocon +8 -0
- data/lib/rouge/demos/hql +5 -0
- data/lib/rouge/demos/html +8 -0
- data/lib/rouge/demos/http +14 -0
- data/lib/rouge/demos/hylang +10 -0
- data/lib/rouge/demos/idlang +8 -0
- data/lib/rouge/demos/igorpro +9 -0
- data/lib/rouge/demos/ini +4 -0
- data/lib/rouge/demos/io +11 -0
- data/lib/rouge/demos/irb +4 -0
- data/lib/rouge/demos/irb_output +2 -0
- data/lib/rouge/demos/java +5 -0
- data/lib/rouge/demos/javascript +1 -0
- data/lib/rouge/demos/jinja +9 -0
- data/lib/rouge/demos/jsl +3 -0
- data/lib/rouge/demos/json +1 -0
- data/lib/rouge/demos/json-doc +1 -0
- data/lib/rouge/demos/jsonnet +28 -0
- data/lib/rouge/demos/jsp +29 -0
- data/lib/rouge/demos/jsx +17 -0
- data/lib/rouge/demos/julia +11 -0
- data/lib/rouge/demos/kotlin +3 -0
- data/lib/rouge/demos/lasso +12 -0
- data/lib/rouge/demos/liquid +10 -0
- data/lib/rouge/demos/literate_coffeescript +3 -0
- data/lib/rouge/demos/literate_haskell +7 -0
- data/lib/rouge/demos/llvm +20 -0
- data/lib/rouge/demos/lua +12 -0
- data/lib/rouge/demos/lustre +6 -0
- data/lib/rouge/demos/lutin +18 -0
- data/lib/rouge/demos/m68k +16 -0
- data/lib/rouge/demos/magik +6 -0
- data/lib/rouge/demos/make +6 -0
- data/lib/rouge/demos/markdown +4 -0
- data/lib/rouge/demos/mason +22 -0
- data/lib/rouge/demos/mathematica +8 -0
- data/lib/rouge/demos/matlab +6 -0
- data/lib/rouge/demos/minizinc +23 -0
- data/lib/rouge/demos/moonscript +16 -0
- data/lib/rouge/demos/mosel +10 -0
- data/lib/rouge/demos/msgtrans +4 -0
- data/lib/rouge/demos/mxml +22 -0
- data/lib/rouge/demos/nasm +26 -0
- data/lib/rouge/demos/nesasm +11 -0
- data/lib/rouge/demos/nginx +5 -0
- data/lib/rouge/demos/nim +27 -0
- data/lib/rouge/demos/nix +19 -0
- data/lib/rouge/demos/objective_c +18 -0
- data/lib/rouge/demos/objective_cpp +17 -0
- data/lib/rouge/demos/ocaml +12 -0
- data/lib/rouge/demos/openedge +4 -0
- data/lib/rouge/demos/opentype_feature_file +6 -0
- data/lib/rouge/demos/pascal +14 -0
- data/lib/rouge/demos/perl +5 -0
- data/lib/rouge/demos/php +3 -0
- data/lib/rouge/demos/plaintext +1 -0
- data/lib/rouge/demos/plist +11 -0
- data/lib/rouge/demos/pony +17 -0
- data/lib/rouge/demos/powershell +13 -0
- data/lib/rouge/demos/praat +26 -0
- data/lib/rouge/demos/prolog +9 -0
- data/lib/rouge/demos/prometheus +9 -0
- data/lib/rouge/demos/properties +7 -0
- data/lib/rouge/demos/protobuf +5 -0
- data/lib/rouge/demos/puppet +6 -0
- data/lib/rouge/demos/python +6 -0
- data/lib/rouge/demos/q +8 -0
- data/lib/rouge/demos/qml +9 -0
- data/lib/rouge/demos/r +8 -0
- data/lib/rouge/demos/racket +24 -0
- data/lib/rouge/demos/reasonml +12 -0
- data/lib/rouge/demos/robot_framework +27 -0
- data/lib/rouge/demos/ruby +9 -0
- data/lib/rouge/demos/rust +12 -0
- data/lib/rouge/demos/sas +13 -0
- data/lib/rouge/demos/sass +3 -0
- data/lib/rouge/demos/scala +3 -0
- data/lib/rouge/demos/scheme +4 -0
- data/lib/rouge/demos/scss +5 -0
- data/lib/rouge/demos/sed +4 -0
- data/lib/rouge/demos/shell +2 -0
- data/lib/rouge/demos/sieve +10 -0
- data/lib/rouge/demos/slice +10 -0
- data/lib/rouge/demos/slim +17 -0
- data/lib/rouge/demos/smalltalk +6 -0
- data/lib/rouge/demos/smarty +12 -0
- data/lib/rouge/demos/sml +4 -0
- data/lib/rouge/demos/sparql +6 -0
- data/lib/rouge/demos/sqf +14 -0
- data/lib/rouge/demos/sql +1 -0
- data/lib/rouge/demos/supercollider +11 -0
- data/lib/rouge/demos/swift +5 -0
- data/lib/rouge/demos/tap +5 -0
- data/lib/rouge/demos/tcl +1 -0
- data/lib/rouge/demos/terraform +16 -0
- data/lib/rouge/demos/tex +1 -0
- data/lib/rouge/demos/toml +9 -0
- data/lib/rouge/demos/tsx +17 -0
- data/lib/rouge/demos/ttcn3 +6 -0
- data/lib/rouge/demos/tulip +13 -0
- data/lib/rouge/demos/turtle +26 -0
- data/lib/rouge/demos/twig +9 -0
- data/lib/rouge/demos/typescript +1 -0
- data/lib/rouge/demos/vala +8 -0
- data/lib/rouge/demos/vb +4 -0
- data/lib/rouge/demos/vcl +12 -0
- data/lib/rouge/demos/verilog +27 -0
- data/lib/rouge/demos/vhdl +23 -0
- data/lib/rouge/demos/viml +14 -0
- data/lib/rouge/demos/vue +11 -0
- data/lib/rouge/demos/wollok +11 -0
- data/lib/rouge/demos/xml +2 -0
- data/lib/rouge/demos/xojo +14 -0
- data/lib/rouge/demos/xpath +2 -0
- data/lib/rouge/demos/xquery +22 -0
- data/lib/rouge/demos/yaml +4 -0
- data/lib/rouge/formatter.rb +112 -0
- data/lib/rouge/formatters/html.rb +56 -0
- data/lib/rouge/formatters/html_inline.rb +31 -0
- data/lib/rouge/formatters/html_legacy.rb +45 -0
- data/lib/rouge/formatters/html_line_table.rb +53 -0
- data/lib/rouge/formatters/html_linewise.rb +23 -0
- data/lib/rouge/formatters/html_pygments.rb +18 -0
- data/lib/rouge/formatters/html_table.rb +51 -0
- data/lib/rouge/formatters/null.rb +20 -0
- data/lib/rouge/formatters/terminal256.rb +198 -0
- data/lib/rouge/formatters/terminal_truecolor.rb +37 -0
- data/lib/rouge/formatters/tex.rb +92 -0
- data/lib/rouge/guesser.rb +57 -0
- data/lib/rouge/guessers/disambiguation.rb +136 -0
- data/lib/rouge/guessers/filename.rb +27 -0
- data/lib/rouge/guessers/glob_mapping.rb +45 -0
- data/lib/rouge/guessers/mimetype.rb +16 -0
- data/lib/rouge/guessers/modeline.rb +46 -0
- data/lib/rouge/guessers/source.rb +31 -0
- data/lib/rouge/guessers/util.rb +34 -0
- data/lib/rouge/lexer.rb +516 -0
- data/lib/rouge/lexers/abap.rb +240 -0
- data/lib/rouge/lexers/actionscript.rb +196 -0
- data/lib/rouge/lexers/ada.rb +162 -0
- data/lib/rouge/lexers/apache.rb +73 -0
- data/lib/rouge/lexers/apache/keywords.yml +764 -0
- data/lib/rouge/lexers/apex.rb +126 -0
- data/lib/rouge/lexers/apiblueprint.rb +49 -0
- data/lib/rouge/lexers/apple_script.rb +370 -0
- data/lib/rouge/lexers/armasm.rb +145 -0
- data/lib/rouge/lexers/awk.rb +162 -0
- data/lib/rouge/lexers/batchfile.rb +164 -0
- data/lib/rouge/lexers/bbcbasic.rb +112 -0
- data/lib/rouge/lexers/biml.rb +43 -0
- data/lib/rouge/lexers/bpf.rb +118 -0
- data/lib/rouge/lexers/brainfuck.rb +53 -0
- data/lib/rouge/lexers/bsl.rb +82 -0
- data/lib/rouge/lexers/c.rb +190 -0
- data/lib/rouge/lexers/ceylon.rb +96 -0
- data/lib/rouge/lexers/cfscript.rb +154 -0
- data/lib/rouge/lexers/clean.rb +156 -0
- data/lib/rouge/lexers/clojure.rb +113 -0
- data/lib/rouge/lexers/cmake.rb +207 -0
- data/lib/rouge/lexers/cmhg.rb +34 -0
- data/lib/rouge/lexers/coffeescript.rb +215 -0
- data/lib/rouge/lexers/common_lisp.rb +346 -0
- data/lib/rouge/lexers/conf.rb +25 -0
- data/lib/rouge/lexers/console.rb +174 -0
- data/lib/rouge/lexers/coq.rb +191 -0
- data/lib/rouge/lexers/cpp.rb +82 -0
- data/lib/rouge/lexers/crystal.rb +430 -0
- data/lib/rouge/lexers/csharp.rb +114 -0
- data/lib/rouge/lexers/css.rb +274 -0
- data/lib/rouge/lexers/csvs.rb +44 -0
- data/lib/rouge/lexers/cuda.rb +35 -0
- data/lib/rouge/lexers/cython.rb +151 -0
- data/lib/rouge/lexers/d.rb +177 -0
- data/lib/rouge/lexers/dart.rb +105 -0
- data/lib/rouge/lexers/diff.rb +37 -0
- data/lib/rouge/lexers/digdag.rb +70 -0
- data/lib/rouge/lexers/docker.rb +51 -0
- data/lib/rouge/lexers/dot.rb +69 -0
- data/lib/rouge/lexers/ecl.rb +175 -0
- data/lib/rouge/lexers/eex.rb +52 -0
- data/lib/rouge/lexers/eiffel.rb +66 -0
- data/lib/rouge/lexers/elixir.rb +149 -0
- data/lib/rouge/lexers/elm.rb +90 -0
- data/lib/rouge/lexers/epp.rb +51 -0
- data/lib/rouge/lexers/erb.rb +53 -0
- data/lib/rouge/lexers/erlang.rb +115 -0
- data/lib/rouge/lexers/escape.rb +58 -0
- data/lib/rouge/lexers/factor.rb +303 -0
- data/lib/rouge/lexers/fortran.rb +178 -0
- data/lib/rouge/lexers/freefem.rb +240 -0
- data/lib/rouge/lexers/fsharp.rb +119 -0
- data/lib/rouge/lexers/gdscript.rb +171 -0
- data/lib/rouge/lexers/ghc_core.rb +151 -0
- data/lib/rouge/lexers/gherkin.rb +140 -0
- data/lib/rouge/lexers/gherkin/keywords.rb +16 -0
- data/lib/rouge/lexers/glsl.rb +132 -0
- data/lib/rouge/lexers/go.rb +175 -0
- data/lib/rouge/lexers/gradle.rb +38 -0
- data/lib/rouge/lexers/graphql.rb +261 -0
- data/lib/rouge/lexers/groovy.rb +111 -0
- data/lib/rouge/lexers/hack.rb +49 -0
- data/lib/rouge/lexers/haml.rb +226 -0
- data/lib/rouge/lexers/handlebars.rb +91 -0
- data/lib/rouge/lexers/haskell.rb +199 -0
- data/lib/rouge/lexers/haxe.rb +246 -0
- data/lib/rouge/lexers/hcl.rb +163 -0
- data/lib/rouge/lexers/hocon.rb +86 -0
- data/lib/rouge/lexers/hql.rb +139 -0
- data/lib/rouge/lexers/html.rb +141 -0
- data/lib/rouge/lexers/http.rb +81 -0
- data/lib/rouge/lexers/hylang.rb +94 -0
- data/lib/rouge/lexers/idlang.rb +312 -0
- data/lib/rouge/lexers/igorpro.rb +664 -0
- data/lib/rouge/lexers/ini.rb +54 -0
- data/lib/rouge/lexers/io.rb +69 -0
- data/lib/rouge/lexers/irb.rb +67 -0
- data/lib/rouge/lexers/java.rb +91 -0
- data/lib/rouge/lexers/javascript.rb +279 -0
- data/lib/rouge/lexers/jinja.rb +154 -0
- data/lib/rouge/lexers/jsl.rb +55 -0
- data/lib/rouge/lexers/json.rb +69 -0
- data/lib/rouge/lexers/json_doc.rb +25 -0
- data/lib/rouge/lexers/jsonnet.rb +152 -0
- data/lib/rouge/lexers/jsp.rb +120 -0
- data/lib/rouge/lexers/jsx.rb +104 -0
- data/lib/rouge/lexers/julia.rb +290 -0
- data/lib/rouge/lexers/kotlin.rb +127 -0
- data/lib/rouge/lexers/lasso.rb +215 -0
- data/lib/rouge/lexers/lasso/keywords.yml +446 -0
- data/lib/rouge/lexers/liquid.rb +285 -0
- data/lib/rouge/lexers/literate_coffeescript.rb +34 -0
- data/lib/rouge/lexers/literate_haskell.rb +37 -0
- data/lib/rouge/lexers/llvm.rb +97 -0
- data/lib/rouge/lexers/lua.rb +164 -0
- data/lib/rouge/lexers/lua/builtins.rb +24 -0
- data/lib/rouge/lexers/lustre.rb +79 -0
- data/lib/rouge/lexers/lutin.rb +33 -0
- data/lib/rouge/lexers/m68k.rb +143 -0
- data/lib/rouge/lexers/magik.rb +127 -0
- data/lib/rouge/lexers/make.rb +135 -0
- data/lib/rouge/lexers/markdown.rb +182 -0
- data/lib/rouge/lexers/mason.rb +110 -0
- data/lib/rouge/lexers/mathematica.rb +96 -0
- data/lib/rouge/lexers/mathematica/builtins.rb +13 -0
- data/lib/rouge/lexers/matlab.rb +81 -0
- data/lib/rouge/lexers/matlab/builtins.yml +3515 -0
- data/lib/rouge/lexers/minizinc.rb +87 -0
- data/lib/rouge/lexers/moonscript.rb +115 -0
- data/lib/rouge/lexers/mosel.rb +232 -0
- data/lib/rouge/lexers/msgtrans.rb +26 -0
- data/lib/rouge/lexers/mxml.rb +69 -0
- data/lib/rouge/lexers/nasm.rb +72 -0
- data/lib/rouge/lexers/nesasm.rb +78 -0
- data/lib/rouge/lexers/nginx.rb +72 -0
- data/lib/rouge/lexers/nim.rb +154 -0
- data/lib/rouge/lexers/nix.rb +211 -0
- data/lib/rouge/lexers/objective_c.rb +21 -0
- data/lib/rouge/lexers/objective_c/common.rb +184 -0
- data/lib/rouge/lexers/objective_cpp.rb +31 -0
- data/lib/rouge/lexers/ocaml.rb +65 -0
- data/lib/rouge/lexers/ocaml/common.rb +53 -0
- data/lib/rouge/lexers/openedge.rb +429 -0
- data/lib/rouge/lexers/opentype_feature_file.rb +113 -0
- data/lib/rouge/lexers/pascal.rb +67 -0
- data/lib/rouge/lexers/perl.rb +231 -0
- data/lib/rouge/lexers/php.rb +216 -0
- data/lib/rouge/lexers/php/builtins.rb +203 -0
- data/lib/rouge/lexers/plain_text.rb +27 -0
- data/lib/rouge/lexers/plist.rb +47 -0
- data/lib/rouge/lexers/pony.rb +94 -0
- data/lib/rouge/lexers/powershell.rb +230 -0
- data/lib/rouge/lexers/praat.rb +351 -0
- data/lib/rouge/lexers/prolog.rb +67 -0
- data/lib/rouge/lexers/prometheus.rb +123 -0
- data/lib/rouge/lexers/properties.rb +52 -0
- data/lib/rouge/lexers/protobuf.rb +71 -0
- data/lib/rouge/lexers/puppet.rb +129 -0
- data/lib/rouge/lexers/python.rb +248 -0
- data/lib/rouge/lexers/q.rb +126 -0
- data/lib/rouge/lexers/qml.rb +74 -0
- data/lib/rouge/lexers/r.rb +89 -0
- data/lib/rouge/lexers/racket.rb +545 -0
- data/lib/rouge/lexers/reasonml.rb +65 -0
- data/lib/rouge/lexers/robot_framework.rb +249 -0
- data/lib/rouge/lexers/ruby.rb +444 -0
- data/lib/rouge/lexers/rust.rb +193 -0
- data/lib/rouge/lexers/sas.rb +563 -0
- data/lib/rouge/lexers/sass.rb +75 -0
- data/lib/rouge/lexers/sass/common.rb +181 -0
- data/lib/rouge/lexers/scala.rb +169 -0
- data/lib/rouge/lexers/scheme.rb +113 -0
- data/lib/rouge/lexers/scss.rb +35 -0
- data/lib/rouge/lexers/sed.rb +173 -0
- data/lib/rouge/lexers/shell.rb +201 -0
- data/lib/rouge/lexers/sieve.rb +97 -0
- data/lib/rouge/lexers/slice.rb +32 -0
- data/lib/rouge/lexers/slim.rb +229 -0
- data/lib/rouge/lexers/smalltalk.rb +117 -0
- data/lib/rouge/lexers/smarty.rb +81 -0
- data/lib/rouge/lexers/sml.rb +345 -0
- data/lib/rouge/lexers/sparql.rb +129 -0
- data/lib/rouge/lexers/sqf.rb +109 -0
- data/lib/rouge/lexers/sqf/commands.rb +15 -0
- data/lib/rouge/lexers/sql.rb +161 -0
- data/lib/rouge/lexers/supercollider.rb +116 -0
- data/lib/rouge/lexers/swift.rb +186 -0
- data/lib/rouge/lexers/tap.rb +89 -0
- data/lib/rouge/lexers/tcl.rb +193 -0
- data/lib/rouge/lexers/terraform.rb +113 -0
- data/lib/rouge/lexers/tex.rb +70 -0
- data/lib/rouge/lexers/toml.rb +106 -0
- data/lib/rouge/lexers/tsx.rb +20 -0
- data/lib/rouge/lexers/ttcn3.rb +119 -0
- data/lib/rouge/lexers/tulip.rb +108 -0
- data/lib/rouge/lexers/turtle.rb +61 -0
- data/lib/rouge/lexers/twig.rb +40 -0
- data/lib/rouge/lexers/typescript.rb +30 -0
- data/lib/rouge/lexers/typescript/common.rb +34 -0
- data/lib/rouge/lexers/vala.rb +78 -0
- data/lib/rouge/lexers/varnish.rb +168 -0
- data/lib/rouge/lexers/vb.rb +165 -0
- data/lib/rouge/lexers/verilog.rb +163 -0
- data/lib/rouge/lexers/vhdl.rb +98 -0
- data/lib/rouge/lexers/viml.rb +102 -0
- data/lib/rouge/lexers/viml/keywords.rb +14 -0
- data/lib/rouge/lexers/vue.rb +124 -0
- data/lib/rouge/lexers/wollok.rb +104 -0
- data/lib/rouge/lexers/xml.rb +54 -0
- data/lib/rouge/lexers/xojo.rb +61 -0
- data/lib/rouge/lexers/xpath.rb +332 -0
- data/lib/rouge/lexers/xquery.rb +145 -0
- data/lib/rouge/lexers/yaml.rb +376 -0
- data/lib/rouge/plugins/redcarpet.rb +37 -0
- data/lib/rouge/regex_lexer.rb +443 -0
- data/lib/rouge/template_lexer.rb +21 -0
- data/lib/rouge/tex_theme_renderer.rb +132 -0
- data/lib/rouge/text_analyzer.rb +50 -0
- data/lib/rouge/theme.rb +218 -0
- data/lib/rouge/themes/base16.rb +131 -0
- data/lib/rouge/themes/bw.rb +41 -0
- data/lib/rouge/themes/colorful.rb +68 -0
- data/lib/rouge/themes/github.rb +72 -0
- data/lib/rouge/themes/gruvbox.rb +168 -0
- data/lib/rouge/themes/igor_pro.rb +21 -0
- data/lib/rouge/themes/magritte.rb +78 -0
- data/lib/rouge/themes/molokai.rb +83 -0
- data/lib/rouge/themes/monokai.rb +93 -0
- data/lib/rouge/themes/monokai_sublime.rb +93 -0
- data/lib/rouge/themes/pastie.rb +70 -0
- data/lib/rouge/themes/thankful_eyes.rb +75 -0
- data/lib/rouge/themes/tulip.rb +70 -0
- data/lib/rouge/token.rb +191 -0
- data/lib/rouge/util.rb +102 -0
- data/lib/rouge/version.rb +8 -0
- data/rouge.gemspec +26 -0
- metadata +476 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class SQF < RegexLexer
|
7
|
+
tag "sqf"
|
8
|
+
filenames "*.sqf"
|
9
|
+
|
10
|
+
title "SQF"
|
11
|
+
desc "Status Quo Function, a Real Virtuality engine scripting language"
|
12
|
+
|
13
|
+
def self.wordoperators
|
14
|
+
@wordoperators ||= Set.new %w(
|
15
|
+
and or not
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.initializers
|
20
|
+
@initializers ||= Set.new %w(
|
21
|
+
private param params
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.controlflow
|
26
|
+
@controlflow ||= Set.new %w(
|
27
|
+
if then else exitwith switch do case default while for from to step
|
28
|
+
foreach
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.constants
|
33
|
+
@constants ||= Set.new %w(
|
34
|
+
true false player confignull controlnull displaynull grpnull
|
35
|
+
locationnull netobjnull objnull scriptnull tasknull teammembernull
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.namespaces
|
40
|
+
@namespaces ||= Set.new %w(
|
41
|
+
currentnamespace missionnamespace parsingnamespace profilenamespace
|
42
|
+
uinamespace
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.diag_commands
|
47
|
+
@diag_commands ||= Set.new %w(
|
48
|
+
diag_activemissionfsms diag_activesqfscripts diag_activesqsscripts
|
49
|
+
diag_activescripts diag_captureframe diag_captureframetofile
|
50
|
+
diag_captureslowframe diag_codeperformance diag_drawmode diag_enable
|
51
|
+
diag_enabled diag_fps diag_fpsmin diag_frameno diag_lightnewload
|
52
|
+
diag_list diag_log diag_logslowframe diag_mergeconfigfile
|
53
|
+
diag_recordturretlimits diag_setlightnew diag_ticktime diag_toggle
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.commands
|
58
|
+
load File.join(__dir__, "sqf/commands.rb")
|
59
|
+
@commands = self.commands
|
60
|
+
end
|
61
|
+
|
62
|
+
state :root do
|
63
|
+
# Whitespace
|
64
|
+
rule %r"\s+", Text
|
65
|
+
|
66
|
+
# Preprocessor instructions
|
67
|
+
rule %r"/\*.*?\*/"m, Comment::Multiline
|
68
|
+
rule %r"//.*", Comment::Single
|
69
|
+
rule %r"#(define|undef|if(n)?def|else|endif|include)", Comment::Preproc
|
70
|
+
rule %r"\\\r?\n", Comment::Preproc
|
71
|
+
rule %r"__(EVAL|EXEC|LINE__|FILE__)", Name::Builtin
|
72
|
+
|
73
|
+
# Literals
|
74
|
+
rule %r"\".*?\"", Literal::String
|
75
|
+
rule %r"'.*?'", Literal::String
|
76
|
+
rule %r"(\$|0x)[0-9a-fA-F]+", Literal::Number::Hex
|
77
|
+
rule %r"[0-9]+(\.)?(e[0-9]+)?", Literal::Number::Float
|
78
|
+
|
79
|
+
# Symbols
|
80
|
+
rule %r"[\!\%\&\*\+\-\/\<\=\>\^\|\#]", Operator
|
81
|
+
rule %r"[\(\)\{\}\[\]\,\:\;]", Punctuation
|
82
|
+
|
83
|
+
# Identifiers (variables and functions)
|
84
|
+
rule %r"[a-zA-Z0-9_]+" do |m|
|
85
|
+
name = m[0].downcase
|
86
|
+
if self.class.wordoperators.include? name
|
87
|
+
token Operator::Word
|
88
|
+
elsif self.class.initializers.include? name
|
89
|
+
token Keyword::Declaration
|
90
|
+
elsif self.class.controlflow.include? name
|
91
|
+
token Keyword::Reserved
|
92
|
+
elsif self.class.constants.include? name
|
93
|
+
token Keyword::Constant
|
94
|
+
elsif self.class.namespaces.include? name
|
95
|
+
token Keyword::Namespace
|
96
|
+
elsif self.class.diag_commands.include? name
|
97
|
+
token Name::Function
|
98
|
+
elsif self.class.commands.include? name
|
99
|
+
token Name::Function
|
100
|
+
elsif %r"_.+" =~ name
|
101
|
+
token Name::Variable
|
102
|
+
else
|
103
|
+
token Name::Variable::Global
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# automatically generated by `rake builtins:sqf`
|
5
|
+
module Rouge
|
6
|
+
module Lexers
|
7
|
+
class SQF < RegexLexer
|
8
|
+
def self.commands
|
9
|
+
@commands = Set.new %w(
|
10
|
+
abs acos actionids actionkeys actionkeysimages actionkeysnames actionkeysnamesarray actionname activateaddons activatekey add3denconnection add3deneventhandler addcamshake addforcegeneratorrtd additempool addmagazinepool addmissioneventhandler addmusiceventhandler addswitchableunit addtoremainscollector addweaponpool admin agent agltoasl aimpos airdensityrtd airplanethrottle airportside aisfinishheal alive allcontrols allmissionobjects allsimpleobjects allturrets allturrets allvariables allvariables allvariables allvariables allvariables allvariables allvariables animationnames animationstate asin asltoagl asltoatl assert assignedcargo assignedcommander assigneddriver assignedgunner assigneditems assignedtarget assignedteam assignedvehicle assignedvehiclerole atan atg atltoasl attachedobject attachedobjects attachedto attackenabled backpack backpackcargo backpackcontainer backpackitems backpackmagazines behaviour binocular boundingbox boundingboxreal boundingcenter breakout breakto buldozer_enableroaddiag buldozer_loadnewroads buttonaction buttonaction buttonsetaction call camcommitted camdestroy cameraeffectenablehud camerainterest campreloaded camtarget camusenvg cancelsimpletaskdestination canfire canmove canstand cantriggerdynamicsimulation canunloadincombat captive captivenum case cbchecked ceil channelenabled checkaifeature classname clear3deninventory clearallitemsfrombackpack clearbackpackcargo clearbackpackcargoglobal cleargroupicons clearitemcargo clearitemcargoglobal clearmagazinecargo clearmagazinecargoglobal clearoverlay clearweaponcargo clearweaponcargoglobal closedialog closeoverlay collapseobjecttree collect3denhistory collectivertd combatmode commander commandgetout commandstop comment commitoverlay compile compilefinal completedfsm composetext confighierarchy configname configproperties configsourceaddonlist configsourcemod configsourcemodlist copytoclipboard cos count count count create3dencomposition create3denentity createagent createcenter createdialog creatediarylink creategeardialog creategroup createguardedpoint createlocation createmarker createmarkerlocal createmine createsimpleobject createsoundsource createteam createtrigger createvehicle createvehiclecrew crew ctaddheader ctaddrow ctclear ctcursel ctheadercount ctrlactivate ctrlangle ctrlautoscrolldelay ctrlautoscrollrewind ctrlautoscrollspeed ctrlchecked ctrlclassname ctrlcommitted ctrldelete ctrlenable ctrlenabled ctrlenabled ctrlfade ctrlhtmlloaded ctrlidc ctrlidd ctrlmapanimclear ctrlmapanimcommit ctrlmapanimdone ctrlmapmouseover ctrlmapscale ctrlmodel ctrlmodeldirandup ctrlmodelscale ctrlparent ctrlparentcontrolsgroup ctrlposition ctrlscale ctrlsetfocus ctrlsettext ctrlshow ctrlshown ctrltext ctrltext ctrltextheight ctrltextsecondary ctrltextwidth ctrltype ctrlvisible ctrowcount curatoraddons curatorcameraarea curatorcameraareaceiling curatoreditableobjects curatoreditingarea curatoreditingareatype curatorpoints curatorregisteredobjects curatorwaypointcost currentcommand currentmagazine currentmagazinedetail currentmuzzle currenttask currenttasks currentthrowable currentvisionmode currentwaypoint currentweapon currentweaponmode currentzeroing cutobj cutrsc cuttext damage datetonumber deactivatekey debriefingtext debuglog default deg delete3denentities deletecenter deletecollection deletegroup deleteidentity deletelocation deletemarker deletemarkerlocal deletesite deletestatus deleteteam deletevehicle deletewaypoint detach detectedmines diag_captureframe diag_captureframetofile diag_captureslowframe diag_codeperformance diag_dynamicsimulationend diag_lightnewload diag_log diag_logslowframe diag_setlightnew didjipowner difficultyenabled difficultyoption direction direction disablemapindicators disableremotesensors disableuserinput displayparent dissolveteam do3denaction dogetout dostop drawicon3d drawline3d driver drop dynamicsimulationdistance dynamicsimulationdistancecoef dynamicsimulationenabled dynamicsimulationenabled echo edit3denmissionattributes effectivecommander enableaudiofeature enablecamshake enablecaustics enabledebriefingstats enablediaglegend enabledynamicsimulationsystem enableengineartillery enableenvironment enableradio enablesatnormalondetail enablesaving enablesentences enablestressdamage enableteamswitch enabletraffic enableweapondisassembly endmission enginesisonrtd enginespowerrtd enginesrpmrtd enginestorquertd entities entities estimatedtimeleft everybackpack everycontainer execfsm execvm exp expecteddestination exportjipmessages eyedirection eyepos face faction failmission fillweaponsfrompool finddisplay finite firstbackpack flag flaganimationphase flagowner flagside flagtexture fleeing floor for for forceatpositionrtd forcegeneratorrtd forcemap forcerespawn format formation formation formationdirection formationleader formationmembers formationposition formationtask formattext formleader fromeditor fuel fullcrew fullcrew gearidcammocount gearslotammocount gearslotdata get3denactionstate get3denconnections get3denentity get3denentityid get3dengrid get3denlayerentities get3denselected getaimingcoef getallenvsoundcontrollers getallhitpointsdamage getallownedmines getallsoundcontrollers getammocargo getanimaimprecision getanimspeedcoef getarray getartilleryammo getassignedcuratorlogic getassignedcuratorunit getbackpackcargo getbleedingremaining getburningvalue getcameraviewdirection getcenterofmass getconnecteduav getcontainermaxload getcustomaimcoef getdammage getdescription getdir getdirvisual getdlcassetsusagebyname getdlcs getdlcusagetime geteditorcamera geteditormode getenginetargetrpmrtd getfatigue getfieldmanualstartpage getforcedflagtexture getfuelcargo getgroupiconparams getgroupicons getitemcargo getmagazinecargo getmarkercolor getmarkerpos getmarkersize getmarkertype getmass getmissionconfig getmissionconfigvalue getmissionlayerentities getmodelinfo getnumber getobjectdlc getobjectmaterials getobjecttextures getobjecttype getoxygenremaining getpersonuseddlcs getpilotcameradirection getpilotcameraposition getpilotcamerarotation getpilotcameratarget getplatenumber getplayerchannel getplayerscores getplayeruid getpos getpos getposasl getposaslvisual getposaslw getposatl getposatlvisual getposvisual getposworld getpylonmagazines getrepaircargo getrotorbrakertd getshotparents getslingload getstamina getstatvalue getsuppression getterrainheightasl gettext gettrimoffsetrtd getunitloadout getunitloadout getunitloadout getusermfdtext getusermfdvalue getvehiclecargo getweaponcargo getweaponsway getwingsorientationrtd getwingspositionrtd getwppos goggles goto group groupfromnetid groupid groupowner groupselectedunits gunner handgunitems handgunmagazine handgunweapon handshit haspilotcamera hcallgroups hcleader hcremoveallgroups hcselected hcshowbar headgear hidebody hideobject hideobjectglobal hint hintc hintcadet hintsilent hmd hostmission if image importallgroups importance incapacitatedstate inflamed infopanel infopanels ingameuiseteventhandler inheritsfrom inputaction isabletobreathe isagent isaimprecisionenabled isarray isautohoveron isautonomous isautostartupenabledrtd isautotrimonrtd isbleeding isburning isclass iscollisionlighton iscopilotenabled isdamageallowed isdlcavailable isengineon isforcedwalk isformationleader isgroupdeletedwhenempty ishidden isinremainscollector iskeyactive islaseron islighton islocalized ismanualfire ismarkedforcollection isnil isnull isnull isnull isnull isnull isnull isnull isnull isnull isnumber isobjecthidden isobjectrtd isonroad isplayer isrealtime isshowing3dicons issimpleobject issprintallowed isstaminaenabled istext istouchingground isturnedout isuavconnected isvehiclecargo isvehicleradaron iswalking isweapondeployed isweaponrested itemcargo items itemswithmagazines keyimage keyname landresult lasertarget lbadd lbclear lbclear lbcolor lbcolorright lbcursel lbcursel lbdata lbdelete lbpicture lbpictureright lbselection lbsetcolor lbsetcolorright lbsetcursel lbsetdata lbsetpicture lbsetpicturecolor lbsetpicturecolordisabled lbsetpicturecolorselected lbsetpictureright lbsetselectcolor lbsetselectcolorright lbsettext lbsettooltip lbsetvalue lbsize lbsize lbsort lbsort lbsort lbsortbyvalue lbsortbyvalue lbtext lbtextright lbvalue leader leader leader leaderboarddeinit leaderboardgetrows leaderboardinit leaderboardrequestrowsfriends leaderboardrequestrowsglobal leaderboardrequestrowsglobalarounduser leaderboardsrequestuploadscore leaderboardsrequestuploadscorekeepbest leaderboardstate lifestate lightdetachobject lightison linearconversion lineintersects lineintersectsobjs lineintersectssurfaces lineintersectswith list listremotetargets listvehiclesensors ln lnbaddarray lnbaddcolumn lnbaddrow lnbclear lnbclear lnbcolor lnbcolorright lnbcurselrow lnbcurselrow lnbdata lnbdeletecolumn lnbdeleterow lnbgetcolumnsposition lnbgetcolumnsposition lnbpicture lnbpictureright lnbsetcolor lnbsetcolorright lnbsetcolumnspos lnbsetcurselrow lnbsetdata lnbsetpicture lnbsetpicturecolor lnbsetpicturecolorright lnbsetpicturecolorselected lnbsetpicturecolorselectedright lnbsetpictureright lnbsettext lnbsettextright lnbsetvalue lnbsize lnbsize lnbsort lnbsortbyvalue lnbtext lnbtextright lnbvalue load loadabs loadbackpack loadfile loaduniform loadvest local local localize locationposition locked lockeddriver lockidentity log lognetwork lognetworkterminate magazinecargo magazines magazinesallturrets magazinesammo magazinesammocargo magazinesammofull magazinesdetail magazinesdetailbackpack magazinesdetailuniform magazinesdetailvest mapanimadd mapcenteroncamera mapgridposition markeralpha markerbrush markercolor markerdir markerpos markershape markersize markertext markertype members menuaction menuadd menuchecked menuclear menuclear menucollapse menudata menudelete menuenable menuenabled menuexpand menuhover menuhover menupicture menusetaction menusetcheck menusetdata menusetpicture menusetvalue menushortcut menushortcuttext menusize menusort menutext menuurl menuvalue mineactive modparams moonphase morale move3dencamera moveout movetime movetocompleted movetofailed name name namesound nearestbuilding nearestbuilding nearestlocation nearestlocations nearestlocationwithdubbing nearestobject nearestobjects nearestterrainobjects needreload netid netid nextmenuitemindex not numberofenginesrtd numbertodate objectcurators objectfromnetid objectparent onbriefinggroup onbriefingnotes onbriefingplan onbriefingteamswitch oncommandmodechanged oneachframe ongroupiconclick ongroupiconoverenter ongroupiconoverleave onhcgroupselectionchanged onmapsingleclick onplayerconnected onplayerdisconnected onpreloadfinished onpreloadstarted onteamswitch opendlcpage openmap openmap opensteamapp openyoutubevideo owner param params parsenumber parsenumber parsesimplearray parsetext pickweaponpool pitch playableslotsnumber playersnumber playmission playmusic playmusic playscriptedmission playsound playsound playsound3d position position positioncameratoworld ppeffectcommitted ppeffectcommitted ppeffectcreate ppeffectdestroy ppeffectdestroy ppeffectenabled precision preloadcamera preloadsound preloadtitleobj preloadtitlersc preprocessfile preprocessfilelinenumbers primaryweapon primaryweaponitems primaryweaponmagazine priority private processdiarylink progressloadingscreen progressposition publicvariable publicvariableserver putweaponpool queryitemspool querymagazinepool queryweaponpool rad radiochannelcreate random random rank rankid rating rectangular registeredtasks reload reloadenabled remoteexec remoteexeccall remove3denconnection remove3deneventhandler remove3denlayer removeall3deneventhandlers removeallactions removeallassigneditems removeallcontainers removeallcuratoraddons removeallcuratorcameraareas removeallcuratoreditingareas removeallhandgunitems removeallitems removeallitemswithmagazines removeallmissioneventhandlers removeallmusiceventhandlers removeallownedmines removeallprimaryweaponitems removeallweapons removebackpack removebackpackglobal removefromremainscollector removegoggles removeheadgear removemissioneventhandler removemusiceventhandler removeswitchableunit removeuniform removevest requiredversion resetsubgroupdirection resources restarteditorcamera reverse roadat roadsconnectedto roledescription ropeattachedobjects ropeattachedto ropeattachenabled ropecreate ropecut ropedestroy ropeendposition ropelength ropes ropeunwind ropeunwound rotorsforcesrtd rotorsrpmrtd round save3deninventory saveoverlay savevar scopename score scoreside screenshot screentoworld scriptdone scriptname scudstate secondaryweapon secondaryweaponitems secondaryweaponmagazine selectbestplaces selectededitorobjects selectionnames selectmax selectmin selectplayer selectrandom selectrandomweighted sendaumessage sendudpmessage servercommand servercommandavailable servercommandexecutable set3denattributes set3dengrid set3deniconsvisible set3denlinesvisible set3denmissionattributes set3denmodelsvisible set3denselected setacctime setaperture setaperturenew setarmorypoints setcamshakedefparams setcamshakeparams setcompassoscillation setcurrentchannel setcustommissiondata setdate setdefaultcamera setdetailmapblendpars setgroupiconsselectable setgroupiconsvisible sethorizonparallaxcoef sethudmovementlevels setinfopanel setlocalwindparams setmouseposition setmusiceventhandler setobjectviewdistance setobjectviewdistance setplayable setplayerrespawntime setshadowdistance setsimulweatherlayers setstaminascheme setstatvalue setsystemofunits setterraingrid settimemultiplier settrafficdensity settrafficdistance settrafficgap settrafficspeed setviewdistance setwind setwinddir showchat showcinemaborder showcommandingmenu showcompass showcuratorcompass showgps showhud showhud showmap showpad showradio showscoretable showsubtitles showuavfeed showwarrant showwatch showwaypoints side side side simpletasks simulationenabled simulclouddensity simulcloudocclusion simulinclouds sin size sizeof skill skiptime sleep sliderposition sliderposition sliderrange sliderrange slidersetposition slidersetrange slidersetspeed sliderspeed sliderspeed soldiermagazines someammo speaker speed speedmode sqrt squadparams stance startloadingscreen stopenginertd stopped str supportinfo surfaceiswater surfacenormal surfacetype switch switchcamera synchronizedobjects synchronizedtriggers synchronizedwaypoints synchronizedwaypoints systemchat tan taskalwaysvisible taskchildren taskcompleted taskcustomdata taskdescription taskdestination taskhint taskmarkeroffset taskparent taskresult taskstate tasktype teammember teamname teamtype terminate terrainintersect terrainintersectasl terrainintersectatasl text text textlog textlogformat tg throw titlecut titlefadeout titleobj titlersc titletext toarray tofixed tolower tostring toupper triggeractivated triggeractivation triggerarea triggerattachedvehicle triggerstatements triggertext triggertimeout triggertimeoutcurrent triggertype try tvadd tvclear tvclear tvcollapse tvcollapseall tvcollapseall tvcount tvcursel tvcursel tvdata tvdelete tvexpand tvexpandall tvexpandall tvpicture tvpictureright tvsetcursel tvsetdata tvsetpicture tvsetpicturecolor tvsetpictureright tvsetpicturerightcolor tvsettext tvsettooltip tvsetvalue tvsort tvsortbyvalue tvtext tvtooltip tvvalue type type typename typeof uavcontrol uisleep unassigncurator unassignteam unassignvehicle underwater uniform uniformcontainer uniformitems uniformmagazines unitaddons unitaimposition unitaimpositionvisual unitbackpack unitisuav unitpos unitready unitrecoilcoefficient units units unlockachievement updateobjecttree useaiopermapobstructiontest useaisteeringcomponent vectordir vectordirvisual vectormagnitude vectormagnitudesqr vectornormalized vectorup vectorupvisual vehicle vehiclecargoenabled vehiclereceiveremotetargets vehiclereportownposition vehiclereportremotetargets vehiclevarname velocity velocitymodelspace verifysignature vest vestcontainer vestitems vestmagazines visibleposition visiblepositionasl waituntil waypointattachedobject waypointattachedvehicle waypointbehaviour waypointcombatmode waypointcompletionradius waypointdescription waypointforcebehaviour waypointformation waypointhouseposition waypointloiterradius waypointloitertype waypointname waypointposition waypoints waypointscript waypointsenableduav waypointshow waypointspeed waypointstatements waypointtimeout waypointtimeoutcurrent waypointtype waypointvisible weaponcargo weaponinertia weaponlowered weapons weaponsitems weaponsitemscargo weaponstate weaponstate weightrtd wfsidetext wfsidetext wfsidetext while wingsforcesrtd with worldtoscreen action actionparams add3denlayer addaction addbackpack addbackpackcargo addbackpackcargoglobal addbackpackglobal addcuratoraddons addcuratorcameraarea addcuratoreditableobjects addcuratoreditingarea addcuratorpoints addeditorobject addeventhandler addforce addgoggles addgroupicon addhandgunitem addheadgear additem additemcargo additemcargoglobal additemtobackpack additemtouniform additemtovest addlivestats addmagazine addmagazine addmagazineammocargo addmagazinecargo addmagazinecargoglobal addmagazineglobal addmagazines addmagazineturret addmenu addmenuitem addmpeventhandler addownedmine addplayerscores addprimaryweaponitem addpublicvariableeventhandler addpublicvariableeventhandler addrating addresources addscore addscoreside addsecondaryweaponitem addteammember addtorque adduniform addvehicle addvest addwaypoint addweapon addweaponcargo addweaponcargoglobal addweaponglobal addweaponitem addweaponturret aimedattarget allow3dmode allowcrewinimmobile allowcuratorlogicignoreareas allowdamage allowdammage allowfileoperations allowfleeing allowgetin allowsprint ammo ammoonpylon and and animate animatebay animatedoor animatepylon animatesource animationphase animationsourcephase append apply arrayintersect assignascargo assignascargoindex assignascommander assignasdriver assignasgunner assignasturret assigncurator assignitem assignteam assigntoairport atan2 attachobject attachto backpackspacefor breakout buildingexit buildingpos buttonsetaction call callextension callextension camcommand camcommit camcommitprepared camconstuctionsetparams camcreate cameraeffect campreload campreparebank campreparedir campreparedive campreparefocus campreparefov campreparefovrange campreparepos campreparerelpos campreparetarget campreparetarget camsetbank camsetdir camsetdive camsetfocus camsetfov camsetfovrange camsetpos camsetrelpos camsettarget camsettarget canadd canadditemtobackpack canadditemtouniform canadditemtovest canslingload canvehiclecargo catch cbsetchecked checkvisibility clear3denattribute closedisplay commandartilleryfire commandchat commandfire commandfollow commandfsm commandmove commandradio commandsuppressivefire commandtarget commandwatch commandwatch configclasses confirmsensortarget connectterminaltouav controlsgroupctrl copywaypoints count countenemy countfriendly countside counttype countunknown create3denentity creatediaryrecord creatediarysubject createdisplay createmenu createmissiondisplay createmissiondisplay creatempcampaigndisplay createsimpletask createsite createtask createunit createunit createvehicle createvehiclelocal ctdata ctfindheaderrows ctfindrowheader ctheadercontrols ctremoveheaders ctremoverows ctrladdeventhandler ctrlchecked ctrlcommit ctrlcreate ctrlenable ctrlmapanimadd ctrlmapcursor ctrlmapscreentoworld ctrlmapworldtoscreen ctrlremovealleventhandlers ctrlremoveeventhandler ctrlsetactivecolor ctrlsetangle ctrlsetautoscrolldelay ctrlsetautoscrollrewind ctrlsetautoscrollspeed ctrlsetbackgroundcolor ctrlsetchecked ctrlsetchecked ctrlsetdisabledcolor ctrlseteventhandler ctrlsetfade ctrlsetfont ctrlsetfonth1 ctrlsetfonth1b ctrlsetfonth2 ctrlsetfonth2b ctrlsetfonth3 ctrlsetfonth3b ctrlsetfonth4 ctrlsetfonth4b ctrlsetfonth5 ctrlsetfonth5b ctrlsetfonth6 ctrlsetfonth6b ctrlsetfontheight ctrlsetfontheighth1 ctrlsetfontheighth2 ctrlsetfontheighth3 ctrlsetfontheighth4 ctrlsetfontheighth5 ctrlsetfontheighth6 ctrlsetfontheightsecondary ctrlsetfontp ctrlsetfontp ctrlsetfontpb ctrlsetfontsecondary ctrlsetforegroundcolor ctrlsetmodel ctrlsetmodeldirandup ctrlsetmodelscale ctrlsetpixelprecision ctrlsetpixelprecision ctrlsetposition ctrlsetscale ctrlsetstructuredtext ctrlsettext ctrlsettextcolor ctrlsettextcolorsecondary ctrlsettextsecondary ctrlsettooltip ctrlsettooltipcolorbox ctrlsettooltipcolorshade ctrlsettooltipcolortext ctrlshow ctrowcontrols ctsetcursel ctsetdata ctsetheadertemplate ctsetrowtemplate ctsetvalue ctvalue curatorcoef currentmagazinedetailturret currentmagazineturret currentweaponturret customchat customradio cutfadeout cutfadeout cutobj cutobj cutrsc cutrsc cuttext cuttext debugfsm deleteat deleteeditorobject deletegroupwhenempty deleterange deleteresources deletevehiclecrew diarysubjectexists directsay disableai disablecollisionwith disableconversation disablenvgequipment disabletiequipment disableuavconnectability displayaddeventhandler displayctrl displayremovealleventhandlers displayremoveeventhandler displayseteventhandler distance distance distance distance distance2d distancesqr distancesqr distancesqr distancesqr do do do do doartilleryfire dofire dofollow dofsm domove doorphase dosuppressivefire dotarget dowatch dowatch drawarrow drawellipse drawicon drawline drawlink drawlocation drawpolygon drawrectangle drawtriangle editobject editorseteventhandler else emptypositions enableai enableaifeature enableaimprecision enableattack enableautostartuprtd enableautotrimrtd enablechannel enablechannel enablecollisionwith enablecopilot enabledynamicsimulation enabledynamicsimulation enablefatigue enablegunlights enableinfopanelcomponent enableirlasers enablemimics enablepersonturret enablereload enableropeattach enablesimulation enablesimulationglobal enablestamina enableuavconnectability enableuavwaypoints enablevehiclecargo enablevehiclesensor enableweapondisassembly engineon evalobjectargument exec execeditorscript execfsm execvm exitwith fademusic faderadio fadesound fadespeech find find findcover findeditorobject findeditorobject findemptyposition findemptypositionready findif findnearestenemy fire fire fireattarget flyinheight flyinheightasl forceadduniform forceflagtexture forcefollowroad forcespeed forcewalk forceweaponfire foreach foreachmember foreachmemberagent foreachmemberteam forgettarget from get3denattribute get3denattribute get3denattribute get3denattribute get3denattribute get3denmissionattribute getartilleryeta getcargoindex getcompatiblepylonmagazines getcompatiblepylonmagazines getdir geteditorobjectscope getenvsoundcontroller getfriend getfsmvariable getgroupicon gethidefrom gethit gethitindex gethitpointdamage getobjectargument getobjectchildren getobjectproxy getpos getreldir getrelpos getsoundcontroller getsoundcontrollerresult getspeed getunittrait getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable getvariable glanceat globalchat globalradio groupchat groupradio groupselectunit hasweapon hcgroupparams hcremovegroup hcselectgroup hcsetgroup hideobject hideobjectglobal hideselection hintc hintc hintc htmlload in in in inarea inarea inarea inarea inarea inareaarray inareaarray inareaarray inareaarray inflame infopanelcomponentenabled infopanelcomponents inpolygon inrangeofartillery inserteditorobject intersect isequalto isequaltype isequaltypeall isequaltypeany isequaltypearray isequaltypeparams isflashlighton isflatempty isirlaseron iskindof iskindof iskindof issensortargetconfirmed isuavconnectable isuniformallowed isvehiclesensorenabled join joinas joinassilent joinsilent joinstring kbadddatabase kbadddatabasetargets kbaddtopic kbhastopic kbreact kbremovetopic kbtell kbwassaid knowsabout knowsabout land landat lbadd lbcolor lbcolorright lbdata lbdelete lbisselected lbpicture lbpictureright lbsetcolor lbsetcolorright lbsetcursel lbsetdata lbsetpicture lbsetpicturecolor lbsetpicturecolordisabled lbsetpicturecolorselected lbsetpictureright lbsetpicturerightcolor lbsetpicturerightcolordisabled lbsetpicturerightcolorselected lbsetselectcolor lbsetselectcolorright lbsetselected lbsettext lbsettextright lbsettooltip lbsetvalue lbtext lbtextright lbvalue leavevehicle leavevehicle lightattachobject limitspeed linkitem listobjects lnbaddcolumn lnbaddrow lnbcolor lnbcolorright lnbdata lnbdeletecolumn lnbdeleterow lnbpicture lnbpictureright lnbsetcolor lnbsetcolorright lnbsetcolumnspos lnbsetcurselrow lnbsetdata lnbsetpicture lnbsetpicturecolor lnbsetpicturecolorright lnbsetpicturecolorselected lnbsetpicturecolorselectedright lnbsetpictureright lnbsettext lnbsettextright lnbsetvalue lnbsort lnbsortbyvalue lnbtext lnbtextright lnbvalue loadidentity loadmagazine loadoverlay loadstatus lock lock lockcamerato lockcargo lockcargo lockdriver lockedcargo lockedturret lockturret lockwp lookat lookatpos magazinesturret magazineturretammo mapcenteroncamera max menuaction menuadd menuchecked menucollapse menudata menudelete menuenable menuenabled menuexpand menupicture menusetaction menusetcheck menusetdata menusetpicture menusetvalue menushortcut menushortcuttext menusize menusort menutext menuurl menuvalue min minedetectedby mod modeltoworld modeltoworldvisual modeltoworldvisualworld modeltoworldworld move moveinany moveincargo moveincargo moveincommander moveindriver moveingunner moveinturret moveobjecttoend moveto nearentities nearestobject nearestobject nearobjects nearobjectsready nearroads nearsupplies neartargets newoverlay nmenuitems objstatus ondoubleclick onmapsingleclick onshownewobject or or ordergetin param params playaction playactionnow playgesture playmove playmovenow posscreentoworld posworldtoscreen ppeffectadjust ppeffectadjust ppeffectcommit ppeffectcommit ppeffectcommit ppeffectenable ppeffectenable ppeffectenable ppeffectforceinnvg preloadobject progresssetposition publicvariableclient pushback pushbackunique radiochanneladd radiochannelremove radiochannelsetcallsign radiochannelsetlabel random registertask remotecontrol remoteexec remoteexeccall removeaction removealleventhandlers removeallmpeventhandlers removecuratoraddons removecuratorcameraarea removecuratoreditableobjects removecuratoreditingarea removedrawicon removedrawlinks removeeventhandler removegroupicon removehandgunitem removeitem removeitemfrombackpack removeitemfromuniform removeitemfromvest removeitems removemagazine removemagazineglobal removemagazines removemagazinesturret removemagazineturret removemenuitem removemenuitem removempeventhandler removeownedmine removeprimaryweaponitem removesecondaryweaponitem removesimpletask removeteammember removeweapon removeweaponattachmentcargo removeweaponcargo removeweaponglobal removeweaponturret reportremotetarget resize respawnvehicle reveal reveal revealmine ropeattachto ropedetach saveidentity savestatus say say say2d say2d say3d say3d select select select select select select selectdiarysubject selecteditorobject selectionposition selectleader selectrandomweighted selectweapon selectweaponturret sendsimplecommand sendtask sendtaskresult servercommand set set3denattribute set3denlayer set3denlogictype set3denmissionattribute set3denobjecttype setactualcollectivertd setairplanethrottle setairportside setammo setammocargo setammoonpylon setanimspeedcoef setattributes setautonomous setbehaviour setbleedingremaining setbrakesrtd setcamerainterest setcamuseti setcaptive setcenterofmass setcollisionlight setcombatmode setcombatmode setconvoyseparation setcuratorcameraareaceiling setcuratorcoef setcuratoreditingareatype setcuratorwaypointcost setcurrenttask setcurrentwaypoint setcustomaimcoef setcustomweightrtd setdamage setdammage setdebriefingtext setdestination setdir setdirection setdrawicon setdriveonpath setdropinterval setdynamicsimulationdistance setdynamicsimulationdistancecoef seteditormode seteditorobjectscope seteffectcondition setenginerpmrtd setface setfaceanimation setfatigue setfeaturetype setflaganimationphase setflagowner setflagside setflagtexture setfog setforcegeneratorrtd setformation setformation setformationtask setformdir setfriend setfromeditor setfsmvariable setfuel setfuelcargo setgroupicon setgroupiconparams setgroupid setgroupidglobal setgroupowner setgusts sethidebehind sethit sethitindex sethitpointdamage setidentity setimportance setleader setlightambient setlightattenuation setlightbrightness setlightcolor setlightdaylight setlightflaremaxdistance setlightflaresize setlightintensity setlightnings setlightuseflare setmagazineturretammo setmarkeralpha setmarkeralphalocal setmarkerbrush setmarkerbrushlocal setmarkercolor setmarkercolorlocal setmarkerdir setmarkerdirlocal setmarkerpos setmarkerposlocal setmarkershape setmarkershapelocal setmarkersize setmarkersizelocal setmarkertext setmarkertextlocal setmarkertype setmarkertypelocal setmass setmimic setmusiceffect setname setname setname setnamesound setobjectarguments setobjectmaterial setobjectmaterialglobal setobjectproxy setobjecttexture setobjecttextureglobal setovercast setowner setoxygenremaining setparticlecircle setparticleclass setparticlefire setparticleparams setparticlerandom setpilotcameradirection setpilotcamerarotation setpilotcameratarget setpilotlight setpipeffect setpitch setplatenumber setpos setposasl setposasl2 setposaslw setposatl setposition setposworld setpylonloadout setpylonspriority setradiomsg setrain setrainbow setrandomlip setrank setrectangular setrepaircargo setrotorbrakertd setshotparents setside setsimpletaskalwaysvisible setsimpletaskcustomdata setsimpletaskdescription setsimpletaskdestination setsimpletasktarget setsimpletasktype setsize setskill setskill setslingload setsoundeffect setspeaker setspeech setspeedmode setstamina setsuppression settargetage settaskmarkeroffset settaskresult settaskstate settext settitleeffect settriggeractivation settriggerarea settriggerstatements settriggertext settriggertimeout settriggertype settype setunconscious setunitability setunitloadout setunitloadout setunitloadout setunitpos setunitposweak setunitrank setunitrecoilcoefficient setunittrait setunloadincombat setuseractiontext setusermfdtext setusermfdvalue setvariable setvariable setvariable setvariable setvariable setvariable setvariable setvariable setvectordir setvectordirandup setvectorup setvehicleammo setvehicleammodef setvehiclearmor setvehiclecargo setvehicleid setvehiclelock setvehicleposition setvehicleradar setvehiclereceiveremotetargets setvehiclereportownposition setvehiclereportremotetargets setvehicletipars setvehiclevarname setvelocity setvelocitymodelspace setvelocitytransformation setvisibleiftreecollapsed setwantedrpmrtd setwaves setwaypointbehaviour setwaypointcombatmode setwaypointcompletionradius setwaypointdescription setwaypointforcebehaviour setwaypointformation setwaypointhouseposition setwaypointloiterradius setwaypointloitertype setwaypointname setwaypointposition setwaypointscript setwaypointspeed setwaypointstatements setwaypointtimeout setwaypointtype setwaypointvisible setweaponreloadingtime setwinddir setwindforce setwindstr setwingforcescalertd setwppos show3dicons showlegend showneweditorobject showwaypoint sidechat sideradio skill skillfinal slidersetposition slidersetrange slidersetspeed sort spawn splitstring step stop suppressfor swimindepth switchaction switchcamera switchgesture switchlight switchmove synchronizeobjectsadd synchronizeobjectsremove synchronizetrigger synchronizewaypoint synchronizewaypoint targetknowledge targets targetsaggregate targetsquery then then throw to tofixed triggerattachobject triggerattachvehicle triggerdynamicsimulation try turretlocal turretowner turretunit tvadd tvcollapse tvcount tvdata tvdelete tvexpand tvpicture tvpictureright tvsetcolor tvsetcursel tvsetdata tvsetpicture tvsetpicturecolor tvsetpicturecolordisabled tvsetpicturecolorselected tvsetpictureright tvsetpicturerightcolor tvsetpicturerightcolordisabled tvsetpicturerightcolorselected tvsetselectcolor tvsettext tvsettooltip tvsetvalue tvsort tvsortbyvalue tvtext tvtooltip tvvalue unassignitem unitsbelowheight unitsbelowheight unlinkitem unregistertask updatedrawicon updatemenuitem useaudiotimeformoves vectoradd vectorcos vectorcrossproduct vectordiff vectordistance vectordistancesqr vectordotproduct vectorfromto vectormodeltoworld vectormodeltoworldvisual vectormultiply vectorworldtomodel vectorworldtomodelvisual vehiclechat vehicleradio waypointattachobject waypointattachvehicle weaponaccessories weaponaccessoriescargo weapondirection weaponsturret worldtomodel worldtomodelvisual acctime activatedaddons agents airdensitycurvertd all3denentities allairports allcurators allcutlayers alldead alldeadmen alldisplays allgroups allmapmarkers allmines allplayers allsites allunits allunitsuav armorypoints benchmark blufor briefingname buldozer_isenabledroaddiag buldozer_reloadopermap cadetmode cameraon cameraview campaignconfigfile cansuspend cheatsenabled civilian clearforcesrtd clearitempool clearmagazinepool clearradio clearweaponpool clientowner commandingmenu configfile confignull controlnull copyfromclipboard curatorcamera curatormouseover curatorselected current3denoperation currentchannel currentnamespace cursorobject cursortarget date daytime diag_activemissionfsms diag_activescripts diag_activesqfscripts diag_activesqsscripts diag_fps diag_fpsmin diag_frameno diag_ticktime dialog didjip difficulty difficultyenabledrtd disabledebriefingstats disableserialization displaynull distributionregion dynamicsimulationsystemenabled east enableenddialog endl endloadingscreen environmentenabled estimatedendservertime exit false finishmissioninit fog fogforecast fogparams forcedmap forceend forceweatherchange freelook get3dencamera get3deniconsvisible get3denlinesvisible get3denmouseover getartillerycomputersettings getclientstate getclientstatenumber getcursorobjectparams getdlcassetsusage getelevationoffset getmissiondlcs getmissionlayers getmouseposition getmusicplayedtime getobjectviewdistance getremotesensorsdisabled getresolution getshadowdistance getterraingrid gettotaldlcusagetime groupiconselectable groupiconsvisible grpnull gusts halt hasinterface hcshownbar hudmovementlevels humidity independent initambientlife is3den is3denmultiplayer isautotest isdedicated isfilepatchingenabled isinstructorfigureenabled ismultiplayer ismultiplayersolo ispipenabled isremoteexecuted isremoteexecutedjip isserver issteammission isstreamfriendlyuienabled isstressdamageenabled istuthintsenabled isuicontext language librarycredits librarydisclaimers lightnings linebreak loadgame locationnull logentities mapanimclear mapanimcommit mapanimdone markasfinishedonsteam missionconfigfile missiondifficulty missionname missionnamespace missionstart missionversion moonintensity musicvolume netobjnull nextweatherchange nil objnull opencuratorinterface opfor overcast overcastforecast parsingnamespace particlesquality pi pixelgrid pixelgridbase pixelgridnouiscale pixelh pixelw playableunits player playerrespawntime playerside productversion profilename profilenamespace profilenamesteam radiovolume rain rainbow remoteexecutedowner resetcamshake resistance reversedmousey runinitscript safezoneh safezonew safezonewabs safezonex safezonexabs safezoney savegame savejoysticks saveprofilenamespace savingenabled scriptnull selectnoplayer servername servertime shownartillerycomputer shownchat showncompass showncuratorcompass showngps shownhud shownmap shownpad shownradio shownscoretable shownuavfeed shownwarrant shownwatch sideambientlife sideempty sideenemy sidefriendly sidelogic sideunknown simulweathersync slingloadassistantshown soundvolume sunormoon switchableunits systemofunits tasknull teammembernull teams teamswitch teamswitchenabled time timemultiplier true uinamespace userinputdisabled vehicles viewdistance visiblecompass visiblegps visiblemap visiblescoretable visiblewatch waves west wind winddir windrtd windstr worldname worldsize
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class SQL < RegexLexer
|
7
|
+
title "SQL"
|
8
|
+
desc "Structured Query Language, for relational databases"
|
9
|
+
tag 'sql'
|
10
|
+
filenames '*.sql'
|
11
|
+
mimetypes 'text/x-sql'
|
12
|
+
|
13
|
+
def self.keywords
|
14
|
+
@keywords ||= Set.new %w(
|
15
|
+
ABORT ABS ABSOLUTE ACCESS ADA ADD ADMIN AFTER AGGREGATE ALIAS
|
16
|
+
ALL ALLOCATE ALTER ANALYSE ANALYZE AND ANY ARE AS ASC ASENSITIVE
|
17
|
+
ASSERTION ASSIGNMENT ASYMMETRIC AT ATOMIC AUTHORIZATION
|
18
|
+
AVG BACKWARD BEFORE BEGIN BETWEEN BITVAR BIT_LENGTH BOTH
|
19
|
+
BREADTH BY C CACHE CALL CALLED CARDINALITY CASCADE CASCADED
|
20
|
+
CASE CAST CATALOG CATALOG_NAME CHAIN CHARACTERISTICS
|
21
|
+
CHARACTER_LENGTH CHARACTER_SET_CATALOG CHARACTER_SET_NAME
|
22
|
+
CHARACTER_SET_SCHEMA CHAR_LENGTH CHECK CHECKED CHECKPOINT
|
23
|
+
CLASS CLASS_ORIGIN CLOB CLOSE CLUSTER COALSECE COBOL COLLATE
|
24
|
+
COLLATION COLLATION_CATALOG COLLATION_NAME COLLATION_SCHEMA
|
25
|
+
COLUMN COLUMN_NAME COMMAND_FUNCTION COMMAND_FUNCTION_CODE
|
26
|
+
COMMENT COMMIT COMMITTED COMPLETION CONDITION_NUMBER
|
27
|
+
CONNECT CONNECTION CONNECTION_NAME CONSTRAINT CONSTRAINTS
|
28
|
+
CONSTRAINT_CATALOG CONSTRAINT_NAME CONSTRAINT_SCHEMA
|
29
|
+
CONSTRUCTOR CONTAINS CONTINUE CONVERSION CONVERT COPY
|
30
|
+
CORRESPONTING COUNT CREATE CREATEDB CREATEUSER CROSS CUBE
|
31
|
+
CURRENT CURRENT_DATE CURRENT_PATH CURRENT_ROLE CURRENT_TIME
|
32
|
+
CURRENT_TIMESTAMP CURRENT_USER CURSOR CURSOR_NAME CYCLE DATA
|
33
|
+
DATABASE DATETIME_INTERVAL_CODE DATETIME_INTERVAL_PRECISION
|
34
|
+
DAY DEALLOCATE DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED
|
35
|
+
DEFINED DEFINER DELETE DELIMITER DELIMITERS DEREF DESC DESCRIBE
|
36
|
+
DESCRIPTOR DESTROY DESTRUCTOR DETERMINISTIC DIAGNOSTICS
|
37
|
+
DICTIONARY DISCONNECT DISPATCH DISTINCT DO DOMAIN DROP
|
38
|
+
DYNAMIC DYNAMIC_FUNCTION DYNAMIC_FUNCTION_CODE EACH ELSE
|
39
|
+
ENCODING ENCRYPTED END END-EXEC EQUALS ESCAPE EVERY EXCEPT
|
40
|
+
ESCEPTION EXCLUDING EXCLUSIVE EXEC EXECUTE EXISTING EXISTS
|
41
|
+
EXPLAIN EXTERNAL EXTRACT FALSE FETCH FINAL FIRST FOR FORCE
|
42
|
+
FOREIGN FORTRAN FORWARD FOUND FREE FREEZE FROM FULL FUNCTION
|
43
|
+
G GENERAL GENERATED GET GLOBAL GO GOTO GRANT GRANTED GROUP
|
44
|
+
GROUPING HANDLER HAVING HIERARCHY HOLD HOST IDENTITY IGNORE
|
45
|
+
ILIKE IMMEDIATE IMMUTABLE IMPLEMENTATION IMPLICIT IN INCLUDING
|
46
|
+
INCREMENT INDEX INDITCATOR INFIX INHERITS INITIALIZE INITIALLY
|
47
|
+
INNER INOUT INPUT INSENSITIVE INSERT INSTANTIABLE INSTEAD
|
48
|
+
INTERSECT INTO INVOKER IS ISNULL ISOLATION ITERATE JOIN KEY
|
49
|
+
KEY_MEMBER KEY_TYPE LANCOMPILER LANGUAGE LARGE LAST LATERAL
|
50
|
+
LEADING LEFT LENGTH LESS LEVEL LIKE LIMIT LISTEN LOAD LOCAL
|
51
|
+
LOCALTIME LOCALTIMESTAMP LOCATION LOCATOR LOCK LOWER MAP MATCH
|
52
|
+
MAX MAXVALUE MESSAGE_LENGTH MESSAGE_OCTET_LENGTH MESSAGE_TEXT
|
53
|
+
METHOD MIN MINUTE MINVALUE MOD MODE MODIFIES MODIFY MONTH
|
54
|
+
MORE MOVE MUMPS NAMES NATURAL NCLOB NEW NEXT
|
55
|
+
NO NOCREATEDB NOCREATEUSER NONE NOT NOTHING NOTIFY NOTNULL
|
56
|
+
NULL NULLABLE NULLIF OBJECT OCTET_LENGTH OF OFF OFFSET OIDS
|
57
|
+
OLD ON ONLY OPEN OPERATION OPERATOR OPTION OPTIONS OR ORDER
|
58
|
+
ORDINALITY OUT OUTER OUTPUT OVERLAPS OVERLAY OVERRIDING
|
59
|
+
OWNER PAD PARAMETER PARAMETERS PARAMETER_MODE PARAMATER_NAME
|
60
|
+
PARAMATER_ORDINAL_POSITION PARAMETER_SPECIFIC_CATALOG
|
61
|
+
PARAMETER_SPECIFIC_NAME PARAMATER_SPECIFIC_SCHEMA PARTIAL PASCAL
|
62
|
+
PENDANT PLACING PLI POSITION POSTFIX PREFIX PREORDER
|
63
|
+
PREPARE PRESERVE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE
|
64
|
+
PUBLIC READ READS RECHECK RECURSIVE REF REFERENCES REFERENCING
|
65
|
+
REINDEX RELATIVE RENAME REPEATABLE REPLACE RESET RESTART
|
66
|
+
RESTRICT RESULT RETURN RETURNED_LENGTH RETURNED_OCTET_LENGTH
|
67
|
+
RETURNED_SQLSTATE RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP
|
68
|
+
ROUTINE ROUTINE_CATALOG ROUTINE_NAME ROUTINE_SCHEMA ROW ROWS
|
69
|
+
ROW_COUNT RULE SAVE_POINT SCALE SCHEMA SCHEMA_NAME SCOPE SCROLL
|
70
|
+
SEARCH SECOND SECURITY SELECT SELF SENSITIVE SERIALIZABLE
|
71
|
+
SERVER_NAME SESSION SESSION_USER SET SETOF SETS SHARE SHOW
|
72
|
+
SIMILAR SIMPLE SIZE SOME SOURCE SPACE SPECIFIC SPECIFICTYPE
|
73
|
+
SPECIFIC_NAME SQL SQLCODE SQLERROR SQLEXCEPTION SQLSTATE
|
74
|
+
SQLWARNINIG STABLE START STATE STATEMENT STATIC STATISTICS
|
75
|
+
STDIN STDOUT STORAGE STRICT STRUCTURE STYPE SUBCLASS_ORIGIN
|
76
|
+
SUBLIST SUBSTRING SUM SYMMETRIC SYSID SYSTEM SYSTEM_USER
|
77
|
+
TABLE TABLE_NAME TEMP TEMPLATE TEMPORARY TERMINATE THAN THEN
|
78
|
+
TIMEZONE_HOUR TIMEZONE_MINUTE TO TOAST TRAILING
|
79
|
+
TRANSATION TRANSACTIONS_COMMITTED TRANSACTIONS_ROLLED_BACK
|
80
|
+
TRANSATION_ACTIVE TRANSFORM TRANSFORMS TRANSLATE TRANSLATION
|
81
|
+
TREAT TRIGGER TRIGGER_CATALOG TRIGGER_NAME TRIGGER_SCHEMA TRIM
|
82
|
+
TRUE TRUNCATE TRUSTED TYPE UNCOMMITTED UNDER UNENCRYPTED UNION
|
83
|
+
UNIQUE UNKNOWN UNLISTEN UNNAMED UNNEST UNTIL UPDATE UPPER
|
84
|
+
USAGE USER USER_DEFINED_TYPE_CATALOG USER_DEFINED_TYPE_NAME
|
85
|
+
USER_DEFINED_TYPE_SCHEMA USING VACUUM VALID VALIDATOR VALUES
|
86
|
+
VARIABLE VERBOSE VERSION VIEW VOLATILE WHEN WHENEVER WHERE
|
87
|
+
WITH WITHOUT WORK WRITE ZONE
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
def self.keywords_type
|
92
|
+
# sources:
|
93
|
+
# https://dev.mysql.com/doc/refman/5.7/en/numeric-type-overview.html
|
94
|
+
# https://dev.mysql.com/doc/refman/5.7/en/date-and-time-type-overview.html
|
95
|
+
# https://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html
|
96
|
+
@keywords_type ||= Set.new(%w(
|
97
|
+
ZEROFILL UNSIGNED SIGNED SERIAL BIT TINYINT BOOL BOOLEAN SMALLINT
|
98
|
+
MEDIUMINT INT INTEGER BIGINT DECIMAL DEC NUMERIC FIXED FLOAT DOUBLE
|
99
|
+
PRECISION REAL
|
100
|
+
DATE DATETIME TIMESTAMP TIME YEAR
|
101
|
+
NATIONAL CHAR CHARACTER NCHAR BYTE
|
102
|
+
VARCHAR VARYING BINARY VARBINARY TINYBLOB TINYTEXT BLOB TEXT
|
103
|
+
MEDIUMBLOB MEDIUMTEXT LONGBLOB LONGTEXT ENUM
|
104
|
+
))
|
105
|
+
end
|
106
|
+
|
107
|
+
state :root do
|
108
|
+
rule %r/\s+/m, Text
|
109
|
+
rule %r/--.*/, Comment::Single
|
110
|
+
rule %r(/\*), Comment::Multiline, :multiline_comments
|
111
|
+
rule %r/\d+/, Num::Integer
|
112
|
+
rule %r/'/, Str::Single, :single_string
|
113
|
+
# A double-quoted string refers to a database object in our default SQL
|
114
|
+
# dialect, which is apropriate for e.g. MS SQL and PostgreSQL.
|
115
|
+
rule %r/"/, Name::Variable, :double_string
|
116
|
+
rule %r/`/, Name::Variable, :backtick
|
117
|
+
|
118
|
+
rule %r/\w[\w\d]*/ do |m|
|
119
|
+
if self.class.keywords_type.include? m[0].upcase
|
120
|
+
token Name::Builtin
|
121
|
+
elsif self.class.keywords.include? m[0].upcase
|
122
|
+
token Keyword
|
123
|
+
else
|
124
|
+
token Name
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
rule %r([+*/<>=~!@#%&|?^-]), Operator
|
129
|
+
rule %r/[;:()\[\],.]/, Punctuation
|
130
|
+
end
|
131
|
+
|
132
|
+
state :multiline_comments do
|
133
|
+
rule %r(/[*]), Comment::Multiline, :multiline_comments
|
134
|
+
rule %r([*]/), Comment::Multiline, :pop!
|
135
|
+
rule %r([^/*]+), Comment::Multiline
|
136
|
+
rule %r([/*]), Comment::Multiline
|
137
|
+
end
|
138
|
+
|
139
|
+
state :backtick do
|
140
|
+
rule %r/\\./, Str::Escape
|
141
|
+
rule %r/``/, Str::Escape
|
142
|
+
rule %r/`/, Name::Variable, :pop!
|
143
|
+
rule %r/[^\\`]+/, Name::Variable
|
144
|
+
end
|
145
|
+
|
146
|
+
state :single_string do
|
147
|
+
rule %r/\\./, Str::Escape
|
148
|
+
rule %r/''/, Str::Escape
|
149
|
+
rule %r/'/, Str::Single, :pop!
|
150
|
+
rule %r/[^\\']+/, Str::Single
|
151
|
+
end
|
152
|
+
|
153
|
+
state :double_string do
|
154
|
+
rule %r/\\./, Str::Escape
|
155
|
+
rule %r/""/, Str::Escape
|
156
|
+
rule %r/"/, Name::Variable, :pop!
|
157
|
+
rule %r/[^\\"]+/, Name::Variable
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class SuperCollider < RegexLexer
|
7
|
+
tag 'supercollider'
|
8
|
+
filenames '*.sc', '*.scd'
|
9
|
+
|
10
|
+
title "SuperCollider"
|
11
|
+
desc 'A cross-platform interpreted programming language for sound synthesis, algorithmic composition, and realtime performance'
|
12
|
+
|
13
|
+
def self.keywords
|
14
|
+
@keywords ||= Set.new %w(
|
15
|
+
var arg classvar const super this
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
# these aren't technically keywords, but we treat
|
20
|
+
# them as such because it makes things clearer 99%
|
21
|
+
# of the time
|
22
|
+
def self.reserved
|
23
|
+
@reserved ||= Set.new %w(
|
24
|
+
case do for forBy loop if while new newCopyArgs
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.constants
|
29
|
+
@constants ||= Set.new %w(
|
30
|
+
true false nil inf thisThread
|
31
|
+
thisMethod thisFunction thisProcess
|
32
|
+
thisFunctionDef currentEnvironment
|
33
|
+
topEnvironment
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
state :whitespace do
|
38
|
+
rule %r/\s+/m, Text
|
39
|
+
end
|
40
|
+
|
41
|
+
state :comments do
|
42
|
+
rule %r(//.*?$), Comment::Single
|
43
|
+
rule %r(/[*]) do
|
44
|
+
token Comment::Multiline
|
45
|
+
push :nested_comment
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
state :nested_comment do
|
50
|
+
rule %r(/[*]), Comment::Multiline, :nested_comment
|
51
|
+
rule %r([*]/), Comment::Multiline, :pop!
|
52
|
+
rule %r([^*/]+)m, Comment::Multiline
|
53
|
+
rule %r/./, Comment::Multiline
|
54
|
+
end
|
55
|
+
|
56
|
+
state :root do
|
57
|
+
mixin :whitespace
|
58
|
+
mixin :comments
|
59
|
+
|
60
|
+
rule %r/[\-+]?0[xX]\h+/, Num::Hex
|
61
|
+
|
62
|
+
# radix float
|
63
|
+
rule %r/[\-+]?\d+r[0-9a-zA-Z]*(\.[0-9A-Z]*)?/, Num::Float
|
64
|
+
|
65
|
+
# normal float
|
66
|
+
rule %r/[\-+]?((\d+(\.\d+)?([eE][\-+]?\d+)?(pi)?)|pi)/, Num::Float
|
67
|
+
|
68
|
+
rule %r/[\-+]?\d+/, Num::Integer
|
69
|
+
|
70
|
+
rule %r/\$(\\.|.)/, Str::Char
|
71
|
+
|
72
|
+
rule %r/"([^\\"]|\\.)*"/, Str
|
73
|
+
|
74
|
+
# symbols (single-quote notation)
|
75
|
+
rule %r/'([^\\']|\\.)*'/, Str::Other
|
76
|
+
|
77
|
+
# symbols (backslash notation)
|
78
|
+
rule %r/\\\w+/, Str::Other
|
79
|
+
|
80
|
+
# symbol arg
|
81
|
+
rule %r/[A-Za-z_]\w*:/, Name::Label
|
82
|
+
|
83
|
+
rule %r/[A-Z]\w*/, Name::Class
|
84
|
+
|
85
|
+
# primitive
|
86
|
+
rule %r/_\w+/, Name::Function
|
87
|
+
|
88
|
+
# main identifiers section
|
89
|
+
rule %r/[a-z]\w*/ do |m|
|
90
|
+
if self.class.keywords.include? m[0]
|
91
|
+
token Keyword
|
92
|
+
elsif self.class.constants.include? m[0]
|
93
|
+
token Keyword::Constant
|
94
|
+
elsif self.class.reserved.include? m[0]
|
95
|
+
token Keyword::Reserved
|
96
|
+
else
|
97
|
+
token Name
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# environment variables
|
102
|
+
rule %r/~\w+/, Name::Variable::Global
|
103
|
+
|
104
|
+
rule %r/[\{\}()\[\];,\.]/, Punctuation
|
105
|
+
|
106
|
+
# operators. treat # (array unpack) as an operator
|
107
|
+
rule %r/[\+\-\*\/&\|%<>=]+/, Operator
|
108
|
+
rule %r/[\^:#]/, Operator
|
109
|
+
|
110
|
+
# treat curry argument as a special operator
|
111
|
+
rule %r/\b_\b/, Name::Builtin
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
@@ -0,0 +1,186 @@
|
|
1
|
+
# -*- coding: utf-8 -*- #
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Rouge
|
5
|
+
module Lexers
|
6
|
+
class Swift < RegexLexer
|
7
|
+
tag 'swift'
|
8
|
+
filenames '*.swift'
|
9
|
+
|
10
|
+
title "Swift"
|
11
|
+
desc 'Multi paradigm, compiled programming language developed by Apple for iOS and OS X development. (developer.apple.com/swift)'
|
12
|
+
|
13
|
+
id_head = /_|(?!\p{Mc})\p{Alpha}|[^\u0000-\uFFFF]/
|
14
|
+
id_rest = /[\p{Alnum}_]|[^\u0000-\uFFFF]/
|
15
|
+
id = /#{id_head}#{id_rest}*/
|
16
|
+
|
17
|
+
keywords = Set.new %w(
|
18
|
+
break case continue default do else fallthrough if in for return switch where while try catch throw guard defer repeat
|
19
|
+
|
20
|
+
as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__
|
21
|
+
|
22
|
+
associativity didSet get infix inout mutating none nonmutating operator override postfix precedence prefix set unowned weak willSet throws rethrows precedencegroup
|
23
|
+
|
24
|
+
#available #colorLiteral #column #else #elseif #endif #error #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation #warning
|
25
|
+
)
|
26
|
+
|
27
|
+
declarations = Set.new %w(
|
28
|
+
class deinit enum convenience extension final func import init internal lazy let optional private protocol public required static struct subscript typealias var dynamic indirect associatedtype open fileprivate some
|
29
|
+
)
|
30
|
+
|
31
|
+
constants = Set.new %w(
|
32
|
+
true false nil
|
33
|
+
)
|
34
|
+
|
35
|
+
start { push :bol }
|
36
|
+
|
37
|
+
# beginning of line
|
38
|
+
state :bol do
|
39
|
+
rule %r/#.*/, Comment::Preproc
|
40
|
+
|
41
|
+
mixin :inline_whitespace
|
42
|
+
|
43
|
+
rule(//) { pop! }
|
44
|
+
end
|
45
|
+
|
46
|
+
state :inline_whitespace do
|
47
|
+
rule %r/\s+/m, Text
|
48
|
+
mixin :has_comments
|
49
|
+
end
|
50
|
+
|
51
|
+
state :whitespace do
|
52
|
+
rule %r/\n+/m, Text, :bol
|
53
|
+
rule %r(\/\/.*?$), Comment::Single, :bol
|
54
|
+
mixin :inline_whitespace
|
55
|
+
end
|
56
|
+
|
57
|
+
state :has_comments do
|
58
|
+
rule %r(/[*]), Comment::Multiline, :nested_comment
|
59
|
+
end
|
60
|
+
|
61
|
+
state :nested_comment do
|
62
|
+
mixin :has_comments
|
63
|
+
rule %r([*]/), Comment::Multiline, :pop!
|
64
|
+
rule %r([^*/]+)m, Comment::Multiline
|
65
|
+
rule %r/./, Comment::Multiline
|
66
|
+
end
|
67
|
+
|
68
|
+
state :root do
|
69
|
+
mixin :whitespace
|
70
|
+
|
71
|
+
rule %r/\$(([1-9]\d*)?\d)/, Name::Variable
|
72
|
+
|
73
|
+
rule %r{[()\[\]{}:;,?\\]}, Punctuation
|
74
|
+
rule %r([-/=+*%<>!&|^.~]+), Operator
|
75
|
+
rule %r/@?"/, Str, :dq
|
76
|
+
rule %r/'(\\.|.)'/, Str::Char
|
77
|
+
rule %r/(\d+(?:_\d+)*\*|(?:\d+(?:_\d+)*)*\.\d+(?:_\d)*)(e[+-]?\d+(?:_\d)*)?/i, Num::Float
|
78
|
+
rule %r/\d+e[+-]?[0-9]+/i, Num::Float
|
79
|
+
rule %r/0o?[0-7]+(?:_[0-7]+)*/, Num::Oct
|
80
|
+
rule %r/0x[0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*((\.[0-9A-F]+(?:_[0-9A-F]+)*)?p[+-]?\d+)?/, Num::Hex
|
81
|
+
rule %r/0b[01]+(?:_[01]+)*/, Num::Bin
|
82
|
+
rule %r{[\d]+(?:_\d+)*}, Num::Integer
|
83
|
+
|
84
|
+
rule %r/@#{id}/, Keyword::Declaration
|
85
|
+
|
86
|
+
rule %r/(private|internal)(\([ ]*)(\w+)([ ]*\))/ do |m|
|
87
|
+
if m[3] == 'set'
|
88
|
+
token Keyword::Declaration
|
89
|
+
else
|
90
|
+
groups Keyword::Declaration, Keyword::Declaration, Error, Keyword::Declaration
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
rule %r/(unowned\([ ]*)(\w+)([ ]*\))/ do |m|
|
95
|
+
if m[2] == 'safe' || m[2] == 'unsafe'
|
96
|
+
token Keyword::Declaration
|
97
|
+
else
|
98
|
+
groups Keyword::Declaration, Error, Keyword::Declaration
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
rule %r/#available\([^)]+\)/, Keyword::Declaration
|
103
|
+
|
104
|
+
rule %r/(#(?:selector|keyPath)\()([^)]+?(?:[(].*?[)])?)(\))/ do
|
105
|
+
groups Keyword::Declaration, Name::Function, Keyword::Declaration
|
106
|
+
end
|
107
|
+
|
108
|
+
rule %r/#(line|file|column|function|dsohandle)/, Keyword::Declaration
|
109
|
+
|
110
|
+
rule %r/(let|var)\b(\s*)(#{id})/ do
|
111
|
+
groups Keyword, Text, Name::Variable
|
112
|
+
end
|
113
|
+
|
114
|
+
rule %r/(let|var)\b(\s*)([(])/ do
|
115
|
+
groups Keyword, Text, Punctuation
|
116
|
+
push :tuple
|
117
|
+
end
|
118
|
+
|
119
|
+
rule %r/(?!\b(if|while|for|private|internal|unowned|switch|case)\b)\b#{id}(?=(\?|!)?\s*[(])/ do |m|
|
120
|
+
if m[0] =~ /^[[:upper:]]/
|
121
|
+
token Keyword::Type
|
122
|
+
else
|
123
|
+
token Name::Function
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
rule %r/as[?!]?(?=\s)/, Keyword
|
128
|
+
rule %r/try[!]?(?=\s)/, Keyword
|
129
|
+
|
130
|
+
rule %r/(#?(?!default)(?![[:upper:]])#{id})(\s*)(:)/ do
|
131
|
+
groups Name::Variable, Text, Punctuation
|
132
|
+
end
|
133
|
+
|
134
|
+
rule id do |m|
|
135
|
+
if keywords.include? m[0]
|
136
|
+
token Keyword
|
137
|
+
elsif declarations.include? m[0]
|
138
|
+
token Keyword::Declaration
|
139
|
+
elsif constants.include? m[0]
|
140
|
+
token Keyword::Constant
|
141
|
+
elsif m[0] =~ /^[[:upper:]]/
|
142
|
+
token Keyword::Type
|
143
|
+
else
|
144
|
+
token Name
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
rule %r/(`)(#{id})(`)/ do
|
149
|
+
groups Punctuation, Name::Variable, Punctuation
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
state :tuple do
|
154
|
+
rule %r/(#{id})/, Name::Variable
|
155
|
+
rule %r/(`)(#{id})(`)/ do
|
156
|
+
groups Punctuation, Name::Variable, Punctuation
|
157
|
+
end
|
158
|
+
rule %r/,/, Punctuation
|
159
|
+
rule %r/[(]/, Punctuation, :push
|
160
|
+
rule %r/[)]/, Punctuation, :pop!
|
161
|
+
mixin :inline_whitespace
|
162
|
+
end
|
163
|
+
|
164
|
+
state :dq do
|
165
|
+
rule %r/\\[\\0tnr'"]/, Str::Escape
|
166
|
+
rule %r/\\[(]/, Str::Escape, :interp
|
167
|
+
rule %r/\\u\{\h{1,8}\}/, Str::Escape
|
168
|
+
rule %r/[^\\"]+/, Str
|
169
|
+
rule %r/"""/, Str, :pop!
|
170
|
+
rule %r/"/, Str, :pop!
|
171
|
+
end
|
172
|
+
|
173
|
+
state :interp do
|
174
|
+
rule %r/[(]/, Punctuation, :interp_inner
|
175
|
+
rule %r/[)]/, Str::Escape, :pop!
|
176
|
+
mixin :root
|
177
|
+
end
|
178
|
+
|
179
|
+
state :interp_inner do
|
180
|
+
rule %r/[(]/, Punctuation, :push
|
181
|
+
rule %r/[)]/, Punctuation, :pop!
|
182
|
+
mixin :root
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|