ace-rails-ap 4.2 → 4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ace/rails/version.rb +1 -1
- data/update.sh +1 -1
- data/vendor/assets/javascripts/ace/ace.js +661 -160
- data/vendor/assets/javascripts/ace/ext-beautify.js +1 -0
- data/vendor/assets/javascripts/ace/ext-emmet.js +314 -218
- data/vendor/assets/javascripts/ace/ext-keybinding_menu.js +37 -32
- data/vendor/assets/javascripts/ace/ext-language_tools.js +362 -225
- data/vendor/assets/javascripts/ace/ext-linking.js +1 -1
- data/vendor/assets/javascripts/ace/ext-modelist.js +6 -2
- data/vendor/assets/javascripts/ace/ext-options.js +45 -34
- data/vendor/assets/javascripts/ace/ext-prompt.js +2764 -0
- data/vendor/assets/javascripts/ace/ext-rtl.js +1 -3
- data/vendor/assets/javascripts/ace/ext-settings_menu.js +49 -38
- data/vendor/assets/javascripts/ace/ext-statusbar.js +2 -2
- data/vendor/assets/javascripts/ace/ext-whitespace.js +4 -0
- data/vendor/assets/javascripts/ace/keybinding-emacs.js +1 -0
- data/vendor/assets/javascripts/ace/keybinding-vim.js +296 -66
- data/vendor/assets/javascripts/ace/mode-aql.js +102 -0
- data/vendor/assets/javascripts/ace/mode-autohotkey.js +3 -1
- data/vendor/assets/javascripts/ace/mode-cirru.js +2 -2
- data/vendor/assets/javascripts/ace/mode-crystal.js +642 -0
- data/vendor/assets/javascripts/ace/mode-csound_document.js +42 -29
- data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +35 -25
- data/vendor/assets/javascripts/ace/mode-csound_score.js +29 -21
- data/vendor/assets/javascripts/ace/mode-fsharp.js +2 -2
- data/vendor/assets/javascripts/ace/mode-gherkin.js +0 -2
- data/vendor/assets/javascripts/ace/mode-gobstones.js +252 -94
- data/vendor/assets/javascripts/ace/mode-io.js +1 -7
- data/vendor/assets/javascripts/ace/mode-jade.js +1 -1
- data/vendor/assets/javascripts/ace/mode-lua.js +30 -10
- data/vendor/assets/javascripts/ace/mode-luapage.js +30 -10
- data/vendor/assets/javascripts/ace/mode-lucene.js +77 -9
- data/vendor/assets/javascripts/ace/mode-markdown.js +2 -1
- data/vendor/assets/javascripts/ace/mode-mask.js +1 -1
- data/vendor/assets/javascripts/ace/mode-nginx.js +298 -0
- data/vendor/assets/javascripts/ace/mode-nim.js +363 -0
- data/vendor/assets/javascripts/ace/mode-pascal.js +84 -66
- data/vendor/assets/javascripts/ace/mode-php.js +1 -1
- data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +1 -1
- data/vendor/assets/javascripts/ace/mode-puppet.js +3 -3
- data/vendor/assets/javascripts/ace/mode-slim.js +2 -1
- data/vendor/assets/javascripts/ace/mode-tcl.js +3 -0
- data/vendor/assets/javascripts/ace/mode-terraform.js +4 -4
- data/vendor/assets/javascripts/ace/mode-yaml.js +44 -13
- data/vendor/assets/javascripts/ace/mode-zeek.js +539 -0
- data/vendor/assets/javascripts/ace/snippets/abap.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/abc.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/actionscript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ada.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/apache_conf.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/apex.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/applescript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/aql.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/asciidoc.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/asl.js +13 -0
- data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/autohotkey.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/batchfile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/bro.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/c9search.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/c_cpp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/cirru.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/clojure.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/cobol.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/coffee.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/coldfusion.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/crystal.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/csharp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/csound_document.js +24 -0
- data/vendor/assets/javascripts/ace/snippets/csound_orchestra.js +61 -0
- data/vendor/assets/javascripts/ace/snippets/csound_score.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/csp.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/css.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/curly.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/d.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/dart.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/diff.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/django.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/dockerfile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/dot.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/drools.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/edifact.js +254 -0
- data/vendor/assets/javascripts/ace/snippets/eiffel.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ejs.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/elixir.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/elm.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/erlang.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/forth.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/fortran.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/fsharp.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/fsl.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/ftl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/gcode.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/gherkin.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/gitignore.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/glsl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/gobstones.js +1701 -24
- data/vendor/assets/javascripts/ace/snippets/golang.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/graphqlschema.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/groovy.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/haml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/handlebars.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/haskell.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/haxe.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/hjson.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/html.js +36 -2
- data/vendor/assets/javascripts/ace/snippets/html_elixir.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/html_ruby.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ini.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/io.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jack.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jade.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/java.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/javascript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/json.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jsoniq.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jsp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/jssm.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/jsx.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/julia.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/kotlin.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/latex.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/less.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/liquid.js +890 -2
- data/vendor/assets/javascripts/ace/snippets/lisp.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/livescript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/logiql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/logtalk.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/lsl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/lua.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/luapage.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/lucene.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/makefile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/markdown.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mask.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/matlab.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/maze.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mel.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mixal.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/mushcode.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/mysql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/nginx.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/nim.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/nix.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/nsis.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/objectivec.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ocaml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/pascal.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/perl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/perl6.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/pgsql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/php.js +49 -36
- data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/pig.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/plain_text.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/powershell.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/praat.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/prolog.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/properties.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/protobuf.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/puppet.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/python.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/r.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/razor.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/rdoc.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/red.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/redshift.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/rhtml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/rst.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/ruby.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/rust.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sass.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/scad.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/scala.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/scheme.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/scss.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sh.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sjs.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/slim.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/smarty.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/snippets.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/soy_template.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/space.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sparql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sql.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/sqlserver.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/stylus.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/svg.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/swift.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/tcl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/terraform.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/tex.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/text.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/textile.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/toml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/tsx.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/turtle.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/twig.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/typescript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/vala.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/vbscript.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/velocity.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/verilog.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/vhdl.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/visualforce.js +14 -0
- data/vendor/assets/javascripts/ace/snippets/wollok.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/xml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/xquery.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/yaml.js +8 -1
- data/vendor/assets/javascripts/ace/snippets/zeek.js +14 -0
- data/vendor/assets/javascripts/ace/worker-coffee.js +2 -2
- data/vendor/assets/javascripts/ace/worker-css.js +9 -3
- data/vendor/assets/javascripts/ace/worker-html.js +2 -2
- data/vendor/assets/javascripts/ace/worker-javascript.js +2 -2
- data/vendor/assets/javascripts/ace/worker-json.js +2 -2
- data/vendor/assets/javascripts/ace/worker-lua.js +2 -2
- data/vendor/assets/javascripts/ace/worker-php.js +4 -4
- data/vendor/assets/javascripts/ace/worker-xml.js +2 -2
- data/vendor/assets/javascripts/ace/worker-xquery.js +2 -2
- metadata +34 -16
- data/vendor/assets/javascripts/ace/ext-chromevox.js +0 -540
- data/vendor/assets/javascripts/ace/ext-old_ie.js +0 -502
- data/vendor/assets/javascripts/ace/mode-bash.js +0 -247
- data/vendor/assets/javascripts/ace/mode-lean.js +0 -281
- data/vendor/assets/javascripts/ace/mode-live_script.js +0 -481
- data/vendor/assets/javascripts/ace/mode-mips_assembler.js +0 -235
- data/vendor/assets/javascripts/ace/mode-mipsassembler.js +0 -196
- data/vendor/assets/javascripts/ace/mode-swig.js +0 -1099
- data/vendor/assets/javascripts/ace/snippets/lean.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/live_script.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +0 -7
- data/vendor/assets/javascripts/ace/snippets/swig.js +0 -7
@@ -0,0 +1,363 @@
|
|
1
|
+
define("ace/mode/nim_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) {
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var oop = require("../lib/oop");
|
5
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
6
|
+
var NimHighlightRules = function () {
|
7
|
+
|
8
|
+
var keywordMapper = this.createKeywordMapper({
|
9
|
+
"variable": "var|let|const",
|
10
|
+
"keyword": "assert|parallel|spawn|export|include|from|template|mixin|bind|import|concept|raise|defer|try|finally|except|converter|proc|func|macro|method|and|or|not|xor|shl|shr|div|mod|in|notin|is|isnot|of|static|if|elif|else|case|of|discard|when|return|yield|block|break|while|echo|continue|asm|using|cast|addr|unsafeAddr|type|ref|ptr|do|declared|defined|definedInScope|compiles|sizeOf|is|shallowCopy|getAst|astToStr|spawn|procCall|for|iterator|as",
|
11
|
+
"storage.type": "newSeq|int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|char|bool|string|set|pointer|float32|float64|enum|object|cstring|array|seq|openArray|varargs|UncheckedArray|tuple|set|distinct|void|auto|openarray|range",
|
12
|
+
"support.function": "lock|ze|toU8|toU16|toU32|ord|low|len|high|add|pop|contains|card|incl|excl|dealloc|inc",
|
13
|
+
"constant.language": "nil|true|false"
|
14
|
+
}, "identifier");
|
15
|
+
|
16
|
+
var hexNumber = "(?:0[xX][\\dA-Fa-f][\\dA-Fa-f_]*)";
|
17
|
+
var decNumber = "(?:[0-9][\\d_]*)";
|
18
|
+
var octNumber = "(?:0o[0-7][0-7_]*)";
|
19
|
+
var binNumber = "(?:0[bB][01][01_]*)";
|
20
|
+
var intNumber = "(?:" + hexNumber + "|" + decNumber + "|" + octNumber + "|" + binNumber + ")(?:'?[iIuU](?:8|16|32|64)|u)?\\b";
|
21
|
+
var exponent = "(?:[eE][+-]?[\\d][\\d_]*)";
|
22
|
+
var floatNumber = "(?:[\\d][\\d_]*(?:[.][\\d](?:[\\d_]*)" + exponent + "?)|" + exponent + ")";
|
23
|
+
var floatNumberExt = "(?:" + hexNumber + "(?:'(?:(?:[fF](?:32|64)?)|[dD])))|(?:" + floatNumber + "|" + decNumber + "|" + octNumber + "|" + binNumber + ")(?:'(?:(?:[fF](?:32|64)?)|[dD]))";
|
24
|
+
var stringEscape = "\\\\([abeprcnlftv\\\"']|x[0-9A-Fa-f]{2}|[0-2][0-9]{2}|u[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
|
25
|
+
var identifier = '[a-zA-Z][a-zA-Z0-9_]*';
|
26
|
+
this.$rules = {
|
27
|
+
"start": [{
|
28
|
+
token: ["identifier", "keyword.operator", "support.function"],
|
29
|
+
regex: "(" + identifier + ")([.]{1})(" + identifier + ")(?=\\()"
|
30
|
+
}, {//pragmas
|
31
|
+
token: "paren.lparen",
|
32
|
+
regex: "(\\{\\.)",
|
33
|
+
next: [{
|
34
|
+
token: "paren.rparen",
|
35
|
+
regex: '(\\.\\}|\\})',
|
36
|
+
next: "start"
|
37
|
+
}, {
|
38
|
+
include: "methods"
|
39
|
+
}, {
|
40
|
+
token: "identifier",
|
41
|
+
regex: identifier
|
42
|
+
}, {
|
43
|
+
token: "punctuation",
|
44
|
+
regex: /[,]/
|
45
|
+
}, {
|
46
|
+
token: "keyword.operator",
|
47
|
+
regex: /[=:.]/
|
48
|
+
}, {
|
49
|
+
token: "paren.lparen",
|
50
|
+
regex: /[[(]/
|
51
|
+
}, {
|
52
|
+
token: "paren.rparen",
|
53
|
+
regex: /[\])]/
|
54
|
+
}, {
|
55
|
+
include: "math"
|
56
|
+
}, {
|
57
|
+
include: "strings"
|
58
|
+
}, {
|
59
|
+
defaultToken: "text"
|
60
|
+
}]
|
61
|
+
}, {
|
62
|
+
token: "comment.doc.start",
|
63
|
+
regex: /##\[(?!])/,
|
64
|
+
push: "docBlockComment"
|
65
|
+
}, {
|
66
|
+
token: "comment.start",
|
67
|
+
regex: /#\[(?!])/,
|
68
|
+
push: "blockComment"
|
69
|
+
}, {
|
70
|
+
token: "comment.doc",
|
71
|
+
regex: '##.*$'
|
72
|
+
}, {
|
73
|
+
token: "comment",
|
74
|
+
regex: '#.*$'
|
75
|
+
}, {
|
76
|
+
include: "strings"
|
77
|
+
}, {// character
|
78
|
+
token: "string",
|
79
|
+
regex: "'(?:\\\\(?:[abercnlftv]|x[0-9A-Fa-f]{2}|[0-2][0-9]{2}|u[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})|.{1})?'"
|
80
|
+
}, {
|
81
|
+
include: "methods"
|
82
|
+
}, {
|
83
|
+
token: keywordMapper,
|
84
|
+
regex: "[a-zA-Z][a-zA-Z0-9_]*\\b"
|
85
|
+
}, {
|
86
|
+
token: ["keyword.operator", "text", "storage.type"],
|
87
|
+
regex: "([:])(\\s+)(" + identifier + ")(?=$|\\)|\\[|,|\\s+=|;|\\s+\\{)"
|
88
|
+
}, {
|
89
|
+
token: "paren.lparen",
|
90
|
+
regex: /\[\.|{\||\(\.|\[:|[[({`]/
|
91
|
+
}, {
|
92
|
+
token: "paren.rparen",
|
93
|
+
regex: /\.\)|\|}|\.]|[\])}]/
|
94
|
+
}, {
|
95
|
+
token: "keyword.operator",
|
96
|
+
regex: /[=+\-*\/<>@$~&%|!?^.:\\]/
|
97
|
+
}, {
|
98
|
+
token: "punctuation",
|
99
|
+
regex: /[,;]/
|
100
|
+
}, {
|
101
|
+
include: "math"
|
102
|
+
}],
|
103
|
+
blockComment: [{
|
104
|
+
regex: /#\[]/,
|
105
|
+
token: "comment"
|
106
|
+
}, {
|
107
|
+
regex: /#\[(?!])/,
|
108
|
+
token: "comment.start",
|
109
|
+
push: "blockComment"
|
110
|
+
}, {
|
111
|
+
regex: /]#/,
|
112
|
+
token: "comment.end",
|
113
|
+
next: "pop"
|
114
|
+
}, {
|
115
|
+
defaultToken: "comment"
|
116
|
+
}],
|
117
|
+
docBlockComment: [{
|
118
|
+
regex: /##\[]/,
|
119
|
+
token: "comment.doc"
|
120
|
+
}, {
|
121
|
+
regex: /##\[(?!])/,
|
122
|
+
token: "comment.doc.start",
|
123
|
+
push: "docBlockComment"
|
124
|
+
}, {
|
125
|
+
regex: /]##/,
|
126
|
+
token: "comment.doc.end",
|
127
|
+
next: "pop"
|
128
|
+
}, {
|
129
|
+
defaultToken: "comment.doc"
|
130
|
+
}],
|
131
|
+
math: [{
|
132
|
+
token: "constant.float",
|
133
|
+
regex: floatNumberExt
|
134
|
+
}, {
|
135
|
+
token: "constant.float",
|
136
|
+
regex: floatNumber
|
137
|
+
}, {
|
138
|
+
token: "constant.integer",
|
139
|
+
regex: intNumber
|
140
|
+
}],
|
141
|
+
methods: [{
|
142
|
+
token: "support.function",
|
143
|
+
regex: "(\\w+)(?=\\()"
|
144
|
+
}],
|
145
|
+
strings: [{
|
146
|
+
token: "string",
|
147
|
+
regex: '(\\b' + identifier + ')?"""',
|
148
|
+
push: [{
|
149
|
+
token: "string",
|
150
|
+
regex: '"""',
|
151
|
+
next: "pop"
|
152
|
+
}, {
|
153
|
+
defaultToken: "string"
|
154
|
+
}]
|
155
|
+
}, {
|
156
|
+
token: "string",
|
157
|
+
regex: "\\b" + identifier + '"(?=.)',
|
158
|
+
push: [{
|
159
|
+
token: "string",
|
160
|
+
regex: '"|$',
|
161
|
+
next: "pop"
|
162
|
+
}, {
|
163
|
+
defaultToken: "string"
|
164
|
+
}]
|
165
|
+
}, {
|
166
|
+
token: "string",
|
167
|
+
regex: '"',
|
168
|
+
push: [{
|
169
|
+
token: "string",
|
170
|
+
regex: '"|$',
|
171
|
+
next: "pop"
|
172
|
+
}, {
|
173
|
+
token: "constant.language.escape",
|
174
|
+
regex: stringEscape
|
175
|
+
}, {
|
176
|
+
defaultToken: "string"
|
177
|
+
}]
|
178
|
+
}]
|
179
|
+
};
|
180
|
+
this.normalizeRules();
|
181
|
+
};
|
182
|
+
|
183
|
+
|
184
|
+
oop.inherits(NimHighlightRules, TextHighlightRules);
|
185
|
+
|
186
|
+
exports.NimHighlightRules = NimHighlightRules;
|
187
|
+
});
|
188
|
+
|
189
|
+
define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
|
190
|
+
"use strict";
|
191
|
+
|
192
|
+
var oop = require("../../lib/oop");
|
193
|
+
var Range = require("../../range").Range;
|
194
|
+
var BaseFoldMode = require("./fold_mode").FoldMode;
|
195
|
+
|
196
|
+
var FoldMode = exports.FoldMode = function(commentRegex) {
|
197
|
+
if (commentRegex) {
|
198
|
+
this.foldingStartMarker = new RegExp(
|
199
|
+
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
|
200
|
+
);
|
201
|
+
this.foldingStopMarker = new RegExp(
|
202
|
+
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
|
203
|
+
);
|
204
|
+
}
|
205
|
+
};
|
206
|
+
oop.inherits(FoldMode, BaseFoldMode);
|
207
|
+
|
208
|
+
(function() {
|
209
|
+
|
210
|
+
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
|
211
|
+
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
|
212
|
+
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
|
213
|
+
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
|
214
|
+
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
|
215
|
+
this._getFoldWidgetBase = this.getFoldWidget;
|
216
|
+
this.getFoldWidget = function(session, foldStyle, row) {
|
217
|
+
var line = session.getLine(row);
|
218
|
+
|
219
|
+
if (this.singleLineBlockCommentRe.test(line)) {
|
220
|
+
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
|
221
|
+
return "";
|
222
|
+
}
|
223
|
+
|
224
|
+
var fw = this._getFoldWidgetBase(session, foldStyle, row);
|
225
|
+
|
226
|
+
if (!fw && this.startRegionRe.test(line))
|
227
|
+
return "start"; // lineCommentRegionStart
|
228
|
+
|
229
|
+
return fw;
|
230
|
+
};
|
231
|
+
|
232
|
+
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
|
233
|
+
var line = session.getLine(row);
|
234
|
+
|
235
|
+
if (this.startRegionRe.test(line))
|
236
|
+
return this.getCommentRegionBlock(session, line, row);
|
237
|
+
|
238
|
+
var match = line.match(this.foldingStartMarker);
|
239
|
+
if (match) {
|
240
|
+
var i = match.index;
|
241
|
+
|
242
|
+
if (match[1])
|
243
|
+
return this.openingBracketBlock(session, match[1], row, i);
|
244
|
+
|
245
|
+
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
|
246
|
+
|
247
|
+
if (range && !range.isMultiLine()) {
|
248
|
+
if (forceMultiline) {
|
249
|
+
range = this.getSectionRange(session, row);
|
250
|
+
} else if (foldStyle != "all")
|
251
|
+
range = null;
|
252
|
+
}
|
253
|
+
|
254
|
+
return range;
|
255
|
+
}
|
256
|
+
|
257
|
+
if (foldStyle === "markbegin")
|
258
|
+
return;
|
259
|
+
|
260
|
+
var match = line.match(this.foldingStopMarker);
|
261
|
+
if (match) {
|
262
|
+
var i = match.index + match[0].length;
|
263
|
+
|
264
|
+
if (match[1])
|
265
|
+
return this.closingBracketBlock(session, match[1], row, i);
|
266
|
+
|
267
|
+
return session.getCommentFoldRange(row, i, -1);
|
268
|
+
}
|
269
|
+
};
|
270
|
+
|
271
|
+
this.getSectionRange = function(session, row) {
|
272
|
+
var line = session.getLine(row);
|
273
|
+
var startIndent = line.search(/\S/);
|
274
|
+
var startRow = row;
|
275
|
+
var startColumn = line.length;
|
276
|
+
row = row + 1;
|
277
|
+
var endRow = row;
|
278
|
+
var maxRow = session.getLength();
|
279
|
+
while (++row < maxRow) {
|
280
|
+
line = session.getLine(row);
|
281
|
+
var indent = line.search(/\S/);
|
282
|
+
if (indent === -1)
|
283
|
+
continue;
|
284
|
+
if (startIndent > indent)
|
285
|
+
break;
|
286
|
+
var subRange = this.getFoldWidgetRange(session, "all", row);
|
287
|
+
|
288
|
+
if (subRange) {
|
289
|
+
if (subRange.start.row <= startRow) {
|
290
|
+
break;
|
291
|
+
} else if (subRange.isMultiLine()) {
|
292
|
+
row = subRange.end.row;
|
293
|
+
} else if (startIndent == indent) {
|
294
|
+
break;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
endRow = row;
|
298
|
+
}
|
299
|
+
|
300
|
+
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
|
301
|
+
};
|
302
|
+
this.getCommentRegionBlock = function(session, line, row) {
|
303
|
+
var startColumn = line.search(/\s*$/);
|
304
|
+
var maxRow = session.getLength();
|
305
|
+
var startRow = row;
|
306
|
+
|
307
|
+
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
|
308
|
+
var depth = 1;
|
309
|
+
while (++row < maxRow) {
|
310
|
+
line = session.getLine(row);
|
311
|
+
var m = re.exec(line);
|
312
|
+
if (!m) continue;
|
313
|
+
if (m[1]) depth--;
|
314
|
+
else depth++;
|
315
|
+
|
316
|
+
if (!depth) break;
|
317
|
+
}
|
318
|
+
|
319
|
+
var endRow = row;
|
320
|
+
if (endRow > startRow) {
|
321
|
+
return new Range(startRow, startColumn, endRow, line.length);
|
322
|
+
}
|
323
|
+
};
|
324
|
+
|
325
|
+
}).call(FoldMode.prototype);
|
326
|
+
|
327
|
+
});
|
328
|
+
|
329
|
+
define("ace/mode/nim",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/nim_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
|
330
|
+
"use strict";
|
331
|
+
|
332
|
+
var oop = require("../lib/oop");
|
333
|
+
var TextMode = require("./text").Mode;
|
334
|
+
var NimHighlightRules = require("./nim_highlight_rules").NimHighlightRules;
|
335
|
+
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
336
|
+
|
337
|
+
var Mode = function () {
|
338
|
+
TextMode.call(this);
|
339
|
+
this.HighlightRules = NimHighlightRules;
|
340
|
+
this.foldingRules = new CStyleFoldMode();
|
341
|
+
this.$behaviour = this.$defaultBehaviour;
|
342
|
+
};
|
343
|
+
|
344
|
+
oop.inherits(Mode, TextMode);
|
345
|
+
|
346
|
+
|
347
|
+
(function () {
|
348
|
+
this.lineCommentStart = "#";
|
349
|
+
this.blockComment = {start: "#[", end: "]#", nestable: true};
|
350
|
+
|
351
|
+
|
352
|
+
this.$id = "ace/mode/nim";
|
353
|
+
}).call(Mode.prototype);
|
354
|
+
|
355
|
+
exports.Mode = Mode;
|
356
|
+
}); (function() {
|
357
|
+
window.require(["ace/mode/nim"], function(m) {
|
358
|
+
if (typeof module == "object" && typeof exports == "object" && module) {
|
359
|
+
module.exports = m;
|
360
|
+
}
|
361
|
+
});
|
362
|
+
})();
|
363
|
+
|
@@ -5,74 +5,92 @@ var oop = require("../lib/oop");
|
|
5
5
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
6
6
|
|
7
7
|
var PascalHighlightRules = function() {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
regex: '
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
8
|
+
var keywordMapper = this.createKeywordMapper({
|
9
|
+
"keyword.control": "absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class" +
|
10
|
+
"|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization" +
|
11
|
+
"|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is" +
|
12
|
+
"|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private" +
|
13
|
+
"|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr" +
|
14
|
+
"|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor"
|
15
|
+
}, "identifier", true);
|
16
|
+
|
17
|
+
this.$rules = {
|
18
|
+
start: [{
|
19
|
+
caseInsensitive: true,
|
20
|
+
token: ['variable', "text",
|
21
|
+
'storage.type.prototype',
|
22
|
+
'entity.name.function.prototype'
|
23
|
+
],
|
24
|
+
regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))'
|
25
|
+
}, {
|
26
|
+
caseInsensitive: true,
|
27
|
+
token: ['variable', "text", 'storage.type.function', 'entity.name.function'],
|
28
|
+
regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?'
|
29
|
+
}, {
|
30
|
+
caseInsensitive: true,
|
31
|
+
token: keywordMapper,
|
32
|
+
regex: /\b[a-z_]+\b/
|
33
|
+
}, {
|
34
|
+
token: 'constant.numeric',
|
35
|
+
regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b'
|
36
|
+
}, {
|
37
|
+
token: 'punctuation.definition.comment',
|
38
|
+
regex: '--.*$'
|
39
|
+
}, {
|
40
|
+
token: 'punctuation.definition.comment',
|
41
|
+
regex: '//.*$'
|
42
|
+
}, {
|
43
|
+
token: 'punctuation.definition.comment',
|
44
|
+
regex: '\\(\\*',
|
45
|
+
push: [{
|
46
|
+
token: 'punctuation.definition.comment',
|
47
|
+
regex: '\\*\\)',
|
48
|
+
next: 'pop'
|
49
|
+
},
|
50
|
+
{ defaultToken: 'comment.block.one' }
|
51
|
+
]
|
52
|
+
}, {
|
53
|
+
token: 'punctuation.definition.comment',
|
54
|
+
regex: '\\{',
|
55
|
+
push: [{
|
56
|
+
token: 'punctuation.definition.comment',
|
57
|
+
regex: '\\}',
|
58
|
+
next: 'pop'
|
59
|
+
},
|
60
|
+
{ defaultToken: 'comment.block.two' }
|
61
|
+
]
|
62
|
+
}, {
|
63
|
+
token: 'punctuation.definition.string.begin',
|
60
64
|
regex: '"',
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
push: [{ token: 'constant.character.escape', regex: '\\\\.' },
|
66
|
+
{
|
67
|
+
token: 'punctuation.definition.string.end',
|
68
|
+
regex: '"',
|
69
|
+
next: 'pop'
|
70
|
+
},
|
71
|
+
{ defaultToken: 'string.quoted.double' }
|
72
|
+
]
|
73
|
+
}, {
|
74
|
+
token: 'punctuation.definition.string.begin',
|
70
75
|
regex: '\'',
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
push: [{
|
77
|
+
token: 'constant.character.escape.apostrophe',
|
78
|
+
regex: '\'\''
|
79
|
+
},
|
80
|
+
{
|
81
|
+
token: 'punctuation.definition.string.end',
|
82
|
+
regex: '\'',
|
83
|
+
next: 'pop'
|
84
|
+
},
|
85
|
+
{ defaultToken: 'string.quoted.single' }
|
86
|
+
]
|
87
|
+
}, {
|
88
|
+
token: 'keyword.operator',
|
89
|
+
regex: '[+\\-;,/*%]|:=|='
|
90
|
+
}
|
91
|
+
]
|
92
|
+
};
|
93
|
+
|
76
94
|
this.normalizeRules();
|
77
95
|
};
|
78
96
|
|