rouge 2.0.7 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -9
  3. data/lib/rouge.rb +1 -0
  4. data/lib/rouge/cli.rb +20 -0
  5. data/lib/rouge/demos/awk +4 -0
  6. data/lib/rouge/demos/console +6 -0
  7. data/lib/rouge/demos/digdag +19 -0
  8. data/lib/rouge/demos/dot +5 -0
  9. data/lib/rouge/demos/graphql +17 -0
  10. data/lib/rouge/demos/hylang +10 -0
  11. data/lib/rouge/demos/igorpro +9 -0
  12. data/lib/rouge/demos/irb +4 -0
  13. data/lib/rouge/demos/irb_output +2 -0
  14. data/lib/rouge/demos/lasso +12 -0
  15. data/lib/rouge/demos/mosel +10 -0
  16. data/lib/rouge/demos/plist +142 -0
  17. data/lib/rouge/demos/pony +17 -0
  18. data/lib/rouge/demos/q +2 -0
  19. data/lib/rouge/demos/sieve +10 -0
  20. data/lib/rouge/demos/tsx +17 -0
  21. data/lib/rouge/demos/turtle +0 -0
  22. data/lib/rouge/demos/wollok +11 -0
  23. data/lib/rouge/formatters/html_inline.rb +9 -1
  24. data/lib/rouge/formatters/html_pygments.rb +2 -2
  25. data/lib/rouge/formatters/html_table.rb +1 -1
  26. data/lib/rouge/formatters/terminal256.rb +1 -1
  27. data/lib/rouge/lexer.rb +124 -37
  28. data/lib/rouge/lexers/abap.rb +2 -2
  29. data/lib/rouge/lexers/apache.rb +1 -1
  30. data/lib/rouge/lexers/awk.rb +161 -0
  31. data/lib/rouge/lexers/clojure.rb +2 -2
  32. data/lib/rouge/lexers/coffeescript.rb +1 -1
  33. data/lib/rouge/lexers/console.rb +136 -0
  34. data/lib/rouge/lexers/csharp.rb +26 -7
  35. data/lib/rouge/lexers/digdag.rb +72 -0
  36. data/lib/rouge/lexers/docker.rb +1 -1
  37. data/lib/rouge/lexers/dot.rb +68 -0
  38. data/lib/rouge/lexers/elixir.rb +52 -27
  39. data/lib/rouge/lexers/fortran.rb +56 -28
  40. data/lib/rouge/lexers/fsharp.rb +1 -1
  41. data/lib/rouge/lexers/gherkin/keywords.rb +4 -4
  42. data/lib/rouge/lexers/graphql.rb +243 -0
  43. data/lib/rouge/lexers/groovy.rb +5 -1
  44. data/lib/rouge/lexers/haml.rb +19 -24
  45. data/lib/rouge/lexers/html.rb +48 -4
  46. data/lib/rouge/lexers/hylang.rb +93 -0
  47. data/lib/rouge/lexers/igorpro.rb +407 -0
  48. data/lib/rouge/lexers/irb.rb +66 -0
  49. data/lib/rouge/lexers/javascript.rb +21 -10
  50. data/lib/rouge/lexers/json.rb +3 -2
  51. data/lib/rouge/lexers/json_doc.rb +6 -0
  52. data/lib/rouge/lexers/jsx.rb +2 -1
  53. data/lib/rouge/lexers/lasso.rb +217 -0
  54. data/lib/rouge/lexers/lasso/keywords.yml +446 -0
  55. data/lib/rouge/lexers/lua.rb +3 -0
  56. data/lib/rouge/lexers/lua/builtins.rb +1 -1
  57. data/lib/rouge/lexers/markdown.rb +2 -3
  58. data/lib/rouge/lexers/matlab/builtins.rb +1 -1
  59. data/lib/rouge/lexers/moonscript.rb +8 -4
  60. data/lib/rouge/lexers/mosel.rb +231 -0
  61. data/lib/rouge/lexers/ocaml.rb +9 -20
  62. data/lib/rouge/lexers/php.rb +40 -20
  63. data/lib/rouge/lexers/php/builtins.rb +27 -37
  64. data/lib/rouge/lexers/plain_text.rb +4 -3
  65. data/lib/rouge/lexers/plist.rb +49 -0
  66. data/lib/rouge/lexers/pony.rb +93 -0
  67. data/lib/rouge/lexers/powershell.rb +36 -0
  68. data/lib/rouge/lexers/properties.rb +2 -2
  69. data/lib/rouge/lexers/q.rb +124 -0
  70. data/lib/rouge/lexers/r.rb +2 -2
  71. data/lib/rouge/lexers/ruby.rb +26 -13
  72. data/lib/rouge/lexers/rust.rb +7 -5
  73. data/lib/rouge/lexers/sed.rb +4 -2
  74. data/lib/rouge/lexers/shell.rb +38 -16
  75. data/lib/rouge/lexers/sieve.rb +96 -0
  76. data/lib/rouge/lexers/sml.rb +3 -2
  77. data/lib/rouge/lexers/tsx.rb +19 -0
  78. data/lib/rouge/lexers/turtle.rb +0 -0
  79. data/lib/rouge/lexers/typescript.rb +3 -27
  80. data/lib/rouge/lexers/typescript/common.rb +33 -0
  81. data/lib/rouge/lexers/viml/keywords.rb +2 -2
  82. data/lib/rouge/lexers/wollok.rb +107 -0
  83. data/lib/rouge/lexers/xml.rb +1 -1
  84. data/lib/rouge/lexers/yaml.rb +4 -1
  85. data/lib/rouge/regex_lexer.rb +1 -0
  86. data/lib/rouge/template_lexer.rb +3 -5
  87. data/lib/rouge/theme.rb +14 -4
  88. data/lib/rouge/themes/igor_pro.rb +20 -0
  89. data/lib/rouge/themes/pastie.rb +69 -0
  90. data/lib/rouge/themes/thankful_eyes.rb +8 -5
  91. data/lib/rouge/version.rb +1 -1
  92. metadata +40 -6
  93. data/lib/rouge/demos/shell_session +0 -10
  94. data/lib/rouge/lexers/shell_session.rb +0 -29
@@ -0,0 +1,33 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Lexers
5
+ module TypescriptCommon
6
+ def self.keywords
7
+ @keywords ||= super + Set.new(%w(
8
+ is namespace static private protected public
9
+ implements readonly
10
+ ))
11
+ end
12
+
13
+ def self.declarations
14
+ @declarations ||= super + Set.new(%w(
15
+ type abstract
16
+ ))
17
+ end
18
+
19
+ def self.reserved
20
+ @reserved ||= super + Set.new(%w(
21
+ string any void number namespace module
22
+ declare default interface keyof
23
+ ))
24
+ end
25
+
26
+ def self.builtins
27
+ @builtins ||= super + %w(
28
+ Pick Partial Readonly Record
29
+ )
30
+ end
31
+ end
32
+ end
33
+ end
@@ -5,8 +5,8 @@ module Rouge
5
5
  module Lexers
6
6
  class VimL
7
7
  def self.keywords
8
- @keywords ||= {:command=>[["a", "a"], ["ab", "ab"], ["abc", "abclear"], ["abo", "aboveleft"], ["al", "all"], ["ar", "ar"], ["ar", "args"], ["arga", "argadd"], ["argd", "argdelete"], ["argdo", "argdo"], ["arge", "argedit"], ["argg", "argglobal"], ["argl", "arglocal"], ["argu", "argument"], ["as", "ascii"], ["au", "au"], ["b", "buffer"], ["bN", "bNext"], ["ba", "ball"], ["bad", "badd"], ["bd", "bdelete"], ["bel", "belowright"], ["bf", "bfirst"], ["bl", "blast"], ["bm", "bmodified"], ["bn", "bnext"], ["bo", "botright"], ["bp", "bprevious"], ["br", "br"], ["br", "brewind"], ["brea", "break"], ["breaka", "breakadd"], ["breakd", "breakdel"], ["breakl", "breaklist"], ["bro", "browse"], ["bu", "bu"], ["buf", "buf"], ["bufdo", "bufdo"], ["buffers", "buffers"], ["bun", "bunload"], ["bw", "bwipeout"], ["c", "c"], ["c", "change"], ["cN", "cN"], ["cN", "cNext"], ["cNf", "cNf"], ["cNf", "cNfile"], ["cabc", "cabclear"], ["cad", "cad"], ["cad", "caddexpr"], ["caddb", "caddbuffer"], ["caddf", "caddfile"], ["cal", "call"], ["cat", "catch"], ["cb", "cbuffer"], ["cc", "cc"], ["ccl", "cclose"], ["cd", "cd"], ["ce", "center"], ["cex", "cexpr"], ["cf", "cfile"], ["cfir", "cfirst"], ["cg", "cgetfile"], ["cgetb", "cgetbuffer"], ["cgete", "cgetexpr"], ["changes", "changes"], ["chd", "chdir"], ["che", "checkpath"], ["checkt", "checktime"], ["cl", "cl"], ["cl", "clist"], ["cla", "clast"], ["clo", "close"], ["cmapc", "cmapclear"], ["cn", "cn"], ["cn", "cnext"], ["cnew", "cnewer"], ["cnf", "cnf"], ["cnf", "cnfile"], ["co", "copy"], ["col", "colder"], ["colo", "colorscheme"], ["com", "com"], ["comc", "comclear"], ["comp", "compiler"], ["con", "con"], ["con", "continue"], ["conf", "confirm"], ["cope", "copen"], ["cp", "cprevious"], ["cpf", "cpfile"], ["cq", "cquit"], ["cr", "crewind"], ["cs", "cs"], ["cscope", "cscope"], ["cstag", "cstag"], ["cuna", "cunabbrev"], ["cw", "cwindow"], ["d", "d"], ["d", "delete"], ["de", "de"], ["debug", "debug"], ["debugg", "debuggreedy"], ["del", "del"], ["delc", "delcommand"], ["delel", "delel"], ["delep", "delep"], ["deletel", "deletel"], ["deletep", "deletep"], ["deletl", "deletl"], ["deletp", "deletp"], ["delf", "delf"], ["delf", "delfunction"], ["dell", "dell"], ["delm", "delmarks"], ["delp", "delp"], ["dep", "dep"], ["di", "di"], ["di", "display"], ["diffg", "diffget"], ["diffo", "diffoff"], ["diffp", "diffpatch"], ["diffpu", "diffput"], ["diffs", "diffsplit"], ["difft", "diffthis"], ["diffu", "diffupdate"], ["dig", "dig"], ["dig", "digraphs"], ["dir", "dir"], ["dj", "djump"], ["dl", "dl"], ["dli", "dlist"], ["do", "do"], ["doau", "doau"], ["dp", "dp"], ["dr", "drop"], ["ds", "dsearch"], ["dsp", "dsplit"], ["e", "e"], ["e", "edit"], ["ea", "ea"], ["earlier", "earlier"], ["ec", "ec"], ["echoe", "echoerr"], ["echom", "echomsg"], ["echon", "echon"], ["el", "else"], ["elsei", "elseif"], ["em", "emenu"], ["en", "en"], ["en", "endif"], ["endf", "endf"], ["endf", "endfunction"], ["endfo", "endfor"], ["endfun", "endfun"], ["endt", "endtry"], ["endw", "endwhile"], ["ene", "enew"], ["ex", "ex"], ["exi", "exit"], ["exu", "exusage"], ["f", "f"], ["f", "file"], ["files", "files"], ["filet", "filet"], ["filetype", "filetype"], ["fin", "fin"], ["fin", "find"], ["fina", "finally"], ["fini", "finish"], ["fir", "first"], ["fix", "fixdel"], ["fo", "fold"], ["foldc", "foldclose"], ["foldd", "folddoopen"], ["folddoc", "folddoclosed"], ["foldo", "foldopen"], ["for", "for"], ["fu", "fu"], ["fu", "function"], ["fun", "fun"], ["g", "g"], ["go", "goto"], ["gr", "grep"], ["grepa", "grepadd"], ["gui", "gui"], ["gvim", "gvim"], ["h", "h"], ["h", "help"], ["ha", "hardcopy"], ["helpf", "helpfind"], ["helpg", "helpgrep"], ["helpt", "helptags"], ["hi", "hi"], ["hid", "hide"], ["his", "history"], ["i", "i"], ["ia", "ia"], ["iabc", "iabclear"], ["if", "if"], ["ij", "ijump"], ["il", "ilist"], ["imapc", "imapclear"], ["in", "in"], ["intro", "intro"], ["is", "isearch"], ["isp", "isplit"], ["iuna", "iunabbrev"], ["j", "join"], ["ju", "jumps"], ["k", "k"], ["kee", "keepmarks"], ["keepa", "keepa"], ["keepalt", "keepalt"], ["keepj", "keepjumps"], ["keepp", "keeppatterns"], ["l", "l"], ["l", "list"], ["lN", "lN"], ["lN", "lNext"], ["lNf", "lNf"], ["lNf", "lNfile"], ["la", "la"], ["la", "last"], ["lad", "lad"], ["lad", "laddexpr"], ["laddb", "laddbuffer"], ["laddf", "laddfile"], ["lan", "lan"], ["lan", "language"], ["lat", "lat"], ["later", "later"], ["lb", "lbuffer"], ["lc", "lcd"], ["lch", "lchdir"], ["lcl", "lclose"], ["lcs", "lcs"], ["lcscope", "lcscope"], ["le", "left"], ["lefta", "leftabove"], ["lex", "lexpr"], ["lf", "lfile"], ["lfir", "lfirst"], ["lg", "lgetfile"], ["lgetb", "lgetbuffer"], ["lgete", "lgetexpr"], ["lgr", "lgrep"], ["lgrepa", "lgrepadd"], ["lh", "lhelpgrep"], ["ll", "ll"], ["lla", "llast"], ["lli", "llist"], ["lmak", "lmake"], ["lmapc", "lmapclear"], ["lne", "lne"], ["lne", "lnext"], ["lnew", "lnewer"], ["lnf", "lnf"], ["lnf", "lnfile"], ["lo", "lo"], ["lo", "loadview"], ["loadk", "loadk"], ["loadkeymap", "loadkeymap"], ["loc", "lockmarks"], ["lockv", "lockvar"], ["lol", "lolder"], ["lop", "lopen"], ["lp", "lprevious"], ["lpf", "lpfile"], ["lr", "lrewind"], ["ls", "ls"], ["lt", "ltag"], ["lua", "lua"], ["luado", "luado"], ["luafile", "luafile"], ["lv", "lvimgrep"], ["lvimgrepa", "lvimgrepadd"], ["lw", "lwindow"], ["m", "move"], ["ma", "ma"], ["ma", "mark"], ["mak", "make"], ["marks", "marks"], ["mat", "match"], ["menut", "menut"], ["menut", "menutranslate"], ["mes", "mes"], ["messages", "messages"], ["mk", "mk"], ["mk", "mkexrc"], ["mks", "mksession"], ["mksp", "mkspell"], ["mkv", "mkv"], ["mkv", "mkvimrc"], ["mkvie", "mkview"], ["mo", "mo"], ["mod", "mode"], ["mz", "mz"], ["mz", "mzscheme"], ["mzf", "mzfile"], ["n", "n"], ["n", "next"], ["nb", "nbkey"], ["nbc", "nbclose"], ["nbs", "nbstart"], ["ne", "ne"], ["new", "new"], ["nmapc", "nmapclear"], ["noa", "noa"], ["noautocmd", "noautocmd"], ["noh", "nohlsearch"], ["nu", "number"], ["o", "o"], ["o", "open"], ["ol", "oldfiles"], ["omapc", "omapclear"], ["on", "only"], ["opt", "options"], ["ownsyntax", "ownsyntax"], ["p", "p"], ["p", "print"], ["pc", "pclose"], ["pe", "pe"], ["pe", "perl"], ["ped", "pedit"], ["perld", "perldo"], ["po", "pop"], ["popu", "popu"], ["popu", "popup"], ["pp", "ppop"], ["pr", "pr"], ["pre", "preserve"], ["prev", "previous"], ["pro", "pro"], ["prof", "profile"], ["profd", "profdel"], ["promptf", "promptfind"], ["promptr", "promptrepl"], ["ps", "psearch"], ["ptN", "ptN"], ["ptN", "ptNext"], ["pta", "ptag"], ["ptf", "ptfirst"], ["ptj", "ptjump"], ["ptl", "ptlast"], ["ptn", "ptn"], ["ptn", "ptnext"], ["ptp", "ptprevious"], ["ptr", "ptrewind"], ["pts", "ptselect"], ["pu", "put"], ["pw", "pwd"], ["py", "py"], ["py", "python"], ["py3", "py3"], ["py3", "py3"], ["py3do", "py3do"], ["pydo", "pydo"], ["pyf", "pyfile"], ["python3", "python3"], ["q", "q"], ["q", "quit"], ["qa", "qall"], ["quita", "quitall"], ["r", "r"], ["r", "read"], ["re", "re"], ["rec", "recover"], ["red", "red"], ["red", "redo"], ["redi", "redir"], ["redr", "redraw"], ["redraws", "redrawstatus"], ["reg", "registers"], ["res", "resize"], ["ret", "retab"], ["retu", "return"], ["rew", "rewind"], ["ri", "right"], ["rightb", "rightbelow"], ["ru", "ru"], ["ru", "runtime"], ["rub", "ruby"], ["rubyd", "rubydo"], ["rubyf", "rubyfile"], ["rundo", "rundo"], ["rv", "rviminfo"], ["sN", "sNext"], ["sa", "sargument"], ["sal", "sall"], ["san", "sandbox"], ["sav", "saveas"], ["sb", "sbuffer"], ["sbN", "sbNext"], ["sba", "sball"], ["sbf", "sbfirst"], ["sbl", "sblast"], ["sbm", "sbmodified"], ["sbn", "sbnext"], ["sbp", "sbprevious"], ["sbr", "sbrewind"], ["scrip", "scrip"], ["scrip", "scriptnames"], ["scripte", "scriptencoding"], ["scs", "scs"], ["scscope", "scscope"], ["se", "set"], ["setf", "setfiletype"], ["setg", "setglobal"], ["setl", "setlocal"], ["sf", "sfind"], ["sfir", "sfirst"], ["sh", "shell"], ["si", "si"], ["sig", "sig"], ["sign", "sign"], ["sil", "silent"], ["sim", "simalt"], ["sl", "sl"], ["sl", "sleep"], ["sla", "slast"], ["sm", "smagic"], ["sm", "smap"], ["sme", "sme"], ["smenu", "smenu"], ["sn", "snext"], ["sni", "sniff"], ["sno", "snomagic"], ["snoreme", "snoreme"], ["snoremenu", "snoremenu"], ["so", "so"], ["so", "source"], ["sor", "sort"], ["sp", "split"], ["spe", "spe"], ["spe", "spellgood"], ["spelld", "spelldump"], ["spelli", "spellinfo"], ["spellr", "spellrepall"], ["spellu", "spellundo"], ["spellw", "spellwrong"], ["spr", "sprevious"], ["sre", "srewind"], ["st", "st"], ["st", "stop"], ["sta", "stag"], ["star", "star"], ["star", "startinsert"], ["start", "start"], ["startg", "startgreplace"], ["startr", "startreplace"], ["stj", "stjump"], ["stopi", "stopinsert"], ["sts", "stselect"], ["sun", "sunhide"], ["sunme", "sunme"], ["sunmenu", "sunmenu"], ["sus", "suspend"], ["sv", "sview"], ["sw", "swapname"], ["sy", "sy"], ["syn", "syn"], ["sync", "sync"], ["syncbind", "syncbind"], ["syntime", "syntime"], ["t", "t"], ["tN", "tN"], ["tN", "tNext"], ["ta", "ta"], ["ta", "tag"], ["tab", "tab"], ["tabN", "tabN"], ["tabN", "tabNext"], ["tabc", "tabclose"], ["tabd", "tabdo"], ["tabe", "tabedit"], ["tabf", "tabfind"], ["tabfir", "tabfirst"], ["tabl", "tablast"], ["tabm", "tabmove"], ["tabn", "tabnext"], ["tabnew", "tabnew"], ["tabo", "tabonly"], ["tabp", "tabprevious"], ["tabr", "tabrewind"], ["tabs", "tabs"], ["tags", "tags"], ["tc", "tcl"], ["tcld", "tcldo"], ["tclf", "tclfile"], ["te", "tearoff"], ["tf", "tfirst"], ["th", "throw"], ["tj", "tjump"], ["tl", "tlast"], ["tm", "tm"], ["tm", "tmenu"], ["tn", "tn"], ["tn", "tnext"], ["to", "topleft"], ["tp", "tprevious"], ["tr", "tr"], ["tr", "trewind"], ["try", "try"], ["ts", "tselect"], ["tu", "tu"], ["tu", "tunmenu"], ["u", "u"], ["u", "undo"], ["un", "un"], ["una", "unabbreviate"], ["undoj", "undojoin"], ["undol", "undolist"], ["unh", "unhide"], ["unl", "unl"], ["unlo", "unlockvar"], ["uns", "unsilent"], ["up", "update"], ["v", "v"], ["ve", "ve"], ["ve", "version"], ["verb", "verbose"], ["vert", "vertical"], ["vi", "vi"], ["vi", "visual"], ["vie", "view"], ["vim", "vimgrep"], ["vimgrepa", "vimgrepadd"], ["viu", "viusage"], ["vmapc", "vmapclear"], ["vne", "vnew"], ["vs", "vsplit"], ["w", "w"], ["w", "write"], ["wN", "wNext"], ["wa", "wall"], ["wh", "while"], ["win", "win"], ["win", "winsize"], ["winc", "wincmd"], ["windo", "windo"], ["winp", "winpos"], ["wn", "wnext"], ["wp", "wprevious"], ["wq", "wq"], ["wqa", "wqall"], ["ws", "wsverb"], ["wundo", "wundo"], ["wv", "wviminfo"], ["x", "x"], ["x", "xit"], ["xa", "xall"], ["xmapc", "xmapclear"], ["xme", "xme"], ["xmenu", "xmenu"], ["xnoreme", "xnoreme"], ["xnoremenu", "xnoremenu"], ["xunme", "xunme"], ["xunmenu", "xunmenu"], ["xwininfo", "xwininfo"], ["y", "yank"]], :option=>[], :auto=>[["BufAdd", "BufAdd"], ["BufCreate", "BufCreate"], ["BufDelete", "BufDelete"], ["BufEnter", "BufEnter"], ["BufFilePost", "BufFilePost"], ["BufFilePre", "BufFilePre"], ["BufHidden", "BufHidden"], ["BufLeave", "BufLeave"], ["BufNew", "BufNew"], ["BufNewFile", "BufNewFile"], ["BufRead", "BufRead"], ["BufReadCmd", "BufReadCmd"], ["BufReadPost", "BufReadPost"], ["BufReadPre", "BufReadPre"], ["BufUnload", "BufUnload"], ["BufWinEnter", "BufWinEnter"], ["BufWinLeave", "BufWinLeave"], ["BufWipeout", "BufWipeout"], ["BufWrite", "BufWrite"], ["BufWriteCmd", "BufWriteCmd"], ["BufWritePost", "BufWritePost"], ["BufWritePre", "BufWritePre"], ["Cmd", "Cmd"], ["CmdwinEnter", "CmdwinEnter"], ["CmdwinLeave", "CmdwinLeave"], ["ColorScheme", "ColorScheme"], ["CompleteDone", "CompleteDone"], ["CursorHold", "CursorHold"], ["CursorHoldI", "CursorHoldI"], ["CursorMoved", "CursorMoved"], ["CursorMovedI", "CursorMovedI"], ["EncodingChanged", "EncodingChanged"], ["FileAppendCmd", "FileAppendCmd"], ["FileAppendPost", "FileAppendPost"], ["FileAppendPre", "FileAppendPre"], ["FileChangedRO", "FileChangedRO"], ["FileChangedShell", "FileChangedShell"], ["FileChangedShellPost", "FileChangedShellPost"], ["FileEncoding", "FileEncoding"], ["FileReadCmd", "FileReadCmd"], ["FileReadPost", "FileReadPost"], ["FileReadPre", "FileReadPre"], ["FileType", "FileType"], ["FileWriteCmd", "FileWriteCmd"], ["FileWritePost", "FileWritePost"], ["FileWritePre", "FileWritePre"], ["FilterReadPost", "FilterReadPost"], ["FilterReadPre", "FilterReadPre"], ["FilterWritePost", "FilterWritePost"], ["FilterWritePre", "FilterWritePre"], ["FocusGained", "FocusGained"], ["FocusLost", "FocusLost"], ["FuncUndefined", "FuncUndefined"], ["GUIEnter", "GUIEnter"], ["GUIFailed", "GUIFailed"], ["InsertChange", "InsertChange"], ["InsertCharPre", "InsertCharPre"], ["InsertEnter", "InsertEnter"], ["InsertLeave", "InsertLeave"], ["MenuPopup", "MenuPopup"], ["QuickFixCmdPost", "QuickFixCmdPost"], ["QuickFixCmdPre", "QuickFixCmdPre"], ["QuitPre", "QuitPre"], ["RemoteReply", "RemoteReply"], ["SessionLoadPost", "SessionLoadPost"], ["ShellCmdPost", "ShellCmdPost"], ["ShellFilterPost", "ShellFilterPost"], ["SourceCmd", "SourceCmd"], ["SourcePre", "SourcePre"], ["SpellFileMissing", "SpellFileMissing"], ["StdinReadPost", "StdinReadPost"], ["StdinReadPre", "StdinReadPre"], ["SwapExists", "SwapExists"], ["Syntax", "Syntax"], ["TabEnter", "TabEnter"], ["TabLeave", "TabLeave"], ["TermChanged", "TermChanged"], ["TermResponse", "TermResponse"], ["TextChanged", "TextChanged"], ["TextChangedI", "TextChangedI"], ["User", "User"], ["UserGettingBored", "UserGettingBored"], ["VimEnter", "VimEnter"], ["VimLeave", "VimLeave"], ["VimLeavePre", "VimLeavePre"], ["VimResized", "VimResized"], ["WinEnter", "WinEnter"], ["WinLeave", "WinLeave"], ["event", "event"]]}
8
+ @keywords ||= {:command=>[["a", "a"], ["abc", "abclear"], ["abo", "aboveleft"], ["al", "all"], ["ar", "args"], ["arga", "argadd"], ["argd", "argdelete"], ["argdo", "argdo"], ["arge", "argedit"], ["argg", "argglobal"], ["argl", "arglocal"], ["argu", "argument"], ["as", "ascii"], ["au", "au"], ["b", "buffer"], ["bN", "bNext"], ["ba", "ball"], ["bad", "badd"], ["bd", "bdelete"], ["bel", "belowright"], ["bf", "bfirst"], ["bl", "blast"], ["bm", "bmodified"], ["bn", "bnext"], ["bo", "botright"], ["bp", "bprevious"], ["br", "brewind"], ["brea", "break"], ["breaka", "breakadd"], ["breakd", "breakdel"], ["breakl", "breaklist"], ["bro", "browse"], ["bufdo", "bufdo"], ["buffers", "buffers"], ["bun", "bunload"], ["bw", "bwipeout"], ["c", "change"], ["cN", "cNext"], ["cNf", "cNfile"], ["cabc", "cabclear"], ["cad", "caddbuffer"], ["cadde", "caddexpr"], ["caddf", "caddfile"], ["cal", "call"], ["cat", "catch"], ["cb", "cbuffer"], ["cbo", "cbottom"], ["cc", "cc"], ["ccl", "cclose"], ["cd", "cd"], ["cdo", "cdo"], ["ce", "center"], ["cex", "cexpr"], ["cf", "cfile"], ["cfdo", "cfdo"], ["cfir", "cfirst"], ["cg", "cgetfile"], ["cgetb", "cgetbuffer"], ["cgete", "cgetexpr"], ["changes", "changes"], ["chd", "chdir"], ["che", "checkpath"], ["checkt", "checktime"], ["chi", "chistory"], ["cl", "clist"], ["cla", "clast"], ["cle", "clearjumps"], ["clo", "close"], ["cmapc", "cmapclear"], ["cn", "cnext"], ["cnew", "cnewer"], ["cnf", "cnfile"], ["co", "copy"], ["col", "colder"], ["colo", "colorscheme"], ["com", "com"], ["comc", "comclear"], ["comp", "compiler"], ["con", "continue"], ["conf", "confirm"], ["cope", "copen"], ["cp", "cprevious"], ["cpf", "cpfile"], ["cq", "cquit"], ["cr", "crewind"], ["cs", "cs"], ["cscope", "cscope"], ["cstag", "cstag"], ["cuna", "cunabbrev"], ["cw", "cwindow"], ["d", "delete"], ["debug", "debug"], ["debugg", "debuggreedy"], ["delc", "delcommand"], ["delel", "delel"], ["delep", "delep"], ["deletel", "deletel"], ["deletep", "deletep"], ["deletl", "deletl"], ["deletp", "deletp"], ["delf", "delfunction"], ["dell", "dell"], ["delm", "delmarks"], ["delp", "delp"], ["dep", "dep"], ["di", "display"], ["dif", "diffupdate"], ["diffg", "diffget"], ["diffo", "diffoff"], ["diffp", "diffpatch"], ["diffpu", "diffput"], ["diffs", "diffsplit"], ["difft", "diffthis"], ["dig", "digraphs"], ["dir", "dir"], ["dj", "djump"], ["dl", "dl"], ["dli", "dlist"], ["do", "do"], ["doau", "doau"], ["dp", "dp"], ["dr", "drop"], ["ds", "dsearch"], ["dsp", "dsplit"], ["e", "edit"], ["ea", "ea"], ["earlier", "earlier"], ["echoe", "echoerr"], ["echom", "echomsg"], ["echon", "echon"], ["el", "else"], ["elsei", "elseif"], ["em", "emenu"], ["en", "endif"], ["endf", "endfunction"], ["endfo", "endfor"], ["endt", "endtry"], ["endw", "endwhile"], ["ene", "enew"], ["ex", "ex"], ["exi", "exit"], ["exu", "exusage"], ["f", "file"], ["files", "files"], ["filet", "filet"], ["filetype", "filetype"], ["filt", "filter"], ["fin", "find"], ["fina", "finally"], ["fini", "finish"], ["fir", "first"], ["fix", "fixdel"], ["fo", "fold"], ["foldc", "foldclose"], ["foldd", "folddoopen"], ["folddoc", "folddoclosed"], ["foldo", "foldopen"], ["for", "for"], ["fu", "function"], ["g", "g"], ["go", "goto"], ["gr", "grep"], ["grepa", "grepadd"], ["gui", "gui"], ["gvim", "gvim"], ["h", "help"], ["ha", "hardcopy"], ["helpc", "helpclose"], ["helpf", "helpfind"], ["helpg", "helpgrep"], ["helpt", "helptags"], ["hi", "hi"], ["hid", "hide"], ["his", "history"], ["i", "i"], ["iabc", "iabclear"], ["if", "if"], ["ij", "ijump"], ["il", "ilist"], ["imapc", "imapclear"], ["in", "in"], ["intro", "intro"], ["is", "isearch"], ["isp", "isplit"], ["iuna", "iunabbrev"], ["j", "join"], ["ju", "jumps"], ["k", "k"], ["kee", "keepmarks"], ["keepa", "keepa"], ["keepalt", "keepalt"], ["keepj", "keepjumps"], ["keepp", "keeppatterns"], ["l", "list"], ["lN", "lNext"], ["lNf", "lNfile"], ["la", "last"], ["lad", "laddexpr"], ["laddb", "laddbuffer"], ["laddf", "laddfile"], ["lan", "language"], ["lat", "lat"], ["later", "later"], ["lb", "lbuffer"], ["lbo", "lbottom"], ["lc", "lcd"], ["lch", "lchdir"], ["lcl", "lclose"], ["lcs", "lcs"], ["lcscope", "lcscope"], ["ld", "ldo"], ["le", "left"], ["lefta", "leftabove"], ["lex", "lexpr"], ["lf", "lfile"], ["lfdo", "lfdo"], ["lfir", "lfirst"], ["lg", "lgetfile"], ["lgetb", "lgetbuffer"], ["lgete", "lgetexpr"], ["lgr", "lgrep"], ["lgrepa", "lgrepadd"], ["lh", "lhelpgrep"], ["lhi", "lhistory"], ["ll", "ll"], ["lla", "llast"], ["lli", "llist"], ["lmak", "lmake"], ["lmapc", "lmapclear"], ["lne", "lnext"], ["lnew", "lnewer"], ["lnf", "lnfile"], ["lo", "loadview"], ["loadk", "loadk"], ["loadkeymap", "loadkeymap"], ["loc", "lockmarks"], ["lockv", "lockvar"], ["lol", "lolder"], ["lop", "lopen"], ["lp", "lprevious"], ["lpf", "lpfile"], ["lr", "lrewind"], ["ls", "ls"], ["lt", "ltag"], ["lua", "lua"], ["luado", "luado"], ["luafile", "luafile"], ["lv", "lvimgrep"], ["lvimgrepa", "lvimgrepadd"], ["lw", "lwindow"], ["m", "move"], ["ma", "mark"], ["mak", "make"], ["marks", "marks"], ["mat", "match"], ["menut", "menutranslate"], ["mes", "mes"], ["messages", "messages"], ["mk", "mkexrc"], ["mks", "mksession"], ["mksp", "mkspell"], ["mkv", "mkvimrc"], ["mkvie", "mkview"], ["mod", "mode"], ["mz", "mzscheme"], ["mzf", "mzfile"], ["n", "next"], ["nb", "nbkey"], ["nbc", "nbclose"], ["nbs", "nbstart"], ["new", "new"], ["nmapc", "nmapclear"], ["noa", "noa"], ["noautocmd", "noautocmd"], ["noh", "nohlsearch"], ["nor", "nor"], ["nore", "nore"], ["nos", "noswapfile"], ["nu", "number"], ["o", "open"], ["ol", "oldfiles"], ["omapc", "omapclear"], ["on", "only"], ["opt", "options"], ["ownsyntax", "ownsyntax"], ["p", "print"], ["pa", "packadd"], ["packl", "packloadall"], ["pc", "pclose"], ["pe", "perl"], ["ped", "pedit"], ["perld", "perldo"], ["po", "pop"], ["popu", "popup"], ["pp", "ppop"], ["pre", "preserve"], ["prev", "previous"], ["pro", "pro"], ["prof", "profile"], ["profd", "profdel"], ["promptf", "promptfind"], ["promptr", "promptrepl"], ["ps", "psearch"], ["ptN", "ptNext"], ["pta", "ptag"], ["ptf", "ptfirst"], ["ptj", "ptjump"], ["ptl", "ptlast"], ["ptn", "ptnext"], ["ptp", "ptprevious"], ["ptr", "ptrewind"], ["pts", "ptselect"], ["pu", "put"], ["pw", "pwd"], ["py", "python"], ["py3", "py3"], ["py3", "py3"], ["py3do", "py3do"], ["pydo", "pydo"], ["pyf", "pyfile"], ["python3", "python3"], ["q", "quit"], ["qa", "qall"], ["quita", "quitall"], ["r", "read"], ["rec", "recover"], ["red", "redo"], ["redi", "redir"], ["redr", "redraw"], ["redraws", "redrawstatus"], ["reg", "registers"], ["res", "resize"], ["ret", "retab"], ["retu", "return"], ["rew", "rewind"], ["ri", "right"], ["rightb", "rightbelow"], ["ru", "runtime"], ["rub", "ruby"], ["rubyd", "rubydo"], ["rubyf", "rubyfile"], ["rundo", "rundo"], ["rv", "rviminfo"], ["sI", "sI"], ["sIc", "sIc"], ["sIe", "sIe"], ["sIg", "sIg"], ["sIl", "sIl"], ["sIn", "sIn"], ["sIp", "sIp"], ["sIr", "sIr"], ["sN", "sNext"], ["sa", "sargument"], ["sal", "sall"], ["san", "sandbox"], ["sav", "saveas"], ["sb", "sbuffer"], ["sbN", "sbNext"], ["sba", "sball"], ["sbf", "sbfirst"], ["sbl", "sblast"], ["sbm", "sbmodified"], ["sbn", "sbnext"], ["sbp", "sbprevious"], ["sbr", "sbrewind"], ["sc", "sc"], ["scI", "scI"], ["sce", "sce"], ["scg", "scg"], ["sci", "sci"], ["scl", "scl"], ["scp", "scp"], ["scr", "scriptnames"], ["scripte", "scriptencoding"], ["scs", "scs"], ["scscope", "scscope"], ["se", "set"], ["setf", "setfiletype"], ["setg", "setglobal"], ["setl", "setlocal"], ["sf", "sfind"], ["sfir", "sfirst"], ["sg", "sg"], ["sgI", "sgI"], ["sgc", "sgc"], ["sge", "sge"], ["sgi", "sgi"], ["sgl", "sgl"], ["sgn", "sgn"], ["sgp", "sgp"], ["sgr", "sgr"], ["sh", "shell"], ["si", "si"], ["sic", "sic"], ["sie", "sie"], ["sig", "sig"], ["sign", "sign"], ["sil", "silent"], ["sim", "simalt"], ["sin", "sin"], ["sip", "sip"], ["sir", "sir"], ["sl", "sleep"], ["sla", "slast"], ["sm", "smagic"], ["sm", "smap"], ["sme", "sme"], ["smenu", "smenu"], ["smile", "smile"], ["sn", "snext"], ["sno", "snomagic"], ["snoreme", "snoreme"], ["snoremenu", "snoremenu"], ["so", "source"], ["sor", "sort"], ["sp", "split"], ["spe", "spellgood"], ["spelld", "spelldump"], ["spelli", "spellinfo"], ["spellr", "spellrepall"], ["spellu", "spellundo"], ["spellw", "spellwrong"], ["spr", "sprevious"], ["sr", "sr"], ["srI", "srI"], ["src", "src"], ["sre", "srewind"], ["srg", "srg"], ["sri", "sri"], ["srl", "srl"], ["srn", "srn"], ["srp", "srp"], ["st", "stop"], ["sta", "stag"], ["star", "startinsert"], ["startg", "startgreplace"], ["startr", "startreplace"], ["stj", "stjump"], ["stopi", "stopinsert"], ["sts", "stselect"], ["sun", "sunhide"], ["sunme", "sunme"], ["sunmenu", "sunmenu"], ["sus", "suspend"], ["sv", "sview"], ["sw", "swapname"], ["sy", "sy"], ["syn", "syn"], ["sync", "sync"], ["syncbind", "syncbind"], ["syntime", "syntime"], ["t", "t"], ["tN", "tNext"], ["ta", "tag"], ["tab", "tab"], ["tabN", "tabNext"], ["tabc", "tabclose"], ["tabd", "tabdo"], ["tabe", "tabedit"], ["tabf", "tabfind"], ["tabfir", "tabfirst"], ["tabl", "tablast"], ["tabm", "tabmove"], ["tabn", "tabnext"], ["tabnew", "tabnew"], ["tabo", "tabonly"], ["tabp", "tabprevious"], ["tabr", "tabrewind"], ["tabs", "tabs"], ["tags", "tags"], ["tc", "tcl"], ["tcld", "tcldo"], ["tclf", "tclfile"], ["te", "tearoff"], ["tf", "tfirst"], ["th", "throw"], ["tj", "tjump"], ["tl", "tlast"], ["tm", "tmenu"], ["tn", "tnext"], ["to", "topleft"], ["tp", "tprevious"], ["tr", "trewind"], ["try", "try"], ["ts", "tselect"], ["tu", "tunmenu"], ["u", "undo"], ["una", "unabbreviate"], ["undoj", "undojoin"], ["undol", "undolist"], ["unh", "unhide"], ["unlo", "unlockvar"], ["uns", "unsilent"], ["up", "update"], ["v", "v"], ["ve", "version"], ["verb", "verbose"], ["vert", "vertical"], ["vi", "visual"], ["vie", "view"], ["vim", "vimgrep"], ["vimgrepa", "vimgrepadd"], ["viu", "viusage"], ["vmapc", "vmapclear"], ["vne", "vnew"], ["vs", "vsplit"], ["w", "write"], ["wN", "wNext"], ["wa", "wall"], ["wh", "while"], ["win", "winsize"], ["winc", "wincmd"], ["windo", "windo"], ["winp", "winpos"], ["wn", "wnext"], ["wp", "wprevious"], ["wq", "wq"], ["wqa", "wqall"], ["ws", "wsverb"], ["wundo", "wundo"], ["wv", "wviminfo"], ["x", "xit"], ["xa", "xall"], ["xmapc", "xmapclear"], ["xme", "xme"], ["xmenu", "xmenu"], ["xnoreme", "xnoreme"], ["xnoremenu", "xnoremenu"], ["xprop", "xprop"], ["xunme", "xunme"], ["xunmenu", "xunmenu"], ["xwininfo", "xwininfo"], ["y", "yank"]], :option=>[], :auto=>[["BufAdd", "BufAdd"], ["BufCreate", "BufCreate"], ["BufDelete", "BufDelete"], ["BufEnter", "BufEnter"], ["BufFilePost", "BufFilePost"], ["BufFilePre", "BufFilePre"], ["BufHidden", "BufHidden"], ["BufLeave", "BufLeave"], ["BufNew", "BufNew"], ["BufNewFile", "BufNewFile"], ["BufRead", "BufRead"], ["BufReadCmd", "BufReadCmd"], ["BufReadPost", "BufReadPost"], ["BufReadPre", "BufReadPre"], ["BufUnload", "BufUnload"], ["BufWinEnter", "BufWinEnter"], ["BufWinLeave", "BufWinLeave"], ["BufWipeout", "BufWipeout"], ["BufWrite", "BufWrite"], ["BufWriteCmd", "BufWriteCmd"], ["BufWritePost", "BufWritePost"], ["BufWritePre", "BufWritePre"], ["CmdUndefined", "CmdUndefined"], ["CmdwinEnter", "CmdwinEnter"], ["CmdwinLeave", "CmdwinLeave"], ["ColorScheme", "ColorScheme"], ["CompleteDone", "CompleteDone"], ["CursorHold", "CursorHold"], ["CursorHoldI", "CursorHoldI"], ["CursorMoved", "CursorMoved"], ["CursorMovedI", "CursorMovedI"], ["EncodingChanged", "EncodingChanged"], ["FileAppendCmd", "FileAppendCmd"], ["FileAppendPost", "FileAppendPost"], ["FileAppendPre", "FileAppendPre"], ["FileChangedRO", "FileChangedRO"], ["FileChangedShell", "FileChangedShell"], ["FileChangedShellPost", "FileChangedShellPost"], ["FileEncoding", "FileEncoding"], ["FileReadCmd", "FileReadCmd"], ["FileReadPost", "FileReadPost"], ["FileReadPre", "FileReadPre"], ["FileType", "FileType"], ["FileWriteCmd", "FileWriteCmd"], ["FileWritePost", "FileWritePost"], ["FileWritePre", "FileWritePre"], ["FilterReadPost", "FilterReadPost"], ["FilterReadPre", "FilterReadPre"], ["FilterWritePost", "FilterWritePost"], ["FilterWritePre", "FilterWritePre"], ["FocusGained", "FocusGained"], ["FocusLost", "FocusLost"], ["FuncUndefined", "FuncUndefined"], ["GUIEnter", "GUIEnter"], ["GUIFailed", "GUIFailed"], ["InsertChange", "InsertChange"], ["InsertCharPre", "InsertCharPre"], ["InsertEnter", "InsertEnter"], ["InsertLeave", "InsertLeave"], ["MenuPopup", "MenuPopup"], ["OptionSet", "OptionSet"], ["QuickFixCmdPost", "QuickFixCmdPost"], ["QuickFixCmdPre", "QuickFixCmdPre"], ["QuitPre", "QuitPre"], ["RemoteReply", "RemoteReply"], ["SessionLoadPost", "SessionLoadPost"], ["ShellCmdPost", "ShellCmdPost"], ["ShellFilterPost", "ShellFilterPost"], ["SourceCmd", "SourceCmd"], ["SourcePre", "SourcePre"], ["SpellFileMissing", "SpellFileMissing"], ["StdinReadPost", "StdinReadPost"], ["StdinReadPre", "StdinReadPre"], ["SwapExists", "SwapExists"], ["Syntax", "Syntax"], ["TabClosed", "TabClosed"], ["TabEnter", "TabEnter"], ["TabLeave", "TabLeave"], ["TabNew", "TabNew"], ["TermChanged", "TermChanged"], ["TermResponse", "TermResponse"], ["TextChanged", "TextChanged"], ["TextChangedI", "TextChangedI"], ["User", "User"], ["VimEnter", "VimEnter"], ["VimLeave", "VimLeave"], ["VimLeavePre", "VimLeavePre"], ["VimResized", "VimResized"], ["WinEnter", "WinEnter"], ["WinLeave", "WinLeave"], ["WinNew", "WinNew"]]}
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -0,0 +1,107 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Lexers
5
+ class Wollok < RegexLexer
6
+ title 'Wollok'
7
+ desc 'Wollok lang'
8
+ tag 'wollok'
9
+ filenames *%w(*.wlk *.wtest *.wpgm)
10
+
11
+ def self.analyze_text(_text)
12
+ 0.3
13
+ end
14
+
15
+ keywords = %w(new super return if else var const override constructor)
16
+
17
+ entity_name = /[a-zA-Z][a-zA-Z0-9]*/
18
+ variable_naming = /_?#{entity_name}/
19
+
20
+ entities = []
21
+
22
+ state :whitespaces_and_comments do
23
+ rule /\s+/m, Text::Whitespace
24
+ rule /$+/m, Text::Whitespace
25
+ rule %r(//.*$), Comment::Single
26
+ rule %r(/\*(.|\s)*?\*/)m, Comment::Multiline
27
+ end
28
+
29
+ state :root do
30
+ mixin :whitespaces_and_comments
31
+ rule /(import)(.+$)/ do
32
+ groups Keyword::Reserved, Text
33
+ end
34
+ rule /(class|object|mixin)/, Keyword::Reserved, :foo
35
+ rule /test|program/, Keyword::Reserved #, :chunk_naming
36
+ rule /(package)(\s+)(#{entity_name})/ do
37
+ groups Keyword::Reserved, Text::Whitespace, Name::Class
38
+ end
39
+ rule /{|}/, Text
40
+ mixin :keywords
41
+ mixin :symbols
42
+ mixin :objects
43
+ end
44
+
45
+ state :foo do
46
+ mixin :whitespaces_and_comments
47
+ rule /inherits|mixed|with|and/, Keyword::Reserved
48
+ rule /#{entity_name}(?=\s*{)/ do |m|
49
+ token Name::Class
50
+ entities << m[0]
51
+ pop!
52
+ end
53
+ rule /#{entity_name}/ do |m|
54
+ token Name::Class
55
+ entities << m[0]
56
+ end
57
+ end
58
+
59
+ state :keywords do
60
+ def any(expressions)
61
+ /#{expressions.map { |keyword| "#{keyword}\\b" }.join('|')}/
62
+ end
63
+
64
+ rule /self\b/, Name::Builtin::Pseudo
65
+ rule any(keywords), Keyword::Reserved
66
+ rule /(method)(\s+)(#{variable_naming})/ do
67
+ groups Keyword::Reserved, Text::Whitespace, Text
68
+ end
69
+ end
70
+
71
+ state :objects do
72
+ rule variable_naming do |m|
73
+ variable = m[0]
74
+ if entities.include?(variable) || ('A'..'Z').include?(variable[0])
75
+ token Name::Class
76
+ else
77
+ token Keyword::Variable
78
+ end
79
+ end
80
+ rule /\.#{entity_name}/, Text
81
+ mixin :literals
82
+ end
83
+
84
+ state :literals do
85
+ mixin :whitespaces_and_comments
86
+ rule /[0-9]+\.?[0-9]*/, Literal::Number
87
+ rule /"[^"]*"/m, Literal::String
88
+ rule /\[|\#{/, Punctuation, :lists
89
+ end
90
+
91
+ state :lists do
92
+ rule /,/, Punctuation
93
+ rule /]|}/, Punctuation, :pop!
94
+ mixin :objects
95
+ end
96
+
97
+ state :symbols do
98
+ rule /\+\+|--|\+=|-=|\*\*|!/, Operator
99
+ rule /\+|-|\*|\/|%/, Operator
100
+ rule /<=|=>|===|==|<|>/, Operator
101
+ rule /and\b|or\b|not\b/, Operator
102
+ rule /\(|\)|=/, Text
103
+ rule /,/, Punctuation
104
+ end
105
+ end
106
+ end
107
+ end
@@ -52,7 +52,7 @@ module Rouge
52
52
 
53
53
  state :attr do
54
54
  rule /\s+/m, Text
55
- rule /".*?"|'.*?'|[^\s>]+/, Str, :pop!
55
+ rule /".*?"|'.*?'|[^\s>]+/m, Str, :pop!
56
56
  end
57
57
  end
58
58
  end
@@ -8,13 +8,15 @@ module Rouge
8
8
  mimetypes 'text/x-yaml'
9
9
  tag 'yaml'
10
10
  aliases 'yml'
11
+ filenames '*.yaml', '*.yml'
11
12
 
12
13
  def self.analyze_text(text)
13
14
  # look for the %YAML directive
14
15
  return 1 if text =~ /\A\s*%YAML/m
15
16
  end
16
17
 
17
- filenames '*.yaml', '*.yml'
18
+ SPECIAL_VALUES = Regexp.union(%w(true false null))
19
+
18
20
  # NB: Tabs are forbidden in YAML, which is why you see things
19
21
  # like /[ ]+/.
20
22
 
@@ -335,6 +337,7 @@ module Rouge
335
337
  end
336
338
 
337
339
  rule /[ ]+/, Str
340
+ rule SPECIAL_VALUES, Name::Constant
338
341
  # regular non-whitespace characters
339
342
  rule /[^\s:]+/, Str
340
343
  end
@@ -233,6 +233,7 @@ module Rouge
233
233
  @stack = nil
234
234
  @current_stream = nil
235
235
 
236
+ puts "start blocks" if @debug && self.class.start_procs.any?
236
237
  self.class.start_procs.each do |pr|
237
238
  instance_eval(&pr)
238
239
  end
@@ -10,13 +10,11 @@ module Rouge
10
10
  # the parent lexer - the one being templated.
11
11
  def parent
12
12
  return @parent if instance_variable_defined? :@parent
13
- @parent = option(:parent) || 'html'
14
- if @parent.is_a? ::String
15
- lexer_class = Lexer.find(@parent)
16
- @parent = lexer_class.new(self.options)
17
- end
13
+ @parent = lexer_option(:parent) || Lexers::HTML.new(@options)
18
14
  end
19
15
 
16
+ option :parent, "the parent language (default: html)"
17
+
20
18
  start { parent.reset! }
21
19
  end
22
20
  end
data/lib/rouge/theme.rb CHANGED
@@ -111,7 +111,11 @@ module Rouge
111
111
  return @name if n.nil?
112
112
 
113
113
  @name = n.to_s
114
- Theme.registry[@name] = self
114
+ register(@name)
115
+ end
116
+
117
+ def register(name)
118
+ Theme.registry[name.to_s] = self
115
119
  end
116
120
 
117
121
  def find(n)
@@ -136,12 +140,18 @@ module Rouge
136
140
  return self if self.mode == mode
137
141
 
138
142
  new_name = "#{self.name}.#{mode}"
139
- Class.new(self) { name(new_name); mode!(mode) }
143
+ Class.new(self) { name(new_name); set_mode!(mode) }
144
+ end
145
+
146
+ def set_mode!(mode)
147
+ @mode = mode
148
+ send("make_#{mode}!")
140
149
  end
141
150
 
142
151
  def mode!(arg)
143
- @mode = arg
144
- send("make_#{arg}!")
152
+ alt_name = "#{self.name}.#{arg}"
153
+ register(alt_name)
154
+ set_mode!(arg)
145
155
  end
146
156
  end
147
157
 
@@ -0,0 +1,20 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Themes
5
+ class IgorPro < CSSTheme
6
+ name 'igorpro'
7
+
8
+ style Text, :fg => '#444444'
9
+ style Comment::Preproc, :fg => '#CC00A3'
10
+ style Comment::Special, :fg => '#CC00A3'
11
+ style Comment, :fg => '#FF0000'
12
+ style Keyword::Constant, :fg => '#C34E00'
13
+ style Keyword::Declaration, :fg => '#0000FF'
14
+ style Keyword::Reserved, :fg => '#007575'
15
+ style Keyword, :fg => '#0000FF'
16
+ style Literal::String, :fg => '#009C00'
17
+ style Name::Builtin, :fg => '#C34E00'
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,69 @@
1
+ # -*- coding: utf-8 -*- #
2
+
3
+ module Rouge
4
+ module Themes
5
+ # A port of the pastie style from Pygments.
6
+ # See https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/pastie.py
7
+ class Pastie < CSSTheme
8
+ name 'pastie'
9
+
10
+ style Comment, :fg => '#888888'
11
+ style Comment::Preproc, :fg => '#cc0000', :bold => true
12
+ style Comment::Special, :fg => '#cc0000', :bg => '#fff0f0', :bold => true
13
+
14
+ style Error, :fg => '#a61717', :bg => '#e3d2d2'
15
+ style Generic::Error, :fg => '#aa0000'
16
+
17
+ style Generic::Heading, :fg => '#333333'
18
+ style Generic::Subheading, :fg => '#666666'
19
+
20
+ style Generic::Deleted, :fg => '#000000', :bg => '#ffdddd'
21
+ style Generic::Inserted, :fg => '#000000', :bg => '#ddffdd'
22
+
23
+ style Generic::Emph, :italic => true
24
+ style Generic::Strong, :bold => true
25
+
26
+ style Generic::Lineno, :fg => '#888888'
27
+ style Generic::Output, :fg => '#888888'
28
+ style Generic::Prompt, :fg => '#555555'
29
+ style Generic::Traceback, :fg => '#aa0000'
30
+
31
+ style Keyword, :fg => '#008800', :bold => true
32
+ style Keyword::Pseudo, :fg => '#008800'
33
+ style Keyword::Type, :fg => '#888888', :bold => true
34
+
35
+ style Num, :fg => '#0000dd', :bold => true
36
+
37
+ style Str, :fg => '#dd2200', :bg => '#fff0f0'
38
+ style Str::Escape, :fg => '#0044dd', :bg => '#fff0f0'
39
+ style Str::Interpol, :fg => '#3333bb', :bg => '#fff0f0'
40
+ style Str::Other, :fg => '#22bb22', :bg => '#f0fff0'
41
+ #style Str::Regex, :fg => '#008800', :bg => '#fff0ff'
42
+ # The background color on regex really doesn't look good, so let's drop it
43
+ style Str::Regex, :fg => '#008800'
44
+ style Str::Symbol, :fg => '#aa6600', :bg => '#fff0f0'
45
+
46
+ style Name::Attribute, :fg => '#336699'
47
+ style Name::Builtin, :fg => '#003388'
48
+ style Name::Class, :fg => '#bb0066', :bold => true
49
+ style Name::Constant, :fg => '#003366', :bold => true
50
+ style Name::Decorator, :fg => '#555555'
51
+ style Name::Exception, :fg => '#bb0066', :bold => true
52
+ style Name::Function, :fg => '#0066bb', :bold => true
53
+ #style Name::Label, :fg => '#336699', :italic => true
54
+ # Name::Label is used for built-in CSS properties in Rouge, so let's drop italics
55
+ style Name::Label, :fg => '#336699'
56
+ style Name::Namespace, :fg => '#bb0066', :bold => true
57
+ style Name::Property, :fg => '#336699', :bold => true
58
+ style Name::Tag, :fg => '#bb0066', :bold => true
59
+ style Name::Variable, :fg => '#336699'
60
+ style Name::Variable::Global, :fg => '#dd7700'
61
+ style Name::Variable::Instance, :fg => '#3333bb'
62
+
63
+ style Operator::Word, :fg => '#008800'
64
+
65
+ style Text, {}
66
+ style Text::Whitespace, :fg => '#bbbbbb'
67
+ end
68
+ end
69
+ end
@@ -25,13 +25,15 @@ module Rouge
25
25
  style Text, :fg => :unicorn, :bg => :krasna
26
26
  style Generic::Lineno, :fg => :eggshell_cloud, :bg => :slate_blue
27
27
 
28
+ style Generic::Prompt, :fg => :chilly, :bold => true
29
+
28
30
  style Comment, :fg => :cool_as_ice, :italic => true
29
31
  style Comment::Preproc, :fg => :go_get_it, :bold => true, :italic => true
30
- style Error,
31
- Generic::Error, :fg => :aluminum1, :bg => :scarletred2
32
+ style Error, :fg => :aluminum1, :bg => :scarletred2
33
+ style Generic::Error, :fg => :scarletred2, :italic => true, :bold => true
32
34
  style Keyword, :fg => :sandy, :bold => true
33
- style Operator,
34
- Punctuation, :fg => :backlit
35
+ style Operator, :fg => :backlit, :bold => true
36
+ style Punctuation, :fg => :backlit
35
37
  style Generic::Deleted, :fg => :scarletred2
36
38
  style Generic::Inserted, :fg => :go_get_it
37
39
  style Generic::Emph, :italic => true
@@ -61,7 +63,8 @@ module Rouge
61
63
  Literal::String::Interpol, :fg => :backlit, :bold => true
62
64
  style Name::Builtin, :bold => true
63
65
  style Name::Entity, :fg => '#999999', :bold => true
64
- style Text::Whitespace, :fg => '#BBBBBB'
66
+ style Text::Whitespace,
67
+ Generic::Output, :fg => '#BBBBBB'
65
68
  style Name::Function,
66
69
  Name::Property,
67
70
  Name::Attribute, :fg => :chilly
data/lib/rouge/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rouge
4
4
  def self.version
5
- "2.0.7"
5
+ "2.1.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeanine Adkisson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2017-06-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
14
14
  email:
@@ -28,6 +28,7 @@ files:
28
28
  - lib/rouge/demos/apache
29
29
  - lib/rouge/demos/apiblueprint
30
30
  - lib/rouge/demos/applescript
31
+ - lib/rouge/demos/awk
31
32
  - lib/rouge/demos/biml
32
33
  - lib/rouge/demos/bsl
33
34
  - lib/rouge/demos/c
@@ -38,6 +39,7 @@ files:
38
39
  - lib/rouge/demos/coffeescript
39
40
  - lib/rouge/demos/common_lisp
40
41
  - lib/rouge/demos/conf
42
+ - lib/rouge/demos/console
41
43
  - lib/rouge/demos/coq
42
44
  - lib/rouge/demos/cpp
43
45
  - lib/rouge/demos/csharp
@@ -45,7 +47,9 @@ files:
45
47
  - lib/rouge/demos/d
46
48
  - lib/rouge/demos/dart
47
49
  - lib/rouge/demos/diff
50
+ - lib/rouge/demos/digdag
48
51
  - lib/rouge/demos/docker
52
+ - lib/rouge/demos/dot
49
53
  - lib/rouge/demos/eiffel
50
54
  - lib/rouge/demos/elixir
51
55
  - lib/rouge/demos/erb
@@ -57,15 +61,20 @@ files:
57
61
  - lib/rouge/demos/glsl
58
62
  - lib/rouge/demos/go
59
63
  - lib/rouge/demos/gradle
64
+ - lib/rouge/demos/graphql
60
65
  - lib/rouge/demos/groovy
61
66
  - lib/rouge/demos/haml
62
67
  - lib/rouge/demos/handlebars
63
68
  - lib/rouge/demos/haskell
64
69
  - lib/rouge/demos/html
65
70
  - lib/rouge/demos/http
71
+ - lib/rouge/demos/hylang
66
72
  - lib/rouge/demos/idlang
73
+ - lib/rouge/demos/igorpro
67
74
  - lib/rouge/demos/ini
68
75
  - lib/rouge/demos/io
76
+ - lib/rouge/demos/irb
77
+ - lib/rouge/demos/irb_output
69
78
  - lib/rouge/demos/java
70
79
  - lib/rouge/demos/javascript
71
80
  - lib/rouge/demos/jinja
@@ -75,6 +84,7 @@ files:
75
84
  - lib/rouge/demos/jsx
76
85
  - lib/rouge/demos/julia
77
86
  - lib/rouge/demos/kotlin
87
+ - lib/rouge/demos/lasso
78
88
  - lib/rouge/demos/liquid
79
89
  - lib/rouge/demos/literate_coffeescript
80
90
  - lib/rouge/demos/literate_haskell
@@ -84,6 +94,7 @@ files:
84
94
  - lib/rouge/demos/markdown
85
95
  - lib/rouge/demos/matlab
86
96
  - lib/rouge/demos/moonscript
97
+ - lib/rouge/demos/mosel
87
98
  - lib/rouge/demos/mxml
88
99
  - lib/rouge/demos/nasm
89
100
  - lib/rouge/demos/nginx
@@ -94,6 +105,8 @@ files:
94
105
  - lib/rouge/demos/perl
95
106
  - lib/rouge/demos/php
96
107
  - lib/rouge/demos/plaintext
108
+ - lib/rouge/demos/plist
109
+ - lib/rouge/demos/pony
97
110
  - lib/rouge/demos/powershell
98
111
  - lib/rouge/demos/praat
99
112
  - lib/rouge/demos/prolog
@@ -102,6 +115,7 @@ files:
102
115
  - lib/rouge/demos/protobuf
103
116
  - lib/rouge/demos/puppet
104
117
  - lib/rouge/demos/python
118
+ - lib/rouge/demos/q
105
119
  - lib/rouge/demos/qml
106
120
  - lib/rouge/demos/r
107
121
  - lib/rouge/demos/racket
@@ -113,7 +127,7 @@ files:
113
127
  - lib/rouge/demos/scss
114
128
  - lib/rouge/demos/sed
115
129
  - lib/rouge/demos/shell
116
- - lib/rouge/demos/shell_session
130
+ - lib/rouge/demos/sieve
117
131
  - lib/rouge/demos/slim
118
132
  - lib/rouge/demos/smalltalk
119
133
  - lib/rouge/demos/smarty
@@ -124,6 +138,7 @@ files:
124
138
  - lib/rouge/demos/tcl
125
139
  - lib/rouge/demos/tex
126
140
  - lib/rouge/demos/toml
141
+ - lib/rouge/demos/tsx
127
142
  - lib/rouge/demos/tulip
128
143
  - lib/rouge/demos/turtle
129
144
  - lib/rouge/demos/twig
@@ -134,6 +149,7 @@ files:
134
149
  - lib/rouge/demos/vhdl
135
150
  - lib/rouge/demos/viml
136
151
  - lib/rouge/demos/vue
152
+ - lib/rouge/demos/wollok
137
153
  - lib/rouge/demos/xml
138
154
  - lib/rouge/demos/yaml
139
155
  - lib/rouge/formatter.rb
@@ -158,6 +174,7 @@ files:
158
174
  - lib/rouge/lexers/apache/keywords.yml
159
175
  - lib/rouge/lexers/apiblueprint.rb
160
176
  - lib/rouge/lexers/apple_script.rb
177
+ - lib/rouge/lexers/awk.rb
161
178
  - lib/rouge/lexers/biml.rb
162
179
  - lib/rouge/lexers/bsl.rb
163
180
  - lib/rouge/lexers/c.rb
@@ -168,6 +185,7 @@ files:
168
185
  - lib/rouge/lexers/coffeescript.rb
169
186
  - lib/rouge/lexers/common_lisp.rb
170
187
  - lib/rouge/lexers/conf.rb
188
+ - lib/rouge/lexers/console.rb
171
189
  - lib/rouge/lexers/coq.rb
172
190
  - lib/rouge/lexers/cpp.rb
173
191
  - lib/rouge/lexers/csharp.rb
@@ -175,7 +193,9 @@ files:
175
193
  - lib/rouge/lexers/d.rb
176
194
  - lib/rouge/lexers/dart.rb
177
195
  - lib/rouge/lexers/diff.rb
196
+ - lib/rouge/lexers/digdag.rb
178
197
  - lib/rouge/lexers/docker.rb
198
+ - lib/rouge/lexers/dot.rb
179
199
  - lib/rouge/lexers/eiffel.rb
180
200
  - lib/rouge/lexers/elixir.rb
181
201
  - lib/rouge/lexers/erb.rb
@@ -188,15 +208,19 @@ files:
188
208
  - lib/rouge/lexers/glsl.rb
189
209
  - lib/rouge/lexers/go.rb
190
210
  - lib/rouge/lexers/gradle.rb
211
+ - lib/rouge/lexers/graphql.rb
191
212
  - lib/rouge/lexers/groovy.rb
192
213
  - lib/rouge/lexers/haml.rb
193
214
  - lib/rouge/lexers/handlebars.rb
194
215
  - lib/rouge/lexers/haskell.rb
195
216
  - lib/rouge/lexers/html.rb
196
217
  - lib/rouge/lexers/http.rb
218
+ - lib/rouge/lexers/hylang.rb
197
219
  - lib/rouge/lexers/idlang.rb
220
+ - lib/rouge/lexers/igorpro.rb
198
221
  - lib/rouge/lexers/ini.rb
199
222
  - lib/rouge/lexers/io.rb
223
+ - lib/rouge/lexers/irb.rb
200
224
  - lib/rouge/lexers/java.rb
201
225
  - lib/rouge/lexers/javascript.rb
202
226
  - lib/rouge/lexers/jinja.rb
@@ -206,6 +230,8 @@ files:
206
230
  - lib/rouge/lexers/jsx.rb
207
231
  - lib/rouge/lexers/julia.rb
208
232
  - lib/rouge/lexers/kotlin.rb
233
+ - lib/rouge/lexers/lasso.rb
234
+ - lib/rouge/lexers/lasso/keywords.yml
209
235
  - lib/rouge/lexers/liquid.rb
210
236
  - lib/rouge/lexers/literate_coffeescript.rb
211
237
  - lib/rouge/lexers/literate_haskell.rb
@@ -217,6 +243,7 @@ files:
217
243
  - lib/rouge/lexers/matlab.rb
218
244
  - lib/rouge/lexers/matlab/builtins.rb
219
245
  - lib/rouge/lexers/moonscript.rb
246
+ - lib/rouge/lexers/mosel.rb
220
247
  - lib/rouge/lexers/mxml.rb
221
248
  - lib/rouge/lexers/nasm.rb
222
249
  - lib/rouge/lexers/nginx.rb
@@ -228,6 +255,8 @@ files:
228
255
  - lib/rouge/lexers/php.rb
229
256
  - lib/rouge/lexers/php/builtins.rb
230
257
  - lib/rouge/lexers/plain_text.rb
258
+ - lib/rouge/lexers/plist.rb
259
+ - lib/rouge/lexers/pony.rb
231
260
  - lib/rouge/lexers/powershell.rb
232
261
  - lib/rouge/lexers/praat.rb
233
262
  - lib/rouge/lexers/prolog.rb
@@ -236,6 +265,7 @@ files:
236
265
  - lib/rouge/lexers/protobuf.rb
237
266
  - lib/rouge/lexers/puppet.rb
238
267
  - lib/rouge/lexers/python.rb
268
+ - lib/rouge/lexers/q.rb
239
269
  - lib/rouge/lexers/qml.rb
240
270
  - lib/rouge/lexers/r.rb
241
271
  - lib/rouge/lexers/racket.rb
@@ -248,7 +278,7 @@ files:
248
278
  - lib/rouge/lexers/scss.rb
249
279
  - lib/rouge/lexers/sed.rb
250
280
  - lib/rouge/lexers/shell.rb
251
- - lib/rouge/lexers/shell_session.rb
281
+ - lib/rouge/lexers/sieve.rb
252
282
  - lib/rouge/lexers/slim.rb
253
283
  - lib/rouge/lexers/smalltalk.rb
254
284
  - lib/rouge/lexers/smarty.rb
@@ -259,10 +289,12 @@ files:
259
289
  - lib/rouge/lexers/tcl.rb
260
290
  - lib/rouge/lexers/tex.rb
261
291
  - lib/rouge/lexers/toml.rb
292
+ - lib/rouge/lexers/tsx.rb
262
293
  - lib/rouge/lexers/tulip.rb
263
294
  - lib/rouge/lexers/turtle.rb
264
295
  - lib/rouge/lexers/twig.rb
265
296
  - lib/rouge/lexers/typescript.rb
297
+ - lib/rouge/lexers/typescript/common.rb
266
298
  - lib/rouge/lexers/vala.rb
267
299
  - lib/rouge/lexers/vb.rb
268
300
  - lib/rouge/lexers/verilog.rb
@@ -270,6 +302,7 @@ files:
270
302
  - lib/rouge/lexers/viml.rb
271
303
  - lib/rouge/lexers/viml/keywords.rb
272
304
  - lib/rouge/lexers/vue.rb
305
+ - lib/rouge/lexers/wollok.rb
273
306
  - lib/rouge/lexers/xml.rb
274
307
  - lib/rouge/lexers/yaml.rb
275
308
  - lib/rouge/plugins/redcarpet.rb
@@ -281,9 +314,11 @@ files:
281
314
  - lib/rouge/themes/colorful.rb
282
315
  - lib/rouge/themes/github.rb
283
316
  - lib/rouge/themes/gruvbox.rb
317
+ - lib/rouge/themes/igor_pro.rb
284
318
  - lib/rouge/themes/molokai.rb
285
319
  - lib/rouge/themes/monokai.rb
286
320
  - lib/rouge/themes/monokai_sublime.rb
321
+ - lib/rouge/themes/pastie.rb
287
322
  - lib/rouge/themes/thankful_eyes.rb
288
323
  - lib/rouge/themes/tulip.rb
289
324
  - lib/rouge/token.rb
@@ -310,9 +345,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
345
  version: '0'
311
346
  requirements: []
312
347
  rubyforge_project: rouge
313
- rubygems_version: 2.5.1
348
+ rubygems_version: 2.6.11
314
349
  signing_key:
315
350
  specification_version: 4
316
351
  summary: A pure-ruby colorizer based on pygments
317
352
  test_files: []
318
- has_rdoc: