From eaa8ccaccb1091820d0a8d1223996a6dd057347d Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 17 Jan 2016 14:28:04 -0600 Subject: Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor --- public/vendor/codemirror/mode/apl/apl.js | 0 public/vendor/codemirror/mode/apl/index.html | 0 .../codemirror/mode/asciiarmor/asciiarmor.js | 0 .../vendor/codemirror/mode/asciiarmor/index.html | 0 public/vendor/codemirror/mode/asn.1/asn.1.js | 0 public/vendor/codemirror/mode/asn.1/index.html | 3 +- public/vendor/codemirror/mode/asterisk/asterisk.js | 0 public/vendor/codemirror/mode/asterisk/index.html | 0 .../vendor/codemirror/mode/brainfuck/brainfuck.js | 85 ++++ public/vendor/codemirror/mode/brainfuck/index.html | 85 ++++ public/vendor/codemirror/mode/clike/clike.js | 245 +++++++++-- public/vendor/codemirror/mode/clike/index.html | 111 ++++- public/vendor/codemirror/mode/clike/scala.html | 0 public/vendor/codemirror/mode/clike/test.js | 18 + public/vendor/codemirror/mode/clojure/clojure.js | 3 + public/vendor/codemirror/mode/clojure/index.html | 3 + public/vendor/codemirror/mode/cmake/cmake.js | 0 public/vendor/codemirror/mode/cmake/index.html | 0 public/vendor/codemirror/mode/cobol/cobol.js | 0 public/vendor/codemirror/mode/cobol/index.html | 0 .../codemirror/mode/coffeescript/coffeescript.js | 40 +- .../vendor/codemirror/mode/coffeescript/index.html | 0 .../codemirror/mode/commonlisp/commonlisp.js | 0 .../vendor/codemirror/mode/commonlisp/index.html | 0 public/vendor/codemirror/mode/crystal/crystal.js | 391 +++++++++++++++++ public/vendor/codemirror/mode/crystal/index.html | 119 +++++ public/vendor/codemirror/mode/css/css.js | 147 +++++-- public/vendor/codemirror/mode/css/gss.html | 103 +++++ public/vendor/codemirror/mode/css/gss_test.js | 17 + public/vendor/codemirror/mode/css/index.html | 0 public/vendor/codemirror/mode/css/less.html | 0 public/vendor/codemirror/mode/css/less_test.js | 4 +- public/vendor/codemirror/mode/css/scss.html | 0 public/vendor/codemirror/mode/css/scss_test.js | 2 +- public/vendor/codemirror/mode/css/test.js | 22 +- public/vendor/codemirror/mode/cypher/cypher.js | 6 +- public/vendor/codemirror/mode/cypher/index.html | 0 public/vendor/codemirror/mode/d/d.js | 0 public/vendor/codemirror/mode/d/index.html | 0 public/vendor/codemirror/mode/dart/dart.js | 86 +++- public/vendor/codemirror/mode/dart/index.html | 0 public/vendor/codemirror/mode/diff/diff.js | 0 public/vendor/codemirror/mode/diff/index.html | 0 public/vendor/codemirror/mode/django/django.js | 25 +- public/vendor/codemirror/mode/django/index.html | 0 .../codemirror/mode/dockerfile/dockerfile.js | 5 +- .../vendor/codemirror/mode/dockerfile/index.html | 0 public/vendor/codemirror/mode/dtd/dtd.js | 0 public/vendor/codemirror/mode/dtd/index.html | 0 public/vendor/codemirror/mode/dylan/dylan.js | 0 public/vendor/codemirror/mode/dylan/index.html | 0 public/vendor/codemirror/mode/ebnf/ebnf.js | 0 public/vendor/codemirror/mode/ebnf/index.html | 0 public/vendor/codemirror/mode/ecl/ecl.js | 0 public/vendor/codemirror/mode/ecl/index.html | 0 public/vendor/codemirror/mode/eiffel/eiffel.js | 0 public/vendor/codemirror/mode/eiffel/index.html | 0 public/vendor/codemirror/mode/elm/elm.js | 2 +- public/vendor/codemirror/mode/elm/index.html | 0 public/vendor/codemirror/mode/erlang/erlang.js | 4 - public/vendor/codemirror/mode/erlang/index.html | 0 public/vendor/codemirror/mode/factor/factor.js | 0 public/vendor/codemirror/mode/factor/index.html | 0 public/vendor/codemirror/mode/forth/forth.js | 0 public/vendor/codemirror/mode/forth/index.html | 0 public/vendor/codemirror/mode/fortran/fortran.js | 0 public/vendor/codemirror/mode/fortran/index.html | 0 public/vendor/codemirror/mode/gas/gas.js | 0 public/vendor/codemirror/mode/gas/index.html | 0 public/vendor/codemirror/mode/gfm/gfm.js | 45 +- public/vendor/codemirror/mode/gfm/index.html | 0 public/vendor/codemirror/mode/gfm/test.js | 21 +- public/vendor/codemirror/mode/gherkin/gherkin.js | 0 public/vendor/codemirror/mode/gherkin/index.html | 0 public/vendor/codemirror/mode/go/go.js | 2 +- public/vendor/codemirror/mode/go/index.html | 0 public/vendor/codemirror/mode/groovy/groovy.js | 0 public/vendor/codemirror/mode/groovy/index.html | 0 public/vendor/codemirror/mode/haml/haml.js | 6 +- public/vendor/codemirror/mode/haml/index.html | 0 public/vendor/codemirror/mode/haml/test.js | 0 .../codemirror/mode/handlebars/handlebars.js | 19 +- .../vendor/codemirror/mode/handlebars/index.html | 15 +- .../mode/haskell-literate/haskell-literate.js | 43 ++ .../codemirror/mode/haskell-literate/index.html | 282 ++++++++++++ public/vendor/codemirror/mode/haskell/haskell.js | 0 public/vendor/codemirror/mode/haskell/index.html | 0 public/vendor/codemirror/mode/haxe/haxe.js | 165 ++++--- public/vendor/codemirror/mode/haxe/index.html | 0 .../codemirror/mode/htmlembedded/htmlembedded.js | 0 .../vendor/codemirror/mode/htmlembedded/index.html | 0 .../vendor/codemirror/mode/htmlmixed/htmlmixed.js | 221 ++++++---- public/vendor/codemirror/mode/htmlmixed/index.html | 0 public/vendor/codemirror/mode/http/http.js | 0 public/vendor/codemirror/mode/http/index.html | 0 public/vendor/codemirror/mode/idl/idl.js | 0 public/vendor/codemirror/mode/idl/index.html | 0 public/vendor/codemirror/mode/index.html | 15 +- public/vendor/codemirror/mode/jade/index.html | 0 public/vendor/codemirror/mode/jade/jade.js | 6 +- .../vendor/codemirror/mode/javascript/index.html | 0 .../codemirror/mode/javascript/javascript.js | 84 +++- .../vendor/codemirror/mode/javascript/json-ld.html | 0 public/vendor/codemirror/mode/javascript/test.js | 55 +-- .../codemirror/mode/javascript/typescript.html | 0 public/vendor/codemirror/mode/jinja2/index.html | 0 public/vendor/codemirror/mode/jinja2/jinja2.js | 0 public/vendor/codemirror/mode/jsx/index.html | 89 ++++ public/vendor/codemirror/mode/jsx/jsx.js | 147 +++++++ public/vendor/codemirror/mode/jsx/test.js | 69 +++ public/vendor/codemirror/mode/julia/index.html | 0 public/vendor/codemirror/mode/julia/julia.js | 223 ++++++---- public/vendor/codemirror/mode/kotlin/index.html | 89 ---- public/vendor/codemirror/mode/kotlin/kotlin.js | 284 ------------ .../vendor/codemirror/mode/livescript/index.html | 0 .../codemirror/mode/livescript/livescript.js | 0 public/vendor/codemirror/mode/lua/index.html | 0 public/vendor/codemirror/mode/lua/lua.js | 0 public/vendor/codemirror/mode/markdown/index.html | 4 +- public/vendor/codemirror/mode/markdown/markdown.js | 192 ++++---- public/vendor/codemirror/mode/markdown/test.js | 176 +++++++- .../vendor/codemirror/mode/mathematica/index.html | 0 .../codemirror/mode/mathematica/mathematica.js | 0 public/vendor/codemirror/mode/meta.js | 20 +- public/vendor/codemirror/mode/mirc/index.html | 0 public/vendor/codemirror/mode/mirc/mirc.js | 0 public/vendor/codemirror/mode/mllike/index.html | 0 public/vendor/codemirror/mode/mllike/mllike.js | 0 public/vendor/codemirror/mode/modelica/index.html | 0 public/vendor/codemirror/mode/modelica/modelica.js | 0 public/vendor/codemirror/mode/mscgen/index.html | 151 +++++++ public/vendor/codemirror/mode/mscgen/mscgen.js | 169 +++++++ .../vendor/codemirror/mode/mscgen/mscgen_test.js | 75 ++++ .../vendor/codemirror/mode/mscgen/msgenny_test.js | 71 +++ public/vendor/codemirror/mode/mscgen/xu_test.js | 75 ++++ public/vendor/codemirror/mode/mumps/index.html | 4 +- public/vendor/codemirror/mode/mumps/mumps.js | 0 public/vendor/codemirror/mode/nginx/index.html | 4 +- public/vendor/codemirror/mode/nginx/nginx.js | 2 +- public/vendor/codemirror/mode/nsis/index.html | 80 ++++ public/vendor/codemirror/mode/nsis/nsis.js | 95 ++++ public/vendor/codemirror/mode/ntriples/index.html | 0 public/vendor/codemirror/mode/ntriples/ntriples.js | 0 public/vendor/codemirror/mode/octave/index.html | 0 public/vendor/codemirror/mode/octave/octave.js | 0 public/vendor/codemirror/mode/oz/index.html | 59 +++ public/vendor/codemirror/mode/oz/oz.js | 252 +++++++++++ public/vendor/codemirror/mode/pascal/index.html | 0 public/vendor/codemirror/mode/pascal/pascal.js | 0 public/vendor/codemirror/mode/pegjs/index.html | 0 public/vendor/codemirror/mode/pegjs/pegjs.js | 0 public/vendor/codemirror/mode/perl/index.html | 0 public/vendor/codemirror/mode/perl/perl.js | 0 public/vendor/codemirror/mode/php/index.html | 0 public/vendor/codemirror/mode/php/php.js | 20 +- public/vendor/codemirror/mode/php/test.js | 0 public/vendor/codemirror/mode/pig/index.html | 4 +- public/vendor/codemirror/mode/pig/pig.js | 0 .../vendor/codemirror/mode/properties/index.html | 0 .../codemirror/mode/properties/properties.js | 0 public/vendor/codemirror/mode/puppet/index.html | 0 public/vendor/codemirror/mode/puppet/puppet.js | 0 public/vendor/codemirror/mode/python/index.html | 0 public/vendor/codemirror/mode/python/python.js | 45 +- public/vendor/codemirror/mode/q/index.html | 0 public/vendor/codemirror/mode/q/q.js | 0 public/vendor/codemirror/mode/r/index.html | 0 public/vendor/codemirror/mode/r/r.js | 0 .../vendor/codemirror/mode/rpm/changes/index.html | 0 public/vendor/codemirror/mode/rpm/index.html | 0 public/vendor/codemirror/mode/rpm/rpm.js | 26 +- public/vendor/codemirror/mode/rst/index.html | 0 public/vendor/codemirror/mode/rst/rst.js | 0 public/vendor/codemirror/mode/ruby/index.html | 0 public/vendor/codemirror/mode/ruby/ruby.js | 6 +- public/vendor/codemirror/mode/ruby/test.js | 0 public/vendor/codemirror/mode/rust/index.html | 22 +- public/vendor/codemirror/mode/rust/rust.js | 484 +++------------------ public/vendor/codemirror/mode/rust/test.js | 39 ++ public/vendor/codemirror/mode/sass/index.html | 0 public/vendor/codemirror/mode/sass/sass.js | 0 public/vendor/codemirror/mode/scheme/index.html | 0 public/vendor/codemirror/mode/scheme/scheme.js | 0 public/vendor/codemirror/mode/shell/index.html | 0 public/vendor/codemirror/mode/shell/shell.js | 0 public/vendor/codemirror/mode/shell/test.js | 0 public/vendor/codemirror/mode/sieve/index.html | 0 public/vendor/codemirror/mode/sieve/sieve.js | 0 public/vendor/codemirror/mode/slim/index.html | 0 public/vendor/codemirror/mode/slim/slim.js | 0 public/vendor/codemirror/mode/slim/test.js | 0 public/vendor/codemirror/mode/smalltalk/index.html | 0 .../vendor/codemirror/mode/smalltalk/smalltalk.js | 0 public/vendor/codemirror/mode/smarty/index.html | 0 public/vendor/codemirror/mode/smarty/smarty.js | 0 public/vendor/codemirror/mode/solr/index.html | 0 public/vendor/codemirror/mode/solr/solr.js | 0 public/vendor/codemirror/mode/soy/index.html | 0 public/vendor/codemirror/mode/soy/soy.js | 0 public/vendor/codemirror/mode/sparql/index.html | 0 public/vendor/codemirror/mode/sparql/sparql.js | 4 +- .../vendor/codemirror/mode/spreadsheet/index.html | 0 .../codemirror/mode/spreadsheet/spreadsheet.js | 0 public/vendor/codemirror/mode/sql/index.html | 0 public/vendor/codemirror/mode/sql/sql.js | 2 +- public/vendor/codemirror/mode/stex/index.html | 0 public/vendor/codemirror/mode/stex/stex.js | 0 public/vendor/codemirror/mode/stex/test.js | 0 public/vendor/codemirror/mode/stylus/index.html | 0 public/vendor/codemirror/mode/stylus/stylus.js | 19 +- public/vendor/codemirror/mode/swift/index.html | 20 +- public/vendor/codemirror/mode/swift/swift.js | 296 ++++++------- public/vendor/codemirror/mode/tcl/index.html | 0 public/vendor/codemirror/mode/tcl/tcl.js | 0 public/vendor/codemirror/mode/textile/index.html | 0 public/vendor/codemirror/mode/textile/test.js | 0 public/vendor/codemirror/mode/textile/textile.js | 0 .../vendor/codemirror/mode/tiddlywiki/index.html | 0 .../codemirror/mode/tiddlywiki/tiddlywiki.css | 0 .../codemirror/mode/tiddlywiki/tiddlywiki.js | 0 public/vendor/codemirror/mode/tiki/index.html | 0 public/vendor/codemirror/mode/tiki/tiki.css | 2 +- public/vendor/codemirror/mode/tiki/tiki.js | 0 public/vendor/codemirror/mode/toml/index.html | 0 public/vendor/codemirror/mode/toml/toml.js | 0 public/vendor/codemirror/mode/tornado/index.html | 0 public/vendor/codemirror/mode/tornado/tornado.js | 0 public/vendor/codemirror/mode/troff/index.html | 0 public/vendor/codemirror/mode/troff/troff.js | 0 public/vendor/codemirror/mode/ttcn-cfg/index.html | 0 public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js | 0 public/vendor/codemirror/mode/ttcn/index.html | 0 public/vendor/codemirror/mode/ttcn/ttcn.js | 0 public/vendor/codemirror/mode/turtle/index.html | 0 public/vendor/codemirror/mode/turtle/turtle.js | 0 public/vendor/codemirror/mode/twig/index.html | 0 public/vendor/codemirror/mode/twig/twig.js | 0 public/vendor/codemirror/mode/vb/index.html | 0 public/vendor/codemirror/mode/vb/vb.js | 0 public/vendor/codemirror/mode/vbscript/index.html | 0 public/vendor/codemirror/mode/vbscript/vbscript.js | 0 public/vendor/codemirror/mode/velocity/index.html | 0 public/vendor/codemirror/mode/velocity/velocity.js | 0 public/vendor/codemirror/mode/verilog/index.html | 0 public/vendor/codemirror/mode/verilog/test.js | 0 public/vendor/codemirror/mode/verilog/verilog.js | 0 public/vendor/codemirror/mode/vhdl/index.html | 95 ++++ public/vendor/codemirror/mode/vhdl/vhdl.js | 189 ++++++++ public/vendor/codemirror/mode/vue/index.html | 69 +++ public/vendor/codemirror/mode/vue/vue.js | 69 +++ public/vendor/codemirror/mode/xml/index.html | 0 public/vendor/codemirror/mode/xml/test.js | 0 public/vendor/codemirror/mode/xml/xml.js | 148 ++++--- public/vendor/codemirror/mode/xquery/index.html | 0 public/vendor/codemirror/mode/xquery/test.js | 0 public/vendor/codemirror/mode/xquery/xquery.js | 0 .../codemirror/mode/yaml-frontmatter/index.html | 121 ++++++ .../mode/yaml-frontmatter/yaml-frontmatter.js | 68 +++ public/vendor/codemirror/mode/yaml/index.html | 0 public/vendor/codemirror/mode/yaml/yaml.js | 0 public/vendor/codemirror/mode/z80/index.html | 0 public/vendor/codemirror/mode/z80/z80.js | 0 262 files changed, 4876 insertions(+), 1707 deletions(-) mode change 100755 => 100644 public/vendor/codemirror/mode/apl/apl.js mode change 100755 => 100644 public/vendor/codemirror/mode/apl/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/asciiarmor/asciiarmor.js mode change 100755 => 100644 public/vendor/codemirror/mode/asciiarmor/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/asn.1/asn.1.js mode change 100755 => 100644 public/vendor/codemirror/mode/asn.1/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/asterisk/asterisk.js mode change 100755 => 100644 public/vendor/codemirror/mode/asterisk/index.html create mode 100644 public/vendor/codemirror/mode/brainfuck/brainfuck.js create mode 100644 public/vendor/codemirror/mode/brainfuck/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/clike/clike.js mode change 100755 => 100644 public/vendor/codemirror/mode/clike/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/clike/scala.html mode change 100755 => 100644 public/vendor/codemirror/mode/clike/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/clojure/clojure.js mode change 100755 => 100644 public/vendor/codemirror/mode/clojure/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/cmake/cmake.js mode change 100755 => 100644 public/vendor/codemirror/mode/cmake/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/cobol/cobol.js mode change 100755 => 100644 public/vendor/codemirror/mode/cobol/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/coffeescript/coffeescript.js mode change 100755 => 100644 public/vendor/codemirror/mode/coffeescript/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/commonlisp/commonlisp.js mode change 100755 => 100644 public/vendor/codemirror/mode/commonlisp/index.html create mode 100644 public/vendor/codemirror/mode/crystal/crystal.js create mode 100644 public/vendor/codemirror/mode/crystal/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/css/css.js create mode 100644 public/vendor/codemirror/mode/css/gss.html create mode 100644 public/vendor/codemirror/mode/css/gss_test.js mode change 100755 => 100644 public/vendor/codemirror/mode/css/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/css/less.html mode change 100755 => 100644 public/vendor/codemirror/mode/css/less_test.js mode change 100755 => 100644 public/vendor/codemirror/mode/css/scss.html mode change 100755 => 100644 public/vendor/codemirror/mode/css/scss_test.js mode change 100755 => 100644 public/vendor/codemirror/mode/css/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/cypher/cypher.js mode change 100755 => 100644 public/vendor/codemirror/mode/cypher/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/d/d.js mode change 100755 => 100644 public/vendor/codemirror/mode/d/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/dart/dart.js mode change 100755 => 100644 public/vendor/codemirror/mode/dart/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/diff/diff.js mode change 100755 => 100644 public/vendor/codemirror/mode/diff/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/django/django.js mode change 100755 => 100644 public/vendor/codemirror/mode/django/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/dockerfile/dockerfile.js mode change 100755 => 100644 public/vendor/codemirror/mode/dockerfile/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/dtd/dtd.js mode change 100755 => 100644 public/vendor/codemirror/mode/dtd/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/dylan/dylan.js mode change 100755 => 100644 public/vendor/codemirror/mode/dylan/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ebnf/ebnf.js mode change 100755 => 100644 public/vendor/codemirror/mode/ebnf/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ecl/ecl.js mode change 100755 => 100644 public/vendor/codemirror/mode/ecl/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/eiffel/eiffel.js mode change 100755 => 100644 public/vendor/codemirror/mode/eiffel/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/elm/elm.js mode change 100755 => 100644 public/vendor/codemirror/mode/elm/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/erlang/erlang.js mode change 100755 => 100644 public/vendor/codemirror/mode/erlang/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/factor/factor.js mode change 100755 => 100644 public/vendor/codemirror/mode/factor/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/forth/forth.js mode change 100755 => 100644 public/vendor/codemirror/mode/forth/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/fortran/fortran.js mode change 100755 => 100644 public/vendor/codemirror/mode/fortran/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/gas/gas.js mode change 100755 => 100644 public/vendor/codemirror/mode/gas/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/gfm/gfm.js mode change 100755 => 100644 public/vendor/codemirror/mode/gfm/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/gfm/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/gherkin/gherkin.js mode change 100755 => 100644 public/vendor/codemirror/mode/gherkin/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/go/go.js mode change 100755 => 100644 public/vendor/codemirror/mode/go/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/groovy/groovy.js mode change 100755 => 100644 public/vendor/codemirror/mode/groovy/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/haml/haml.js mode change 100755 => 100644 public/vendor/codemirror/mode/haml/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/haml/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/handlebars/handlebars.js mode change 100755 => 100644 public/vendor/codemirror/mode/handlebars/index.html create mode 100644 public/vendor/codemirror/mode/haskell-literate/haskell-literate.js create mode 100644 public/vendor/codemirror/mode/haskell-literate/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/haskell/haskell.js mode change 100755 => 100644 public/vendor/codemirror/mode/haskell/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/haxe/haxe.js mode change 100755 => 100644 public/vendor/codemirror/mode/haxe/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/htmlembedded/htmlembedded.js mode change 100755 => 100644 public/vendor/codemirror/mode/htmlembedded/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/htmlmixed/htmlmixed.js mode change 100755 => 100644 public/vendor/codemirror/mode/htmlmixed/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/http/http.js mode change 100755 => 100644 public/vendor/codemirror/mode/http/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/idl/idl.js mode change 100755 => 100644 public/vendor/codemirror/mode/idl/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/jade/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/jade/jade.js mode change 100755 => 100644 public/vendor/codemirror/mode/javascript/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/javascript/javascript.js mode change 100755 => 100644 public/vendor/codemirror/mode/javascript/json-ld.html mode change 100755 => 100644 public/vendor/codemirror/mode/javascript/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/javascript/typescript.html mode change 100755 => 100644 public/vendor/codemirror/mode/jinja2/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/jinja2/jinja2.js create mode 100644 public/vendor/codemirror/mode/jsx/index.html create mode 100644 public/vendor/codemirror/mode/jsx/jsx.js create mode 100644 public/vendor/codemirror/mode/jsx/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/julia/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/julia/julia.js delete mode 100755 public/vendor/codemirror/mode/kotlin/index.html delete mode 100755 public/vendor/codemirror/mode/kotlin/kotlin.js mode change 100755 => 100644 public/vendor/codemirror/mode/livescript/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/livescript/livescript.js mode change 100755 => 100644 public/vendor/codemirror/mode/lua/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/lua/lua.js mode change 100755 => 100644 public/vendor/codemirror/mode/markdown/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/markdown/markdown.js mode change 100755 => 100644 public/vendor/codemirror/mode/markdown/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/mathematica/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/mathematica/mathematica.js mode change 100755 => 100644 public/vendor/codemirror/mode/meta.js mode change 100755 => 100644 public/vendor/codemirror/mode/mirc/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/mirc/mirc.js mode change 100755 => 100644 public/vendor/codemirror/mode/mllike/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/mllike/mllike.js mode change 100755 => 100644 public/vendor/codemirror/mode/modelica/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/modelica/modelica.js create mode 100644 public/vendor/codemirror/mode/mscgen/index.html create mode 100644 public/vendor/codemirror/mode/mscgen/mscgen.js create mode 100644 public/vendor/codemirror/mode/mscgen/mscgen_test.js create mode 100644 public/vendor/codemirror/mode/mscgen/msgenny_test.js create mode 100644 public/vendor/codemirror/mode/mscgen/xu_test.js mode change 100755 => 100644 public/vendor/codemirror/mode/mumps/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/mumps/mumps.js mode change 100755 => 100644 public/vendor/codemirror/mode/nginx/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/nginx/nginx.js create mode 100644 public/vendor/codemirror/mode/nsis/index.html create mode 100644 public/vendor/codemirror/mode/nsis/nsis.js mode change 100755 => 100644 public/vendor/codemirror/mode/ntriples/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ntriples/ntriples.js mode change 100755 => 100644 public/vendor/codemirror/mode/octave/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/octave/octave.js create mode 100644 public/vendor/codemirror/mode/oz/index.html create mode 100644 public/vendor/codemirror/mode/oz/oz.js mode change 100755 => 100644 public/vendor/codemirror/mode/pascal/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/pascal/pascal.js mode change 100755 => 100644 public/vendor/codemirror/mode/pegjs/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/pegjs/pegjs.js mode change 100755 => 100644 public/vendor/codemirror/mode/perl/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/perl/perl.js mode change 100755 => 100644 public/vendor/codemirror/mode/php/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/php/php.js mode change 100755 => 100644 public/vendor/codemirror/mode/php/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/pig/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/pig/pig.js mode change 100755 => 100644 public/vendor/codemirror/mode/properties/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/properties/properties.js mode change 100755 => 100644 public/vendor/codemirror/mode/puppet/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/puppet/puppet.js mode change 100755 => 100644 public/vendor/codemirror/mode/python/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/python/python.js mode change 100755 => 100644 public/vendor/codemirror/mode/q/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/q/q.js mode change 100755 => 100644 public/vendor/codemirror/mode/r/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/r/r.js mode change 100755 => 100644 public/vendor/codemirror/mode/rpm/changes/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/rpm/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/rpm/rpm.js mode change 100755 => 100644 public/vendor/codemirror/mode/rst/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/rst/rst.js mode change 100755 => 100644 public/vendor/codemirror/mode/ruby/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ruby/ruby.js mode change 100755 => 100644 public/vendor/codemirror/mode/ruby/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/rust/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/rust/rust.js create mode 100644 public/vendor/codemirror/mode/rust/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/sass/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/sass/sass.js mode change 100755 => 100644 public/vendor/codemirror/mode/scheme/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/scheme/scheme.js mode change 100755 => 100644 public/vendor/codemirror/mode/shell/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/shell/shell.js mode change 100755 => 100644 public/vendor/codemirror/mode/shell/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/sieve/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/sieve/sieve.js mode change 100755 => 100644 public/vendor/codemirror/mode/slim/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/slim/slim.js mode change 100755 => 100644 public/vendor/codemirror/mode/slim/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/smalltalk/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/smalltalk/smalltalk.js mode change 100755 => 100644 public/vendor/codemirror/mode/smarty/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/smarty/smarty.js mode change 100755 => 100644 public/vendor/codemirror/mode/solr/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/solr/solr.js mode change 100755 => 100644 public/vendor/codemirror/mode/soy/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/soy/soy.js mode change 100755 => 100644 public/vendor/codemirror/mode/sparql/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/sparql/sparql.js mode change 100755 => 100644 public/vendor/codemirror/mode/spreadsheet/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/spreadsheet/spreadsheet.js mode change 100755 => 100644 public/vendor/codemirror/mode/sql/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/sql/sql.js mode change 100755 => 100644 public/vendor/codemirror/mode/stex/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/stex/stex.js mode change 100755 => 100644 public/vendor/codemirror/mode/stex/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/stylus/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/stylus/stylus.js mode change 100755 => 100644 public/vendor/codemirror/mode/swift/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/swift/swift.js mode change 100755 => 100644 public/vendor/codemirror/mode/tcl/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/tcl/tcl.js mode change 100755 => 100644 public/vendor/codemirror/mode/textile/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/textile/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/textile/textile.js mode change 100755 => 100644 public/vendor/codemirror/mode/tiddlywiki/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css mode change 100755 => 100644 public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js mode change 100755 => 100644 public/vendor/codemirror/mode/tiki/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/tiki/tiki.css mode change 100755 => 100644 public/vendor/codemirror/mode/tiki/tiki.js mode change 100755 => 100644 public/vendor/codemirror/mode/toml/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/toml/toml.js mode change 100755 => 100644 public/vendor/codemirror/mode/tornado/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/tornado/tornado.js mode change 100755 => 100644 public/vendor/codemirror/mode/troff/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/troff/troff.js mode change 100755 => 100644 public/vendor/codemirror/mode/ttcn-cfg/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js mode change 100755 => 100644 public/vendor/codemirror/mode/ttcn/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/ttcn/ttcn.js mode change 100755 => 100644 public/vendor/codemirror/mode/turtle/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/turtle/turtle.js mode change 100755 => 100644 public/vendor/codemirror/mode/twig/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/twig/twig.js mode change 100755 => 100644 public/vendor/codemirror/mode/vb/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/vb/vb.js mode change 100755 => 100644 public/vendor/codemirror/mode/vbscript/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/vbscript/vbscript.js mode change 100755 => 100644 public/vendor/codemirror/mode/velocity/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/velocity/velocity.js mode change 100755 => 100644 public/vendor/codemirror/mode/verilog/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/verilog/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/verilog/verilog.js create mode 100644 public/vendor/codemirror/mode/vhdl/index.html create mode 100644 public/vendor/codemirror/mode/vhdl/vhdl.js create mode 100644 public/vendor/codemirror/mode/vue/index.html create mode 100644 public/vendor/codemirror/mode/vue/vue.js mode change 100755 => 100644 public/vendor/codemirror/mode/xml/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/xml/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/xml/xml.js mode change 100755 => 100644 public/vendor/codemirror/mode/xquery/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/xquery/test.js mode change 100755 => 100644 public/vendor/codemirror/mode/xquery/xquery.js create mode 100644 public/vendor/codemirror/mode/yaml-frontmatter/index.html create mode 100644 public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js mode change 100755 => 100644 public/vendor/codemirror/mode/yaml/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/yaml/yaml.js mode change 100755 => 100644 public/vendor/codemirror/mode/z80/index.html mode change 100755 => 100644 public/vendor/codemirror/mode/z80/z80.js (limited to 'public/vendor/codemirror/mode') diff --git a/public/vendor/codemirror/mode/apl/apl.js b/public/vendor/codemirror/mode/apl/apl.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/apl/index.html b/public/vendor/codemirror/mode/apl/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js b/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/asciiarmor/index.html b/public/vendor/codemirror/mode/asciiarmor/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/asn.1/asn.1.js b/public/vendor/codemirror/mode/asn.1/asn.1.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/asn.1/index.html b/public/vendor/codemirror/mode/asn.1/index.html old mode 100755 new mode 100644 index 8346f8e5..699fd447 --- a/public/vendor/codemirror/mode/asn.1/index.html +++ b/public/vendor/codemirror/mode/asn.1/index.html @@ -1,4 +1,4 @@ - + CodeMirror: ASN.1 mode @@ -73,6 +73,5 @@

The development of this mode has been sponsored by Ericsson .

Coded by Asmelash Tsegay Gebretsadkan

- diff --git a/public/vendor/codemirror/mode/asterisk/asterisk.js b/public/vendor/codemirror/mode/asterisk/asterisk.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/asterisk/index.html b/public/vendor/codemirror/mode/asterisk/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/brainfuck/brainfuck.js b/public/vendor/codemirror/mode/brainfuck/brainfuck.js new file mode 100644 index 00000000..3becf2a5 --- /dev/null +++ b/public/vendor/codemirror/mode/brainfuck/brainfuck.js @@ -0,0 +1,85 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11 + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") + mod(require("../../lib/codemirror")) + else if (typeof define == "function" && define.amd) + define(["../../lib/codemirror"], mod) + else + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + var reserve = "><+-.,[]".split(""); + /* + comments can be either: + placed behind lines + + +++ this is a comment + + where reserved characters cannot be used + or in a loop + [ + this is ok to use [ ] and stuff + ] + or preceded by # + */ + CodeMirror.defineMode("brainfuck", function() { + return { + startState: function() { + return { + commentLine: false, + left: 0, + right: 0, + commentLoop: false + } + }, + token: function(stream, state) { + if (stream.eatSpace()) return null + if(stream.sol()){ + state.commentLine = false; + } + var ch = stream.next().toString(); + if(reserve.indexOf(ch) !== -1){ + if(state.commentLine === true){ + if(stream.eol()){ + state.commentLine = false; + } + return "comment"; + } + if(ch === "]" || ch === "["){ + if(ch === "["){ + state.left++; + } + else{ + state.right++; + } + return "bracket"; + } + else if(ch === "+" || ch === "-"){ + return "keyword"; + } + else if(ch === "<" || ch === ">"){ + return "atom"; + } + else if(ch === "." || ch === ","){ + return "def"; + } + } + else{ + state.commentLine = true; + if(stream.eol()){ + state.commentLine = false; + } + return "comment"; + } + if(stream.eol()){ + state.commentLine = false; + } + } + }; + }); +CodeMirror.defineMIME("text/x-brainfuck","brainfuck") +}); diff --git a/public/vendor/codemirror/mode/brainfuck/index.html b/public/vendor/codemirror/mode/brainfuck/index.html new file mode 100644 index 00000000..6048fc24 --- /dev/null +++ b/public/vendor/codemirror/mode/brainfuck/index.html @@ -0,0 +1,85 @@ + + +CodeMirror: Brainfuck mode + + + + + + + + + + +
+

Brainfuck mode

+
+ + + +

A mode for Brainfuck

+ +

MIME types defined: text/x-brainfuck

+
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js old mode 100755 new mode 100644 index f1a7e7a9..4f5c0cf3 --- a/public/vendor/codemirror/mode/clike/clike.js +++ b/public/vendor/codemirror/mode/clike/clike.js @@ -25,8 +25,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { multiLineStrings = parserConfig.multiLineStrings, indentStatements = parserConfig.indentStatements !== false, indentSwitch = parserConfig.indentSwitch !== false, - namespaceSeparator = parserConfig.namespaceSeparator; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; + namespaceSeparator = parserConfig.namespaceSeparator, + isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/, + numberStart = parserConfig.numberStart || /[\d\.]/, + number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i, + isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/, + endStatement = parserConfig.endStatement || /^[;:,]$/; var curPunc, isDefKeyword; @@ -40,13 +44,14 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { state.tokenize = tokenString(ch); return state.tokenize(stream, state); } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + if (isPunctuationChar.test(ch)) { curPunc = ch; return null; } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; + if (numberStart.test(ch)) { + stream.backUp(1) + if (stream.match(number)) return "number" + stream.next() } if (ch == "/") { if (stream.eat("*")) { @@ -67,17 +72,17 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { stream.eatWhile(/[\w\$_\xa1-\uffff]/); var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true; + if (contains(keywords, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; + if (contains(defKeywords, cur)) isDefKeyword = true; return "keyword"; } - if (types.propertyIsEnumerable(cur)) return "variable-3"; - if (builtin.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; + if (contains(types, cur)) return "variable-3"; + if (contains(builtin, cur)) { + if (contains(blockKeywords, cur)) curPunc = "newstatement"; return "builtin"; } - if (atoms.propertyIsEnumerable(cur)) return "atom"; + if (contains(atoms, cur)) return "atom"; return "variable"; } @@ -168,8 +173,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { if (style == "comment" || style == "meta") return style; if (ctx.align == null) ctx.align = true; - if ((curPunc == ";" || curPunc == ":" || curPunc == ",")) - while (isStatement(state.context.type)) popContext(state); + if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state); else if (curPunc == "{") pushContext(state, stream.column(), "}"); else if (curPunc == "[") pushContext(state, stream.column(), "]"); else if (curPunc == "(") pushContext(state, stream.column(), ")"); @@ -212,8 +216,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass; var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev; + if (hooks.indent) { + var hook = hooks.indent(state, ctx, textAfter); + if (typeof hook == "number") return hook + } var closing = firstChar == ctx.type; var switchBlock = ctx.prev && ctx.prev.type == "switchstatement"; + if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) { + while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev + return ctx.indented + } if (isStatement(ctx.type)) return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit); if (ctx.align && (!dontAlignCalls || ctx.type != ")")) @@ -238,27 +250,30 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } + function contains(words, word) { + if (typeof words === "function") { + return words(word); + } else { + return words.propertyIsEnumerable(word); + } + } var cKeywords = "auto if break case register continue return default do sizeof " + - "static else struct switch extern typedef float union for " + - "goto while enum const volatile"; + "static else struct switch extern typedef union for goto while enum const volatile"; var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t"; function cppHook(stream, state) { - if (!state.startOfLine) return false; - for (;;) { - if (stream.skipTo("\\")) { - stream.next(); - if (stream.eol()) { - state.tokenize = cppHook; - break; - } - } else { - stream.skipToEnd(); - state.tokenize = null; - break; + if (!state.startOfLine) return false + for (var ch, next = null; ch = stream.peek();) { + if (ch == "\\" && stream.match(/^.$/)) { + next = cppHook + break + } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) { + break } + stream.next() } - return "meta"; + state.tokenize = next + return "meta" } function pointerHook(_stream, state) { @@ -266,6 +281,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { return false; } + function cpp14Literal(stream) { + stream.eatWhile(/[\w\.']/); + return "number"; + } + function cpp11StringHook(stream, state) { stream.backUp(1); // Raw strings. @@ -373,6 +393,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { "U": cpp11StringHook, "L": cpp11StringHook, "R": cpp11StringHook, + "0": cpp14Literal, + "1": cpp14Literal, + "2": cpp14Literal, + "3": cpp14Literal, + "4": cpp14Literal, + "5": cpp14Literal, + "6": cpp14Literal, + "7": cpp14Literal, + "8": cpp14Literal, + "9": cpp14Literal, token: function(stream, state, style) { if (style == "variable" && stream.peek() == "(" && (state.prevToken == ";" || state.prevToken == null || @@ -398,6 +428,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { defKeywords: words("class interface package enum"), typeFirstDefinitions: true, atoms: words("true false null"), + endStatement: /^[;:]$/, hooks: { "@": function(stream) { stream.eatWhile(/[\w\$_]/); @@ -453,7 +484,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { keywords: words( /* scala */ - "abstract case catch class def do else extends false final finally for forSome if " + + "abstract case catch class def do else extends final finally for forSome if " + "implicit import lazy match new null object override package private protected return " + "sealed super this throw trait try type val var while with yield _ : = => <- <: " + "<% >: # @ " + @@ -501,6 +532,59 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { modeProps: {closeBrackets: {triples: '"'}} }); + function tokenKotlinString(tripleString){ + return function (stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!tripleString && !escaped && stream.match('"') ) {end = true; break;} + if (tripleString && stream.match('"""')) {end = true; break;} + next = stream.next(); + if(!escaped && next == "$" && stream.match('{')) + stream.skipTo("}"); + escaped = !escaped && next == "\\" && !tripleString; + } + if (end || !tripleString) + state.tokenize = null; + return "string"; + } + } + + def("text/x-kotlin", { + name: "clike", + keywords: words( + /*keywords*/ + "package as typealias class interface this super val " + + "var fun for is in This throw return " + + "break continue object if else while do try when !in !is as? " + + + /*soft keywords*/ + "file import where by get set abstract enum open inner override private public internal " + + "protected catch finally out final vararg reified dynamic companion constructor init " + + "sealed field property receiver param sparam lateinit data inline noinline tailrec " + + "external annotation crossinline const operator infix" + ), + types: words( + /* package java.lang */ + "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " + + "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " + + "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " + + "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void" + ), + intendSwitch: false, + indentStatements: false, + multiLineStrings: true, + blockKeywords: words("catch class do else finally for if where try while enum"), + defKeywords: words("class val var object package interface fun"), + atoms: words("true false null this"), + hooks: { + '"': function(stream, state) { + state.tokenize = tokenKotlinString(stream.match('""')); + return state.tokenize(stream, state); + } + }, + modeProps: {closeBrackets: {triples: '"'}} + }); + def(["x-shader/x-vertex", "x-shader/x-fragment"], { name: "clike", keywords: words("sampler1D sampler2D sampler3D samplerCube " + @@ -583,9 +667,106 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { stream.eatWhile(/[\w\$]/); return "keyword"; }, - "#": cppHook + "#": cppHook, + indent: function(_state, ctx, textAfter) { + if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented + } }, modeProps: {fold: "brace"} }); + def("text/x-squirrel", { + name: "clike", + keywords: words("base break clone continue const default delete enum extends function in class" + + " foreach local resume return this throw typeof yield constructor instanceof static"), + types: words(cTypes), + blockKeywords: words("case catch class else for foreach if switch try while"), + defKeywords: words("function local class"), + typeFirstDefinitions: true, + atoms: words("true false null"), + hooks: {"#": cppHook}, + modeProps: {fold: ["brace", "include"]} + }); + + // Ceylon Strings need to deal with interpolation + var stringTokenizer = null; + function tokenCeylonString(type) { + return function(stream, state) { + var escaped = false, next, end = false; + while (!stream.eol()) { + if (!escaped && stream.match('"') && + (type == "single" || stream.match('""'))) { + end = true; + break; + } + if (!escaped && stream.match('``')) { + stringTokenizer = tokenCeylonString(type); + end = true; + break; + } + next = stream.next(); + escaped = type == "single" && !escaped && next == "\\"; + } + if (end) + state.tokenize = null; + return "string"; + } + } + + def("text/x-ceylon", { + name: "clike", + keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" + + " exists extends finally for function given if import in interface is let module new" + + " nonempty object of out outer package return satisfies super switch then this throw" + + " try value void while"), + types: function(word) { + // In Ceylon all identifiers that start with an uppercase are types + var first = word.charAt(0); + return (first === first.toUpperCase() && first !== first.toLowerCase()); + }, + blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"), + defKeywords: words("class dynamic function interface module object package value"), + builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" + + " native optional sealed see serializable shared suppressWarnings tagged throws variable"), + isPunctuationChar: /[\[\]{}\(\),;\:\.`]/, + isOperatorChar: /[+\-*&%=<>!?|^~:\/]/, + numberStart: /[\d#$]/, + number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i, + multiLineStrings: true, + typeFirstDefinitions: true, + atoms: words("true false null larger smaller equal empty finished"), + indentSwitch: false, + styleDefs: false, + hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, + '"': function(stream, state) { + state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single"); + return state.tokenize(stream, state); + }, + '`': function(stream, state) { + if (!stringTokenizer || !stream.match('`')) return false; + state.tokenize = stringTokenizer; + stringTokenizer = null; + return state.tokenize(stream, state); + }, + "'": function(stream) { + stream.eatWhile(/[\w\$_\xa1-\uffff]/); + return "atom"; + }, + token: function(_stream, state, style) { + if ((style == "variable" || style == "variable-3") && + state.prevToken == ".") { + return "variable-2"; + } + } + }, + modeProps: { + fold: ["brace", "import"], + closeBrackets: {triples: '"'} + } + }); + }); diff --git a/public/vendor/codemirror/mode/clike/index.html b/public/vendor/codemirror/mode/clike/index.html old mode 100755 new mode 100644 index 8b386d22..45c670ae --- a/public/vendor/codemirror/mode/clike/index.html +++ b/public/vendor/codemirror/mode/clike/index.html @@ -206,6 +206,103 @@ object FilterTest extends App { } +

Kotlin mode

+ +
+ +

Ceylon mode

+ +
+ @@ -247,5 +354,7 @@ object FilterTest extends App { (Java), text/x-csharp (C#), text/x-objectivec (Objective-C), text/x-scala (Scala), text/x-vertex - and x-shader/x-fragment (shader programs).

+ x-shader/x-fragment (shader programs), + text/x-squirrel (Squirrel) and + text/x-ceylon (Ceylon)

diff --git a/public/vendor/codemirror/mode/clike/scala.html b/public/vendor/codemirror/mode/clike/scala.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/clike/test.js b/public/vendor/codemirror/mode/clike/test.js old mode 100755 new mode 100644 index 79b006de..c2600326 --- a/public/vendor/codemirror/mode/clike/test.js +++ b/public/vendor/codemirror/mode/clike/test.js @@ -30,4 +30,22 @@ " [keyword for] (;;)", " [variable x][operator ++];", "[keyword return];"); + + MT("preprocessor", + "[meta #define FOO 3]", + "[variable-3 int] [variable foo];", + "[meta #define BAR\\]", + "[meta 4]", + "[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];", + "[meta #include ][comment // comment]") + + + var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src"); + function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); } + + MTCPP("cpp14_literal", + "[number 10'000];", + "[number 0b10'000];", + "[number 0x10'000];", + "[string '100000'];"); })(); diff --git a/public/vendor/codemirror/mode/clojure/clojure.js b/public/vendor/codemirror/mode/clojure/clojure.js old mode 100755 new mode 100644 index d531022a..44948d04 --- a/public/vendor/codemirror/mode/clojure/clojure.js +++ b/public/vendor/codemirror/mode/clojure/clojure.js @@ -96,6 +96,9 @@ CodeMirror.defineMode("clojure", function (options) { if ( '.' == stream.peek() ) { stream.eat('.'); stream.eatWhile(tests.digit); + } else if ('/' == stream.peek() ) { + stream.eat('/'); + stream.eatWhile(tests.digit); } if ( stream.eat(tests.exponent) ) { diff --git a/public/vendor/codemirror/mode/clojure/index.html b/public/vendor/codemirror/mode/clojure/index.html old mode 100755 new mode 100644 index 3ecf4c48..81294bc1 --- a/public/vendor/codemirror/mode/clojure/index.html +++ b/public/vendor/codemirror/mode/clojure/index.html @@ -78,6 +78,9 @@ \tab \return \backspace \u1000 \uAaAa \u9F9F) +;; Let's play with numbers +(+ 1 -1 1/2 -1/2 -0.5 0.5) + + + + + + + +
+

Crystal mode

+
+ + +

MIME types defined: text/x-crystal.

+
diff --git a/public/vendor/codemirror/mode/css/css.js b/public/vendor/codemirror/mode/css/css.js old mode 100755 new mode 100644 index 1e6d2ddb..e9656e3d --- a/public/vendor/codemirror/mode/css/css.js +++ b/public/vendor/codemirror/mode/css/css.js @@ -12,6 +12,7 @@ "use strict"; CodeMirror.defineMode("css", function(config, parserConfig) { + var inline = parserConfig.inline if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); var indentUnit = config.indentUnit, @@ -19,13 +20,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) { documentTypes = parserConfig.documentTypes || {}, mediaTypes = parserConfig.mediaTypes || {}, mediaFeatures = parserConfig.mediaFeatures || {}, + mediaValueKeywords = parserConfig.mediaValueKeywords || {}, propertyKeywords = parserConfig.propertyKeywords || {}, nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, fontProperties = parserConfig.fontProperties || {}, counterDescriptors = parserConfig.counterDescriptors || {}, colorKeywords = parserConfig.colorKeywords || {}, valueKeywords = parserConfig.valueKeywords || {}, - allowNested = parserConfig.allowNested; + allowNested = parserConfig.allowNested, + supportsAtComponent = parserConfig.supportsAtComponent === true; var type, override; function ret(style, tp) { type = tp; return style; } @@ -119,13 +122,14 @@ CodeMirror.defineMode("css", function(config, parserConfig) { this.prev = prev; } - function pushContext(state, stream, type) { - state.context = new Context(type, stream.indentation() + indentUnit, state.context); + function pushContext(state, stream, type, indent) { + state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); return type; } function popContext(state) { - state.context = state.context.prev; + if (state.context.prev) + state.context = state.context.prev; return state.context.type; } @@ -157,9 +161,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return pushContext(state, stream, "block"); } else if (type == "}" && state.context.prev) { return popContext(state); - } else if (/@(media|supports|(-moz-)?document)/.test(type)) { + } else if (supportsAtComponent && /@component/.test(type)) { + return pushContext(state, stream, "atComponentBlock"); + } else if (/^@(-moz-)?document$/.test(type)) { + return pushContext(state, stream, "documentTypes"); + } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) { return pushContext(state, stream, "atBlock"); - } else if (/@(font-face|counter-style)/.test(type)) { + } else if (/^@(font-face|counter-style)/.test(type)) { state.stateArg = type; return "restricted_atBlock_before"; } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) { @@ -219,7 +227,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { if (type == "}" || type == "{") return popAndPass(type, stream, state); if (type == "(") return pushContext(state, stream, "parens"); - if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) { + if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) { override += " error"; } else if (type == "word") { wordAsValue(stream); @@ -252,33 +260,56 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return pass(type, stream, state); }; + states.documentTypes = function(type, stream, state) { + if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { + override = "tag"; + return state.context.type; + } else { + return states.atBlock(type, stream, state); + } + }; + states.atBlock = function(type, stream, state) { if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (type == "}") return popAndPass(type, stream, state); + if (type == "}" || type == ";") return popAndPass(type, stream, state); if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); + if (type == "interpolation") return pushContext(state, stream, "interpolation"); + if (type == "word") { var word = stream.current().toLowerCase(); if (word == "only" || word == "not" || word == "and" || word == "or") override = "keyword"; - else if (documentTypes.hasOwnProperty(word)) - override = "tag"; else if (mediaTypes.hasOwnProperty(word)) override = "attribute"; else if (mediaFeatures.hasOwnProperty(word)) override = "property"; + else if (mediaValueKeywords.hasOwnProperty(word)) + override = "keyword"; else if (propertyKeywords.hasOwnProperty(word)) override = "property"; else if (nonStandardPropertyKeywords.hasOwnProperty(word)) override = "string-2"; else if (valueKeywords.hasOwnProperty(word)) override = "atom"; + else if (colorKeywords.hasOwnProperty(word)) + override = "keyword"; else override = "error"; } return state.context.type; }; + states.atComponentBlock = function(type, stream, state) { + if (type == "}") + return popAndPass(type, stream, state); + if (type == "{") + return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); + if (type == "word") + override = "error"; + return state.context.type; + }; + states.atBlock_parens = function(type, stream, state) { if (type == ")") return popContext(state); if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); @@ -336,9 +367,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) { return { startState: function(base) { return {tokenize: null, - state: "top", + state: inline ? "block" : "top", stateArg: null, - context: new Context("top", base || 0, null)}; + context: new Context(inline ? "block" : "top", base || 0, null)}; }, token: function(stream, state) { @@ -357,12 +388,18 @@ CodeMirror.defineMode("css", function(config, parserConfig) { var cx = state.context, ch = textAfter && textAfter.charAt(0); var indent = cx.indent; if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; - if (cx.prev && - (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "restricted_atBlock") || - ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at" || cx.type == "atBlock"))) { - indent = cx.indent - indentUnit; - cx = cx.prev; + if (cx.prev) { + if (ch == "}" && (cx.type == "block" || cx.type == "top" || + cx.type == "interpolation" || cx.type == "restricted_atBlock")) { + // Resume indentation from parent context. + cx = cx.prev; + indent = cx.indent; + } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || + ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { + // Dedent relative to current context. + indent = Math.max(0, cx.indent - indentUnit); + cx = cx.prev; + } } return indent; }, @@ -399,17 +436,24 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color", "max-color", "color-index", "min-color-index", "max-color-index", "monochrome", "min-monochrome", "max-monochrome", "resolution", - "min-resolution", "max-resolution", "scan", "grid" + "min-resolution", "max-resolution", "scan", "grid", "orientation", + "device-pixel-ratio", "min-device-pixel-ratio", "max-device-pixel-ratio", + "pointer", "any-pointer", "hover", "any-hover" ], mediaFeatures = keySet(mediaFeatures_); + var mediaValueKeywords_ = [ + "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", + "interlace", "progressive" + ], mediaValueKeywords = keySet(mediaValueKeywords_); + var propertyKeywords_ = [ "align-content", "align-items", "align-self", "alignment-adjust", "alignment-baseline", "anchor-point", "animation", "animation-delay", "animation-direction", "animation-duration", "animation-fill-mode", "animation-iteration-count", "animation-name", "animation-play-state", "animation-timing-function", "appearance", "azimuth", "backface-visibility", - "background", "background-attachment", "background-clip", "background-color", - "background-image", "background-origin", "background-position", + "background", "background-attachment", "background-blend-mode", "background-clip", + "background-color", "background-image", "background-origin", "background-position", "background-repeat", "background-size", "baseline-shift", "binding", "bleed", "bookmark-label", "bookmark-level", "bookmark-state", "bookmark-target", "border", "border-bottom", "border-bottom-color", @@ -553,11 +597,12 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote", - "col-resize", "collapse", "column", "compact", "condensed", "contain", "content", + "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse", + "compact", "condensed", "contain", "content", "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop", - "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal", + "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal", "decimal-leading-zero", "default", "default-button", "destination-atop", - "destination-in", "destination-out", "destination-over", "devanagari", + "destination-in", "destination-out", "destination-over", "devanagari", "difference", "disc", "discard", "disclosure-closed", "disclosure-open", "document", "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", @@ -568,23 +613,23 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", - "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed", - "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "footnotes", + "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed", + "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes", "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove", - "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew", + "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew", "help", "hidden", "hide", "higher", "highlight", "highlighttext", - "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore", + "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore", "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis", "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "japanese-formal", "japanese-informal", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", - "landscape", "lao", "large", "larger", "left", "level", "lighter", + "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten", "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian", "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian", - "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d", + "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d", "media-controls-background", "media-current-time-display", "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button", @@ -593,7 +638,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", - "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize", + "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize", "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap", "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote", @@ -606,8 +651,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "relative", "repeat", "repeating-linear-gradient", "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY", - "rotateZ", "round", "row-resize", "rtl", "run-in", "running", - "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", + "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running", + "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen", "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button", "searchfield-results-decoration", @@ -615,8 +660,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "simp-chinese-formal", "simp-chinese-informal", "single", "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow", - "small", "small-caps", "small-caption", "smaller", "solid", "somali", - "source-atop", "source-in", "source-out", "source-over", "space", "spell-out", "square", + "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali", + "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table", "table-caption", "table-cell", "table-column", "table-column-group", @@ -633,12 +678,13 @@ CodeMirror.defineMode("css", function(config, parserConfig) { "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url", "var", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted", "visibleStroke", "visual", "w-resize", "wait", "wave", "wider", - "window", "windowframe", "windowtext", "words", "x-large", "x-small", "xor", + "window", "windowframe", "windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", "xx-large", "xx-small" ], valueKeywords = keySet(valueKeywords_); - var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(propertyKeywords_) - .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_); + var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_) + .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_) + .concat(valueKeywords_); CodeMirror.registerHelper("hintWords", "css", allWords); function tokenCComment(stream, state) { @@ -657,6 +703,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { documentTypes: documentTypes, mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, fontProperties: fontProperties, @@ -676,6 +723,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { CodeMirror.defineMIME("text/x-scss", { mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, colorKeywords: colorKeywords, @@ -717,6 +765,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { CodeMirror.defineMIME("text/x-less", { mediaTypes: mediaTypes, mediaFeatures: mediaFeatures, + mediaValueKeywords: mediaValueKeywords, propertyKeywords: propertyKeywords, nonStandardPropertyKeywords: nonStandardPropertyKeywords, colorKeywords: colorKeywords, @@ -751,4 +800,26 @@ CodeMirror.defineMode("css", function(config, parserConfig) { helperType: "less" }); + CodeMirror.defineMIME("text/x-gss", { + documentTypes: documentTypes, + mediaTypes: mediaTypes, + mediaFeatures: mediaFeatures, + propertyKeywords: propertyKeywords, + nonStandardPropertyKeywords: nonStandardPropertyKeywords, + fontProperties: fontProperties, + counterDescriptors: counterDescriptors, + colorKeywords: colorKeywords, + valueKeywords: valueKeywords, + supportsAtComponent: true, + tokenHooks: { + "/": function(stream, state) { + if (!stream.eat("*")) return false; + state.tokenize = tokenCComment; + return tokenCComment(stream, state); + } + }, + name: "css", + helperType: "gss" + }); + }); diff --git a/public/vendor/codemirror/mode/css/gss.html b/public/vendor/codemirror/mode/css/gss.html new file mode 100644 index 00000000..232fe8c1 --- /dev/null +++ b/public/vendor/codemirror/mode/css/gss.html @@ -0,0 +1,103 @@ + + +CodeMirror: Closure Stylesheets (GSS) mode + + + + + + + + + + + + +
+

Closure Stylesheets (GSS) mode

+
+ + +

A mode for Closure Stylesheets (GSS).

+

MIME type defined: text/x-gss.

+ +

Parsing/Highlighting Tests: normal, verbose.

+ +
diff --git a/public/vendor/codemirror/mode/css/gss_test.js b/public/vendor/codemirror/mode/css/gss_test.js new file mode 100644 index 00000000..d56e5928 --- /dev/null +++ b/public/vendor/codemirror/mode/css/gss_test.js @@ -0,0 +1,17 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + "use strict"; + + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } + + MT("atComponent", + "[def @component] {", + "[tag foo] {", + " [property color]: [keyword black];", + "}", + "}"); + +})(); diff --git a/public/vendor/codemirror/mode/css/index.html b/public/vendor/codemirror/mode/css/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/css/less.html b/public/vendor/codemirror/mode/css/less.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/css/less_test.js b/public/vendor/codemirror/mode/css/less_test.js old mode 100755 new mode 100644 index 7b77f584..dd821558 --- a/public/vendor/codemirror/mode/css/less_test.js +++ b/public/vendor/codemirror/mode/css/less_test.js @@ -26,10 +26,10 @@ MT("mixin", "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", - " [property color]: [variable darken]([variable-2 @color], [number 10%]);", + " [property color]: [atom darken]([variable-2 @color], [number 10%]);", "}", "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", - " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", + " [property color]: [atom lighten]([variable-2 @color], [number 10%]);", "}", "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", " [property display]: [atom block];", diff --git a/public/vendor/codemirror/mode/css/scss.html b/public/vendor/codemirror/mode/css/scss.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/css/scss_test.js b/public/vendor/codemirror/mode/css/scss_test.js old mode 100755 new mode 100644 index 26c226a1..785921b3 --- a/public/vendor/codemirror/mode/css/scss_test.js +++ b/public/vendor/codemirror/mode/css/scss_test.js @@ -95,7 +95,7 @@ MT('indent_parentheses', "[tag foo] {", - " [property color]: [variable darken]([variable-2 $blue],", + " [property color]: [atom darken]([variable-2 $blue],", " [number 9%]);", "}"); diff --git a/public/vendor/codemirror/mode/css/test.js b/public/vendor/codemirror/mode/css/test.js old mode 100755 new mode 100644 index 55ae676e..7a496fb0 --- a/public/vendor/codemirror/mode/css/test.js +++ b/public/vendor/codemirror/mode/css/test.js @@ -6,7 +6,7 @@ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } // Error, because "foobarhello" is neither a known type or property, but - // property was expected (after "and"), and it should be in parenthese. + // property was expected (after "and"), and it should be in parentheses. MT("atMediaUnknownType", "[def @media] [attribute screen] [keyword and] [error foobarhello] { }"); @@ -18,6 +18,12 @@ MT("atMediaMaxWidthNested", "[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }"); + MT("atMediaFeatureValueKeyword", + "[def @media] ([property orientation]: [keyword landscape]) { }"); + + MT("atMediaUnknownFeatureValueKeyword", + "[def @media] ([property orientation]: [error upsidedown]) { }"); + MT("tagSelector", "[tag foo] { }"); @@ -49,11 +55,17 @@ MT("tagColorHex3", "[tag foo] { [property background]: [atom #fff]; }"); + MT("tagColorHex4", + "[tag foo] { [property background]: [atom #ffff]; }"); + MT("tagColorHex6", "[tag foo] { [property background]: [atom #ffffff]; }"); - MT("tagColorHex4", - "[tag foo] { [property background]: [atom&error #ffff]; }"); + MT("tagColorHex8", + "[tag foo] { [property background]: [atom #ffffffff]; }"); + + MT("tagColorHex5Invalid", + "[tag foo] { [property background]: [atom&error #fffff]; }"); MT("tagColorHexInvalid", "[tag foo] { [property background]: [atom&error #ffg]; }"); @@ -114,7 +126,7 @@ "}"); MT("empty_url", - "[def @import] [tag url]() [tag screen];"); + "[def @import] [atom url]() [attribute screen];"); MT("parens", "[qualifier .foo] {", @@ -150,7 +162,7 @@ " [tag foo] {", " [property font-family]: [variable Verdana], [atom sans-serif];", " }", - " }"); + "}"); MT("document_url", "[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }"); diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js old mode 100755 new mode 100644 index e218d473..107e4f6d --- a/public/vendor/codemirror/mode/cypher/cypher.js +++ b/public/vendor/codemirror/mode/cypher/cypher.js @@ -60,9 +60,9 @@ }; var indentUnit = config.indentUnit; var curPunc; - var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]); - var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]); - var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); + var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]); + var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]); + var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); var operatorChars = /[*+\-<>=&|~%^]/; return { diff --git a/public/vendor/codemirror/mode/cypher/index.html b/public/vendor/codemirror/mode/cypher/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/d/d.js b/public/vendor/codemirror/mode/d/d.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/d/index.html b/public/vendor/codemirror/mode/d/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js old mode 100755 new mode 100644 index a49e218c..d92eb519 --- a/public/vendor/codemirror/mode/dart/dart.js +++ b/public/vendor/codemirror/mode/dart/dart.js @@ -15,7 +15,7 @@ "implements get native operator set typedef with enum throw rethrow " + "assert break case continue default in return new deferred async await " + "try catch finally do else for if switch while import library export " + - "part of show hide is").split(" "); + "part of show hide is as").split(" "); var blockKeywords = "try catch finally do else for if switch while".split(" "); var atoms = "true false null".split(" "); var builtins = "void bool num int double dynamic var String".split(" "); @@ -26,21 +26,101 @@ return obj; } + function pushInterpolationStack(state) { + (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize); + } + + function popInterpolationStack(state) { + return (state.interpolationStack || (state.interpolationStack = [])).pop(); + } + + function sizeInterpolationStack(state) { + return state.interpolationStack ? state.interpolationStack.length : 0; + } + CodeMirror.defineMIME("application/dart", { name: "clike", keywords: set(keywords), - multiLineStrings: true, blockKeywords: set(blockKeywords), builtin: set(builtins), atoms: set(atoms), hooks: { "@": function(stream) { - stream.eatWhile(/[\w\$_]/); + stream.eatWhile(/[\w\$_\.]/); return "meta"; + }, + + // custom string handling to deal with triple-quoted strings and string interpolation + "'": function(stream, state) { + return tokenString("'", stream, state, false); + }, + "\"": function(stream, state) { + return tokenString("\"", stream, state, false); + }, + "r": function(stream, state) { + var peek = stream.peek(); + if (peek == "'" || peek == "\"") { + return tokenString(stream.next(), stream, state, true); + } + return false; + }, + + "}": function(_stream, state) { + // "}" is end of interpolation, if interpolation stack is non-empty + if (sizeInterpolationStack(state) > 0) { + state.tokenize = popInterpolationStack(state); + return null; + } + return false; } } }); + function tokenString(quote, stream, state, raw) { + var tripleQuoted = false; + if (stream.eat(quote)) { + if (stream.eat(quote)) tripleQuoted = true; + else return "string"; //empty string + } + function tokenStringHelper(stream, state) { + var escaped = false; + while (!stream.eol()) { + if (!raw && !escaped && stream.peek() == "$") { + pushInterpolationStack(state); + state.tokenize = tokenInterpolation; + return "string"; + } + var next = stream.next(); + if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) { + state.tokenize = null; + break; + } + escaped = !raw && !escaped && next == "\\"; + } + return "string"; + } + state.tokenize = tokenStringHelper; + return tokenStringHelper(stream, state); + } + + function tokenInterpolation(stream, state) { + stream.eat("$"); + if (stream.eat("{")) { + // let clike handle the content of ${...}, + // we take over again when "}" appears (see hooks). + state.tokenize = null; + } else { + state.tokenize = tokenInterpolationIdentifier; + } + return null; + } + + function tokenInterpolationIdentifier(stream, state) { + stream.eatWhile(/[\w_]/); + state.tokenize = popInterpolationStack(state); + return "variable"; + } + CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins)); // This is needed to make loading through meta.js work. diff --git a/public/vendor/codemirror/mode/dart/index.html b/public/vendor/codemirror/mode/dart/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/diff/diff.js b/public/vendor/codemirror/mode/diff/diff.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/diff/index.html b/public/vendor/codemirror/mode/diff/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js old mode 100755 new mode 100644 index 2f08b063..eb8d6591 --- a/public/vendor/codemirror/mode/django/django.js +++ b/public/vendor/codemirror/mode/django/django.js @@ -14,14 +14,14 @@ "use strict"; CodeMirror.defineMode("django:inner", function() { - var keywords = ["block", "endblock", "for", "endfor", "true", "false", - "loop", "none", "self", "super", "if", "endif", "as", - "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal", - "ifnotequal", "endifnotequal", "extends", "include", "load", "comment", - "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup", - "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token", - "autoescape", "endautoescape", "spaceless", "ssi", "templatetag", - "verbatim", "endverbatim", "widthratio"], + var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter", + "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import", + "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal", + "endifnotequal", "extends", "include", "load", "comment", "endcomment", + "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now", + "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", + "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless", + "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"], filters = ["add", "addslashes", "capfirst", "center", "cut", "date", "default", "default_if_none", "dictsort", "dictsortreversed", "divisibleby", "escape", "escapejs", @@ -35,11 +35,13 @@ "truncatechars_html", "truncatewords", "truncatewords_html", "unordered_list", "upper", "urlencode", "urlize", "urlizetrunc", "wordcount", "wordwrap", "yesno"], - operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"]; + operators = ["==", "!=", "<", ">", "<=", ">="], + wordOperators = ["in", "not", "or", "and"]; keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b"); filters = new RegExp("^\\b(" + filters.join("|") + ")\\b"); operators = new RegExp("^\\b(" + operators.join("|") + ")\\b"); + wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b"); // We have to return "null" instead of null, in order to avoid string // styling as the default, when using Django templates inside HTML @@ -270,6 +272,11 @@ return "operator"; } + // Attempt to match a word operator + if (stream.match(wordOperators)) { + return "keyword"; + } + // Attempt to match a keyword var keywordMatch = stream.match(keywords); if (keywordMatch) { diff --git a/public/vendor/codemirror/mode/django/index.html b/public/vendor/codemirror/mode/django/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dockerfile/dockerfile.js b/public/vendor/codemirror/mode/dockerfile/dockerfile.js old mode 100755 new mode 100644 index 6d517750..4419009a --- a/public/vendor/codemirror/mode/dockerfile/dockerfile.js +++ b/public/vendor/codemirror/mode/dockerfile/dockerfile.js @@ -69,7 +69,10 @@ token: null, next: "start" } - ] + ], + meta: { + lineComment: "#" + } }); CodeMirror.defineMIME("text/x-dockerfile", "dockerfile"); diff --git a/public/vendor/codemirror/mode/dockerfile/index.html b/public/vendor/codemirror/mode/dockerfile/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dtd/dtd.js b/public/vendor/codemirror/mode/dtd/dtd.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dtd/index.html b/public/vendor/codemirror/mode/dtd/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/dylan/index.html b/public/vendor/codemirror/mode/dylan/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ebnf/ebnf.js b/public/vendor/codemirror/mode/ebnf/ebnf.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ebnf/index.html b/public/vendor/codemirror/mode/ebnf/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ecl/index.html b/public/vendor/codemirror/mode/ecl/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/eiffel/index.html b/public/vendor/codemirror/mode/eiffel/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js old mode 100755 new mode 100644 index 7124c50a..b31e6637 --- a/public/vendor/codemirror/mode/elm/elm.js +++ b/public/vendor/codemirror/mode/elm/elm.js @@ -202,4 +202,4 @@ }); CodeMirror.defineMIME("text/x-elm", "elm"); -})(); +}); diff --git a/public/vendor/codemirror/mode/elm/index.html b/public/vendor/codemirror/mode/elm/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js old mode 100755 new mode 100644 index fbca292f..5aed76a5 --- a/public/vendor/codemirror/mode/erlang/erlang.js +++ b/public/vendor/codemirror/mode/erlang/erlang.js @@ -220,8 +220,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) { }else{ return rval(state,stream,"function"); } - }else if (is_member(w,operatorAtomWords)) { - return rval(state,stream,"operator"); }else if (lookahead(stream) == ":") { if (w == "erlang") { return rval(state,stream,"builtin"); @@ -230,8 +228,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) { } }else if (is_member(w,["true","false"])) { return rval(state,stream,"boolean"); - }else if (is_member(w,["true","false"])) { - return rval(state,stream,"boolean"); }else{ return rval(state,stream,"atom"); } diff --git a/public/vendor/codemirror/mode/erlang/index.html b/public/vendor/codemirror/mode/erlang/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/forth/forth.js b/public/vendor/codemirror/mode/forth/forth.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/forth/index.html b/public/vendor/codemirror/mode/forth/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/fortran/fortran.js b/public/vendor/codemirror/mode/fortran/fortran.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/fortran/index.html b/public/vendor/codemirror/mode/fortran/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/gas/gas.js b/public/vendor/codemirror/mode/gas/gas.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/gas/index.html b/public/vendor/codemirror/mode/gas/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/gfm/gfm.js b/public/vendor/codemirror/mode/gfm/gfm.js old mode 100755 new mode 100644 index 80a8e2c8..6e74ad4f --- a/public/vendor/codemirror/mode/gfm/gfm.js +++ b/public/vendor/codemirror/mode/gfm/gfm.js @@ -11,6 +11,8 @@ })(function(CodeMirror) { "use strict"; +var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i + CodeMirror.defineMode("gfm", function(config, modeConfig) { var codeDepth = 0; function blankLine(state) { @@ -37,7 +39,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) { // Hack to prevent formatting override inside code blocks (block and inline) if (state.codeBlock) { - if (stream.match(/^```/)) { + if (stream.match(/^```+/)) { state.codeBlock = false; return null; } @@ -47,7 +49,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) { if (stream.sol()) { state.code = false; } - if (stream.sol() && stream.match(/^```/)) { + if (stream.sol() && stream.match(/^```+/)) { stream.skipToEnd(); state.codeBlock = true; return null; @@ -78,25 +80,29 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) { } if (stream.sol() || state.ateSpace) { state.ateSpace = false; - if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { - // User/Project@SHA - // User@SHA - // SHA - state.combineTokens = true; - return "link"; - } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { - // User/Project#Num - // User#Num - // #Num - state.combineTokens = true; - return "link"; + if (modeConfig.gitHubSpice !== false) { + if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { + // User/Project@SHA + // User@SHA + // SHA + state.combineTokens = true; + return "link"; + } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { + // User/Project#Num + // User#Num + // #Num + state.combineTokens = true; + return "link"; + } } } - if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) && - stream.string.slice(stream.start - 2, stream.start) != "](") { + if (stream.match(urlRE) && + stream.string.slice(stream.start - 2, stream.start) != "](" && + (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) { // URLs // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine + // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL state.combineTokens = true; return "link"; } @@ -109,15 +115,16 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) { var markdownConfig = { underscoresBreakWords: false, taskLists: true, - fencedCodeBlocks: true, + fencedCodeBlocks: '```', strikethrough: true }; for (var attr in modeConfig) { markdownConfig[attr] = modeConfig[attr]; } markdownConfig.name = "markdown"; - CodeMirror.defineMIME("gfmBase", markdownConfig); - return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay); + return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay); + }, "markdown"); + CodeMirror.defineMIME("text/x-gfm", "gfm"); }); diff --git a/public/vendor/codemirror/mode/gfm/index.html b/public/vendor/codemirror/mode/gfm/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/gfm/test.js b/public/vendor/codemirror/mode/gfm/test.js old mode 100755 new mode 100644 index c2bc38fd..0dcd3619 --- a/public/vendor/codemirror/mode/gfm/test.js +++ b/public/vendor/codemirror/mode/gfm/test.js @@ -51,6 +51,11 @@ "[comment ```]", "bar"); + MT("fencedCodeBlocksNoTildes", + "~~~", + "foo", + "~~~"); + MT("taskListAsterisk", "[variable-2 * []] foo]", // Invalid; must have space or x between [] "[variable-2 * [ ]]bar]", // Invalid; must have space after ] @@ -133,6 +138,15 @@ MT("vanillaLink", "foo [link http://www.example.com/] bar"); + MT("vanillaLinkNoScheme", + "foo [link www.example.com] bar"); + + MT("vanillaLinkHttps", + "foo [link https://www.example.com/] bar"); + + MT("vanillaLinkDataSchema", + "foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar"); + MT("vanillaLinkPunctuation", "foo [link http://www.example.com/]. bar"); @@ -142,6 +156,9 @@ MT("vanillaLinkEmphasis", "foo [em *][em&link http://www.example.com/index.html][em *] bar"); + MT("notALink", + "foo asfd:asdf bar"); + MT("notALink", "[comment ```css]", "[tag foo] {[property color]:[keyword black];}", @@ -152,8 +169,8 @@ MT("notALink", "[comment `foo]", - "[link http://www.example.com/]", - "[comment `foo]", + "[comment&link http://www.example.com/]", + "[comment `] foo", "", "[link http://www.example.com/]"); diff --git a/public/vendor/codemirror/mode/gherkin/gherkin.js b/public/vendor/codemirror/mode/gherkin/gherkin.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/gherkin/index.html b/public/vendor/codemirror/mode/gherkin/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/go/go.js b/public/vendor/codemirror/mode/go/go.js old mode 100755 new mode 100644 index b121f4e6..21fe9a2d --- a/public/vendor/codemirror/mode/go/go.js +++ b/public/vendor/codemirror/mode/go/go.js @@ -86,7 +86,7 @@ CodeMirror.defineMode("go", function(config) { var escaped = false, next, end = false; while ((next = stream.next()) != null) { if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; + escaped = !escaped && quote != "`" && next == "\\"; } if (end || !(escaped || quote == "`")) state.tokenize = tokenBase; diff --git a/public/vendor/codemirror/mode/go/index.html b/public/vendor/codemirror/mode/go/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/groovy/index.html b/public/vendor/codemirror/mode/groovy/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/haml/haml.js b/public/vendor/codemirror/mode/haml/haml.js old mode 100755 new mode 100644 index 8fe63b02..03ce8335 --- a/public/vendor/codemirror/mode/haml/haml.js +++ b/public/vendor/codemirror/mode/haml/haml.js @@ -85,8 +85,10 @@ state.tokenize = rubyInQuote(")"); return state.tokenize(stream, state); } else if (ch == "{") { - state.tokenize = rubyInQuote("}"); - return state.tokenize(stream, state); + if (!stream.match(/^\{%.*/)) { + state.tokenize = rubyInQuote("}"); + return state.tokenize(stream, state); + } } } diff --git a/public/vendor/codemirror/mode/haml/index.html b/public/vendor/codemirror/mode/haml/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/haml/test.js b/public/vendor/codemirror/mode/haml/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/handlebars/handlebars.js b/public/vendor/codemirror/mode/handlebars/handlebars.js old mode 100755 new mode 100644 index 40dfea42..2174e538 --- a/public/vendor/codemirror/mode/handlebars/handlebars.js +++ b/public/vendor/codemirror/mode/handlebars/handlebars.js @@ -3,15 +3,15 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; - CodeMirror.defineSimpleMode("handlebars", { + CodeMirror.defineSimpleMode("handlebars-tags", { start: [ { regex: /\{\{!--/, push: "dash_comment", token: "comment" }, { regex: /\{\{!/, push: "comment", token: "comment" }, @@ -21,8 +21,8 @@ { regex: /\}\}/, pop: true, token: "tag" }, // Double and single quotes - { regex: /"(?:[^\\]|\\.)*?"/, token: "string" }, - { regex: /'(?:[^\\]|\\.)*?'/, token: "string" }, + { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, + { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, // Handlebars keywords { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" }, @@ -49,5 +49,14 @@ ] }); + CodeMirror.defineMode("handlebars", function(config, parserConfig) { + var handlebars = CodeMirror.getMode(config, "handlebars-tags"); + if (!parserConfig || !parserConfig.base) return handlebars; + return CodeMirror.multiplexingMode( + CodeMirror.getMode(config, parserConfig.base), + {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true} + ); + }); + CodeMirror.defineMIME("text/x-handlebars-template", "handlebars"); }); diff --git a/public/vendor/codemirror/mode/handlebars/index.html b/public/vendor/codemirror/mode/handlebars/index.html old mode 100755 new mode 100644 index beaef87a..4f82d602 --- a/public/vendor/codemirror/mode/handlebars/index.html +++ b/public/vendor/codemirror/mode/handlebars/index.html @@ -1,4 +1,4 @@ - + CodeMirror: Handlebars mode @@ -61,22 +61,13 @@ - - +

Handlebars syntax highlighting for CodeMirror.

MIME types defined: text/x-handlebars-template

diff --git a/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js new file mode 100644 index 00000000..9358994d --- /dev/null +++ b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js @@ -0,0 +1,43 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../haskell/haskell")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../haskell/haskell"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + "use strict" + + CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { + var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") + + return { + startState: function () { + return { + inCode: false, + baseState: CodeMirror.startState(baseMode) + } + }, + token: function (stream, state) { + if (stream.sol()) { + if (state.inCode = stream.eat(">")) + return "meta" + } + if (state.inCode) { + return baseMode.token(stream, state.baseState) + } else { + stream.skipToEnd() + return "comment" + } + }, + innerMode: function (state) { + return state.inCode ? {state: state.baseState, mode: baseMode} : null + } + } + }, "haskell") + + CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") +}) diff --git a/public/vendor/codemirror/mode/haskell-literate/index.html b/public/vendor/codemirror/mode/haskell-literate/index.html new file mode 100644 index 00000000..8c9bc60d --- /dev/null +++ b/public/vendor/codemirror/mode/haskell-literate/index.html @@ -0,0 +1,282 @@ + + +CodeMirror: Haskell-literate mode + + + + + + + + + + +
+

Haskell literate mode

+
+ +
+ +

MIME types + defined: text/x-literate-haskell.

+ +

Parser configuration parameters recognized: base to + set the base mode (defaults to "haskell").

+ + + +
diff --git a/public/vendor/codemirror/mode/haskell/haskell.js b/public/vendor/codemirror/mode/haskell/haskell.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/haskell/index.html b/public/vendor/codemirror/mode/haskell/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/haxe/haxe.js b/public/vendor/codemirror/mode/haxe/haxe.js old mode 100755 new mode 100644 index d49ad70f..a9573dd7 --- a/public/vendor/codemirror/mode/haxe/haxe.js +++ b/public/vendor/codemirror/mode/haxe/haxe.js @@ -16,23 +16,21 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { // Tokenizer - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; var type = kw("typedef"); - return { - "if": A, "while": A, "else": B, "do": B, "try": B, - "return": C, "break": C, "continue": C, "new": C, "throw": C, - "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), + var keywords = { + "if": A, "while": A, "else": B, "do": B, "try": B, + "return": C, "break": C, "continue": C, "new": C, "throw": C, + "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), - "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "never": kw("property_access"), "trace":kw("trace"), + "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "never": kw("property_access"), "trace":kw("trace"), "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, - "true": atom, "false": atom, "null": atom - }; - }(); + "true": atom, "false": atom, "null": atom + }; var isOperatorChar = /[+\-*&%=<>!?|]/; @@ -41,14 +39,13 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { return f(stream, state); } - function nextUntilUnescaped(stream, end) { + function toUnescaped(stream, end) { var escaped = false, next; while ((next = stream.next()) != null) { if (next == end && !escaped) - return false; + return true; escaped = !escaped && next == "\\"; } - return escaped; } // Used as scratch variables to communicate multiple values without @@ -61,70 +58,58 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { function haxeTokenBase(stream, state) { var ch = stream.next(); - if (ch == '"' || ch == "'") + if (ch == '"' || ch == "'") { return chain(stream, state, haxeTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { + } else if (ch == "0" && stream.eat(/x/i)) { stream.eatWhile(/[\da-f]/i); return ret("number", "number"); - } - else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); + } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { + stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/); return ret("number", "number"); - } - else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { - nextUntilUnescaped(stream, "/"); + } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { + toUnescaped(stream, "/"); stream.eatWhile(/[gimsu]/); return ret("regexp", "string-2"); - } - else if (ch == "/") { + } else if (ch == "/") { if (stream.eat("*")) { return chain(stream, state, haxeTokenComment); - } - else if (stream.eat("/")) { + } else if (stream.eat("/")) { stream.skipToEnd(); return ret("comment", "comment"); - } - else { + } else { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); } - } - else if (ch == "#") { + } else if (ch == "#") { stream.skipToEnd(); return ret("conditional", "meta"); - } - else if (ch == "@") { + } else if (ch == "@") { stream.eat(/:/); stream.eatWhile(/[\w_]/); return ret ("metadata", "meta"); - } - else if (isOperatorChar.test(ch)) { + } else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); - } - else { - var word; - if(/[A-Z]/.test(ch)) - { - stream.eatWhile(/[\w_<>]/); - word = stream.current(); - return ret("type", "variable-3", word); - } - else - { + } else { + var word; + if(/[A-Z]/.test(ch)) { + stream.eatWhile(/[\w_<>]/); + word = stream.current(); + return ret("type", "variable-3", word); + } else { stream.eatWhile(/[\w_]/); var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; return (known && state.kwAllowed) ? ret(known.type, known.style, word) : ret("variable", "variable", word); - } + } } } function haxeTokenString(quote) { return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) + if (toUnescaped(stream, quote)) state.tokenize = haxeTokenBase; return ret("string", "string"); }; @@ -176,27 +161,25 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) { cc.pop()(); if (cx.marked) return cx.marked; if (type == "variable" && inScope(state, content)) return "variable-2"; - if (type == "variable" && imported(state, content)) return "variable-3"; + if (type == "variable" && imported(state, content)) return "variable-3"; return style; } } } - function imported(state, typename) - { - if (/[a-z]/.test(typename.charAt(0))) - return false; - var len = state.importedtypes.length; - for (var i = 0; i") { - // Script block: mode to change to depends on type attribute - var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i); - scriptType = scriptType ? scriptType[1] : ""; - if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1); - for (var i = 0; i < scriptTypes.length; ++i) { - var tp = scriptTypes[i]; - if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) { - if (tp.mode) { - state.token = script; - state.localMode = tp.mode; - state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, "")); - } - break; - } - } - } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") { - state.token = css; - state.localMode = cssMode; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - } - return style; - } + "use strict"; + + var defaultTags = { + script: [ + ["lang", /(javascript|babel)/i, "javascript"], + ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"], + ["type", /./, "text/plain"], + [null, null, "javascript"] + ], + style: [ + ["lang", /^css$/i, "css"], + ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"], + ["type", /./, "text/plain"], + [null, null, "css"] + ] + }; + function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); - else if (cur.match(/<\/?$/)) { + var cur = stream.current(), close = cur.search(pat); + if (close > -1) { + stream.backUp(cur.length - close); + } else if (cur.match(/<\/?$/)) { stream.backUp(cur.length); if (!stream.match(pat, false)) stream.match(cur); } return style; } - function script(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; - } - return maybeBackup(stream, /<\/\s*script\s*>/, - state.localMode.token(stream, state.localState)); + + var attrRegexpCache = {}; + function getAttrRegexp(attr) { + var regexp = attrRegexpCache[attr]; + if (regexp) return regexp; + return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); + } + + function getAttrValue(stream, attr) { + var pos = stream.pos, match; + while (pos >= 0 && stream.string.charAt(pos) !== "<") pos--; + if (pos < 0) return pos; + if (match = stream.string.slice(pos, stream.pos).match(getAttrRegexp(attr))) + return match[2]; + return ""; + } + + function getTagRegexp(tagName, anchored) { + return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; + + function addTags(from, to) { + for (var tag in from) { + var dest = to[tag] || (to[tag] = []); + var source = from[tag]; + for (var i = source.length - 1; i >= 0; i--) + dest.unshift(source[i]) } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); } - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.localMode, state.localState); - return {token: state.token, localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter); - else - return CodeMirror.Pass; - }, - - innerMode: function(state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + function findMatchingMode(tagInfo, stream) { + for (var i = 0; i < tagInfo.length; i++) { + var spec = tagInfo[i]; + if (!spec[0] || spec[1].test(getAttrValue(stream, spec[0]))) return spec[2]; } - }; -}, "xml", "javascript", "css"); + } + + CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { + var htmlMode = CodeMirror.getMode(config, { + name: "xml", + htmlMode: true, + multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, + multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag + }); + + var tags = {}; + var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; + addTags(defaultTags, tags); + if (configTags) addTags(configTags, tags); + if (configScript) for (var i = configScript.length - 1; i >= 0; i--) + tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) + + function html(stream, state) { + var tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase(); + var tagInfo = tagName && tags.hasOwnProperty(tagName) && tags[tagName]; + + var style = htmlMode.token(stream, state.htmlState), modeSpec; + + if (tagInfo && /\btag\b/.test(style) && stream.current() === ">" && + (modeSpec = findMatchingMode(tagInfo, stream))) { + var mode = CodeMirror.getMode(config, modeSpec); + var endTagA = getTagRegexp(tagName, true), endTag = getTagRegexp(tagName, false); + state.token = function (stream, state) { + if (stream.match(endTagA, false)) { + state.token = html; + state.localState = state.localMode = null; + return null; + } + return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); + }; + state.localMode = mode; + state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "")); + } + return style; + }; + + return { + startState: function () { + var state = htmlMode.startState(); + return {token: html, localMode: null, localState: null, htmlState: state}; + }, + + copyState: function (state) { + var local; + if (state.localState) { + local = CodeMirror.copyState(state.localMode, state.localState); + } + return {token: state.token, localMode: state.localMode, localState: local, + htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; + }, + + token: function (stream, state) { + return state.token(stream, state); + }, -CodeMirror.defineMIME("text/html", "htmlmixed"); + indent: function (state, textAfter) { + if (!state.localMode || /^\s*<\//.test(textAfter)) + return htmlMode.indent(state.htmlState, textAfter); + else if (state.localMode.indent) + return state.localMode.indent(state.localState, textAfter); + else + return CodeMirror.Pass; + }, + + innerMode: function (state) { + return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; + } + }; + }, "xml", "javascript", "css"); + CodeMirror.defineMIME("text/html", "htmlmixed"); }); diff --git a/public/vendor/codemirror/mode/htmlmixed/index.html b/public/vendor/codemirror/mode/htmlmixed/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/http/http.js b/public/vendor/codemirror/mode/http/http.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/http/index.html b/public/vendor/codemirror/mode/http/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/idl/idl.js b/public/vendor/codemirror/mode/idl/idl.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/idl/index.html b/public/vendor/codemirror/mode/idl/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html old mode 100755 new mode 100644 index 8c6d0a43..a6c293ec --- a/public/vendor/codemirror/mode/index.html +++ b/public/vendor/codemirror/mode/index.html @@ -33,12 +33,16 @@ option.

  • APL
  • ASN.1
  • Asterisk dialplan
  • +
  • Brainfuck
  • C, C++, C#
  • +
  • Ceylon
  • Clojure
  • +
  • Closure Stylesheets (GSS)
  • CMake
  • COBOL
  • CoffeeScript
  • Common Lisp
  • +
  • Crystal
  • CSS
  • Cypher
  • Cython
  • @@ -64,7 +68,7 @@ option.

  • Groovy
  • HAML
  • Handlebars
  • -
  • Haskell
  • +
  • Haskell (Literate)
  • Haxe
  • HTML embedded (JSP, ASP.NET)
  • HTML mixed-mode
  • @@ -72,7 +76,7 @@ option.

  • IDL
  • Java
  • Jade
  • -
  • JavaScript
  • +
  • JavaScript (JSX)
  • Jinja2
  • Julia
  • Kotlin
  • @@ -83,12 +87,15 @@ option.

  • Mathematica
  • mIRC
  • Modelica
  • +
  • MscGen
  • MUMPS
  • Nginx
  • +
  • NSIS
  • NTriples
  • Objective C
  • OCaml
  • Octave (MATLAB)
  • +
  • Oz
  • Pascal
  • PEG.js
  • Perl
  • @@ -119,6 +126,7 @@ option.

  • Stylus
  • SQL (several dialects)
  • SPARQL
  • +
  • Squirrel
  • Swift
  • sTeX, LaTeX
  • Tcl
  • @@ -136,9 +144,12 @@ option.

  • VBScript
  • Velocity
  • Verilog/SystemVerilog
  • +
  • VHDL
  • +
  • Vue.js app
  • XML/HTML
  • XQuery
  • YAML
  • +
  • YAML frontmatter
  • Z80
  • diff --git a/public/vendor/codemirror/mode/jade/index.html b/public/vendor/codemirror/mode/jade/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/jade/jade.js b/public/vendor/codemirror/mode/jade/jade.js old mode 100755 new mode 100644 index 96fadb19..1db069a9 --- a/public/vendor/codemirror/mode/jade/jade.js +++ b/public/vendor/codemirror/mode/jade/jade.js @@ -74,7 +74,7 @@ CodeMirror.defineMode('jade', function (config) { res.javaScriptArguments = this.javaScriptArguments; res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth; res.isInterpolating = this.isInterpolating; - res.interpolationNesting = this.intpolationNesting; + res.interpolationNesting = this.interpolationNesting; res.jsState = CodeMirror.copyState(jsMode, this.jsState); @@ -167,7 +167,7 @@ CodeMirror.defineMode('jade', function (config) { if (state.interpolationNesting < 0) { stream.next(); state.isInterpolating = false; - return 'puncutation'; + return 'punctuation'; } } else if (stream.peek() === '{') { state.interpolationNesting++; @@ -583,7 +583,7 @@ CodeMirror.defineMode('jade', function (config) { copyState: copyState, token: nextToken }; -}); +}, 'javascript', 'css', 'htmlmixed'); CodeMirror.defineMIME('text/x-jade', 'jade'); diff --git a/public/vendor/codemirror/mode/javascript/index.html b/public/vendor/codemirror/mode/javascript/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js old mode 100755 new mode 100644 index c86f49e1..fa5721d5 --- a/public/vendor/codemirror/mode/javascript/javascript.js +++ b/public/vendor/codemirror/mode/javascript/javascript.js @@ -13,6 +13,11 @@ })(function(CodeMirror) { "use strict"; +function expressionAllowed(stream, state, backUp) { + return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) +} + CodeMirror.defineMode("javascript", function(config, parserConfig) { var indentUnit = config.indentUnit; var statementIndent = parserConfig.statementIndent; @@ -30,13 +35,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var jsKeywords = { "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C, + "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C, "var": kw("var"), "const": kw("var"), "let": kw("var"), "function": kw("function"), "catch": kw("catch"), "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), "in": operator, "typeof": operator, "instanceof": operator, "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, - "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"), + "this": kw("this"), "class": kw("class"), "super": kw("atom"), "yield": C, "export": kw("export"), "import": kw("import"), "extends": C }; @@ -45,18 +50,23 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { var type = {type: "variable", style: "variable-3"}; var tsKeywords = { // object-like things - "interface": kw("interface"), - "extends": kw("extends"), - "constructor": kw("constructor"), + "interface": kw("class"), + "implements": C, + "namespace": C, + "module": kw("module"), + "enum": kw("module"), // scope modifiers - "public": kw("public"), - "private": kw("private"), - "protected": kw("protected"), - "static": kw("static"), + "public": kw("modifier"), + "private": kw("modifier"), + "protected": kw("modifier"), + "abstract": kw("modifier"), + + // operators + "as": operator, // types - "string": type, "number": type, "bool": type, "any": type + "string": type, "number": type, "boolean": type, "any": type }; for (var attr in tsKeywords) { @@ -105,6 +115,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } else if (ch == "0" && stream.eat(/x/i)) { stream.eatWhile(/[\da-f]/i); return ret("number", "number"); + } else if (ch == "0" && stream.eat(/o/i)) { + stream.eatWhile(/[0-7]/i); + return ret("number", "number"); + } else if (ch == "0" && stream.eat(/b/i)) { + stream.eatWhile(/[01]/i); + return ret("number", "number"); } else if (/\d/.test(ch)) { stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); return ret("number", "number"); @@ -115,8 +131,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { } else if (stream.eat("/")) { stream.skipToEnd(); return ret("comment", "comment"); - } else if (state.lastType == "operator" || state.lastType == "keyword c" || - state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { + } else if (expressionAllowed(stream, state, 1)) { readRegexp(stream); stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/); return ret("regexp", "string-2"); @@ -275,8 +290,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return false; } var state = cx.state; + cx.marked = "def"; if (state.context) { - cx.marked = "def"; if (inList(state.localVars)) return; state.localVars = {name: varname, next: state.localVars}; } else { @@ -347,10 +362,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "default") return cont(expect(":")); if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext); - if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex); if (type == "class") return cont(pushlex("form"), className, poplex); - if (type == "export") return cont(pushlex("form"), afterExport, poplex); - if (type == "import") return cont(pushlex("form"), afterImport, poplex); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) return pass(pushlex("stat"), expression, expect(";"), poplex); } function expression(type) { @@ -374,7 +389,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") { return pass(quasi, maybeop); } + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); return cont(); } function maybeexpression(type) { @@ -425,6 +441,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { findFatArrow(cx.stream, cx.state); return pass(type == "{" ? statement : expressionNoComma); } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } function maybelabel(type) { if (type == ":") return cont(poplex, statement); return pass(maybeoperatorComma, expect(";"), poplex); @@ -442,8 +470,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return cont(afterprop); } else if (type == "jsonld-keyword") { return cont(afterprop); + } else if (type == "modifier") { + return cont(objprop) } else if (type == "[") { return cont(expression, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expression); } } function getterSetter(type) { @@ -492,7 +524,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return pass(pattern, maybetype, maybeAssign, vardefCont); } function pattern(type, value) { + if (type == "modifier") return cont(pattern) if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); if (type == "[") return contCommasep(pattern, "]"); if (type == "{") return contCommasep(proppattern, "}"); } @@ -502,6 +536,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return cont(maybeAssign); } if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); return cont(expect(":"), pattern, maybeAssign); } function maybeAssign(_type, value) { @@ -572,10 +608,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { cx.marked = "property"; return cont(); } - function afterModule(type, value) { - if (type == "string") return cont(statement); - if (type == "variable") { register(value); return cont(maybeFrom); } - } function afterExport(_type, value) { if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } @@ -628,7 +660,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), localVars: parserConfig.localVars, context: parserConfig.localVars && {vars: parserConfig.localVars}, - indented: 0 + indented: basecolumn || 0 }; if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; @@ -684,7 +716,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { helperType: jsonMode ? "json" : "javascript", jsonldMode: jsonldMode, - jsonMode: jsonMode + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } }; }); diff --git a/public/vendor/codemirror/mode/javascript/json-ld.html b/public/vendor/codemirror/mode/javascript/json-ld.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js old mode 100755 new mode 100644 index 092d25dc..cb43d089 --- a/public/vendor/codemirror/mode/javascript/test.js +++ b/public/vendor/codemirror/mode/javascript/test.js @@ -6,7 +6,7 @@ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } MT("locals", - "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); + "[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }"); MT("comma-and-binop", "[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }"); @@ -17,8 +17,12 @@ " [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];", "})();"); + MT("destructure_trailing_comma", + "[keyword let] {[def a], [def b],} [operator =] [variable foo];", + "[keyword let] [def c];"); // Parser still in good state? + MT("class_body", - "[keyword class] [variable Foo] {", + "[keyword class] [def Foo] {", " [property constructor]() {}", " [property sayName]() {", " [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];", @@ -26,7 +30,7 @@ "}"); MT("class", - "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {", + "[keyword class] [def Point] [keyword extends] [variable SuperThing] {", " [property get] [property prop]() { [keyword return] [number 24]; }", " [property constructor]([def x], [def y]) {", " [keyword super]([string 'something']);", @@ -34,52 +38,45 @@ " }", "}"); - MT("module", - "[keyword module] [string 'foo'] {", - " [keyword export] [keyword let] [def x] [operator =] [number 42];", - " [keyword export] [keyword *] [keyword from] [string 'somewhere'];", - "}"); - MT("import", - "[keyword function] [variable foo]() {", + "[keyword function] [def foo]() {", " [keyword import] [def $] [keyword from] [string 'jquery'];", - " [keyword module] [def crypto] [keyword from] [string 'crypto'];", " [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];", "}"); MT("const", - "[keyword function] [variable f]() {", + "[keyword function] [def f]() {", " [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];", "}"); MT("for/of", - "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}"); + "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}"); MT("generator", - "[keyword function*] [variable repeat]([def n]) {", + "[keyword function*] [def repeat]([def n]) {", " [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])", " [keyword yield] [variable-2 i];", "}"); MT("quotedStringAddition", - "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); + "[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];"); MT("quotedFatArrow", - "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); + "[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];"); MT("fatArrow", "[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);", "[variable a];", // No longer in scope - "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", + "[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];", "[variable c];"); MT("spread", - "[keyword function] [variable f]([def a], [meta ...][def b]) {", + "[keyword function] [def f]([def a], [meta ...][def b]) {", " [variable something]([variable-2 a], [meta ...][variable-2 b]);", "}"); MT("comprehension", - "[keyword function] [variable f]() {", + "[keyword function] [def f]() {", " [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];", " ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));", "}"); @@ -91,7 +88,7 @@ "[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]"); MT("indent_statement", - "[keyword var] [variable x] [operator =] [number 10]", + "[keyword var] [def x] [operator =] [number 10]", "[variable x] [operator +=] [variable y] [operator +]", " [atom Infinity]", "[keyword debugger];"); @@ -112,14 +109,14 @@ "}"); MT("indent_for", - "[keyword for] ([keyword var] [variable i] [operator =] [number 0];", + "[keyword for] ([keyword var] [def i] [operator =] [number 0];", " [variable i] [operator <] [number 100];", " [variable i][operator ++])", " [variable doSomething]([variable i]);", "[keyword debugger];"); MT("indent_c_style", - "[keyword function] [variable foo]()", + "[keyword function] [def foo]()", "{", " [keyword debugger];", "}"); @@ -147,24 +144,32 @@ "[number 2];"); MT("multilinestring", - "[keyword var] [variable x] [operator =] [string 'foo\\]", + "[keyword var] [def x] [operator =] [string 'foo\\]", "[string bar'];"); MT("scary_regexp", "[string-2 /foo[[/]]bar/];"); MT("indent_strange_array", - "[keyword var] [variable x] [operator =] [[", + "[keyword var] [def x] [operator =] [[", " [number 1],,", " [number 2],", "]];", "[number 10];"); MT("param_default", - "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {", + "[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {", " [keyword return] [variable-2 x];", "}"); + MT("new_target", + "[keyword function] [def F]([def target]) {", + " [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {", + " [keyword return] [keyword new]", + " .[keyword target];", + " }", + "}"); + var jsonld_mode = CodeMirror.getMode( {indentUnit: 2}, {name: "javascript", jsonld: true} diff --git a/public/vendor/codemirror/mode/javascript/typescript.html b/public/vendor/codemirror/mode/javascript/typescript.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/jinja2/index.html b/public/vendor/codemirror/mode/jinja2/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/jinja2/jinja2.js b/public/vendor/codemirror/mode/jinja2/jinja2.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/jsx/index.html b/public/vendor/codemirror/mode/jsx/index.html new file mode 100644 index 00000000..cb51edb3 --- /dev/null +++ b/public/vendor/codemirror/mode/jsx/index.html @@ -0,0 +1,89 @@ + + +CodeMirror: JSX mode + + + + + + + + + + + +
    +

    JSX mode

    + +
    + + + +

    JSX Mode for React's +JavaScript syntax extension.

    + +

    MIME types defined: text/jsx.

    + +
    diff --git a/public/vendor/codemirror/mode/jsx/jsx.js b/public/vendor/codemirror/mode/jsx/jsx.js new file mode 100644 index 00000000..bc2ea797 --- /dev/null +++ b/public/vendor/codemirror/mode/jsx/jsx.js @@ -0,0 +1,147 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod) + else // Plain browser env + mod(CodeMirror) +})(function(CodeMirror) { + "use strict" + + // Depth means the amount of open braces in JS context, in XML + // context 0 means not in tag, 1 means in tag, and 2 means in tag + // and js block comment. + function Context(state, mode, depth, prev) { + this.state = state; this.mode = mode; this.depth = depth; this.prev = prev + } + + function copyContext(context) { + return new Context(CodeMirror.copyState(context.mode, context.state), + context.mode, + context.depth, + context.prev && copyContext(context.prev)) + } + + CodeMirror.defineMode("jsx", function(config) { + var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false}) + var jsMode = CodeMirror.getMode(config, "javascript") + + function flatXMLIndent(state) { + var tagName = state.tagName + state.tagName = null + var result = xmlMode.indent(state, "") + state.tagName = tagName + return result + } + + function token(stream, state) { + if (state.context.mode == xmlMode) + return xmlToken(stream, state, state.context) + else + return jsToken(stream, state, state.context) + } + + function xmlToken(stream, state, cx) { + if (cx.depth == 2) { // Inside a JS /* */ comment + if (stream.match(/^.*?\*\//)) cx.depth = 1 + else stream.skipToEnd() + return "comment" + } + + if (stream.peek() == "{") { + xmlMode.skipAttribute(cx.state) + + var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context + // If JS starts on same line as tag + if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) { + while (xmlContext.prev && !xmlContext.startOfLine) + xmlContext = xmlContext.prev + // If tag starts the line, use XML indentation level + if (xmlContext.startOfLine) indent -= config.indentUnit + // Else use JS indentation level + else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented + // Else if inside of tag + } else if (cx.depth == 1) { + indent += config.indentUnit + } + + state.context = new Context(CodeMirror.startState(jsMode, indent), + jsMode, 0, state.context) + return null + } + + if (cx.depth == 1) { // Inside of tag + if (stream.peek() == "<") { // Tag inside of tag + xmlMode.skipAttribute(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)), + xmlMode, 0, state.context) + return null + } else if (stream.match("//")) { + stream.skipToEnd() + return "comment" + } else if (stream.match("/*")) { + cx.depth = 2 + return token(stream, state) + } + } + + var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop + if (/\btag\b/.test(style)) { + if (/>$/.test(cur)) { + if (cx.state.context) cx.depth = 0 + else state.context = state.context.prev + } else if (/^ -1) { + stream.backUp(cur.length - stop) + } + return style + } + + function jsToken(stream, state, cx) { + if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) { + jsMode.skipExpression(cx.state) + state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")), + xmlMode, 0, state.context) + return null + } + + var style = jsMode.token(stream, cx.state) + if (!style && cx.depth != null) { + var cur = stream.current() + if (cur == "{") { + cx.depth++ + } else if (cur == "}") { + if (--cx.depth == 0) state.context = state.context.prev + } + } + return style + } + + return { + startState: function() { + return {context: new Context(CodeMirror.startState(jsMode), jsMode)} + }, + + copyState: function(state) { + return {context: copyContext(state.context)} + }, + + token: token, + + indent: function(state, textAfter, fullLine) { + return state.context.mode.indent(state.context.state, textAfter, fullLine) + }, + + innerMode: function(state) { + return state.context + } + } + }, "xml", "javascript") + + CodeMirror.defineMIME("text/jsx", "jsx") +}) diff --git a/public/vendor/codemirror/mode/jsx/test.js b/public/vendor/codemirror/mode/jsx/test.js new file mode 100644 index 00000000..c54a8b24 --- /dev/null +++ b/public/vendor/codemirror/mode/jsx/test.js @@ -0,0 +1,69 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "jsx") + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)) } + + MT("selfclose", + "[keyword var] [def x] [operator =] [bracket&tag <] [tag foo] [bracket&tag />] [operator +] [number 1];") + + MT("openclose", + "([bracket&tag <][tag foo][bracket&tag >]hello [atom &][bracket&tag ][operator ++])") + + MT("attr", + "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &][bracket&tag ][operator ++])") + + MT("braced_attr", + "([bracket&tag <][tag foo] [attribute abc]={[number 10]}[bracket&tag >]hello [atom &][bracket&tag ][operator ++])") + + MT("braced_text", + "([bracket&tag <][tag foo][bracket&tag >]hello {[number 10]} [atom &][bracket&tag ][operator ++])") + + MT("nested_tag", + "([bracket&tag <][tag foo][bracket&tag ><][tag bar][bracket&tag >][operator ++])") + + MT("nested_jsx", + "[keyword return] (", + " [bracket&tag <][tag foo][bracket&tag >]", + " say {[number 1] [operator +] [bracket&tag <][tag bar] [attribute attr]={[number 10]}[bracket&tag />]}!", + " [bracket&tag ][operator ++]", + ")") + + MT("preserve_js_context", + "[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]") + + MT("line_comment", + "([bracket&tag <][tag foo] [comment // hello]", + " [bracket&tag >][operator ++])") + + MT("line_comment_not_in_tag", + "([bracket&tag <][tag foo][bracket&tag >] // hello", + " [bracket&tag ][operator ++])") + + MT("block_comment", + "([bracket&tag <][tag foo] [comment /* hello]", + "[comment line 2]", + "[comment line 3 */] [bracket&tag >][operator ++])") + + MT("block_comment_not_in_tag", + "([bracket&tag <][tag foo][bracket&tag >]/* hello", + " line 2", + " line 3 */ [bracket&tag ][operator ++])") + + MT("missing_attr", + "([bracket&tag <][tag foo] [attribute selected][bracket&tag />][operator ++])") + + MT("indent_js", + "([bracket&tag <][tag foo][bracket&tag >]", + " [bracket&tag <][tag bar] [attribute baz]={[keyword function]() {", + " [keyword return] [number 10]", + " }}[bracket&tag />]", + " [bracket&tag ])") + + MT("spread", + "([bracket&tag <][tag foo] [attribute bar]={[meta ...][variable baz] [operator /][number 2]}[bracket&tag />])") + + MT("tag_attribute", + "([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])") +})() diff --git a/public/vendor/codemirror/mode/julia/index.html b/public/vendor/codemirror/mode/julia/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js old mode 100755 new mode 100644 index d0a74cef..4471896b --- a/public/vendor/codemirror/mode/julia/julia.js +++ b/public/vendor/codemirror/mode/julia/julia.js @@ -18,35 +18,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return new RegExp("^((" + words.join(")|(") + "))\\b"); } - var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/; + var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/; var delimiters = parserConf.delimiters || /^[;,()[\]{}]/; - var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/; + var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/; var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"]; var blockClosers = ["end", "else", "elseif", "catch", "finally"]; - var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall']; - var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf']; + var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype']; + var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf']; //var stringPrefixes = new RegExp("^[br]?('|\")") - var stringPrefixes = /^(`|'|"{3}|([br]?"))/; + var stringPrefixes = /^(`|'|"{3}|([brv]?"))/; var keywords = wordRegexp(keywordList); var builtins = wordRegexp(builtinList); var openers = wordRegexp(blockOpeners); var closers = wordRegexp(blockClosers); var macro = /^@[_A-Za-z][_A-Za-z0-9]*/; - var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/; + var symbol = /^:[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/; + var typeAnnotation = /^::[^.,;"{()=$\s]+({[^}]*}+)*/; - function in_array(state) { - var ch = cur_scope(state); - if(ch=="[" || ch=="{") { + function inArray(state) { + var ch = currentScope(state); + if (ch == '[') { return true; } - else { - return false; - } + return false; } - function cur_scope(state) { - if(state.scopes.length==0) { + function currentScope(state) { + if (state.scopes.length == 0) { return null; } return state.scopes[state.scopes.length - 1]; @@ -54,20 +53,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { // tokenizers function tokenBase(stream, state) { + //Handle multiline comments + if (stream.match(/^#=\s*/)) { + state.scopes.push('#='); + } + if (currentScope(state) == '#=' && stream.match(/^=#/)) { + state.scopes.pop(); + return 'comment'; + } + if (state.scopes.indexOf('#=') >= 0) { + if (!stream.match(/.*?(?=(#=|=#))/)) { + stream.skipToEnd(); + } + return 'comment'; + } + // Handle scope changes - var leaving_expr = state.leaving_expr; - if(stream.sol()) { - leaving_expr = false; + var leavingExpr = state.leavingExpr; + if (stream.sol()) { + leavingExpr = false; } - state.leaving_expr = false; - if(leaving_expr) { - if(stream.match(/^'+/)) { + state.leavingExpr = false; + if (leavingExpr) { + if (stream.match(/^'+/)) { return 'operator'; } - } - if(stream.match(/^\.{2,3}/)) { + if (stream.match(/^\.{2,3}/)) { return 'operator'; } @@ -76,56 +89,51 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { } var ch = stream.peek(); - // Handle Comments + + // Handle single line comments if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - if(ch==='[') { - state.scopes.push("["); + stream.skipToEnd(); + return 'comment'; } - if(ch==='{') { - state.scopes.push("{"); + if (ch === '[') { + state.scopes.push('['); } - var scope=cur_scope(state); + var scope = currentScope(state); - if(scope==='[' && ch===']') { + if (scope == '[' && ch === ']') { state.scopes.pop(); - state.leaving_expr=true; + state.leavingExpr = true; } - if(scope==='{' && ch==='}') { + if (scope == '(' && ch === ')') { state.scopes.pop(); - state.leaving_expr=true; - } - - if(ch===')') { - state.leaving_expr = true; + state.leavingExpr = true; } var match; - if(!in_array(state) && (match=stream.match(openers, false))) { + if (!inArray(state) && (match=stream.match(openers, false))) { state.scopes.push(match); } - if(!in_array(state) && stream.match(closers, false)) { + if (!inArray(state) && stream.match(closers, false)) { state.scopes.pop(); } - if(in_array(state)) { - if(stream.match(/^end/)) { + if (inArray(state)) { + if (state.lastToken == 'end' && stream.match(/^:/)) { + return 'operator'; + } + if (stream.match(/^end/)) { return 'number'; } - } - if(stream.match(/^=>/)) { + if (stream.match(/^=>/)) { return 'operator'; } - // Handle Number Literals if (stream.match(/^[0-9\.]/, false)) { var imMatcher = RegExp(/^im\b/); @@ -134,10 +142,11 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; } if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; } if (stream.match(/^\.\d+/)) { floatLiteral = true; } + if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { floatLiteral = true; } if (floatLiteral) { // Float literals may be "imaginary" stream.match(imMatcher); - state.leaving_expr = true; + state.leavingExpr = true; return 'number'; } // Integers @@ -157,18 +166,27 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { if (intLiteral) { // Integer literals may be "long" stream.match(imMatcher); - state.leaving_expr = true; + state.leavingExpr = true; return 'number'; } } - if(stream.match(/^(::)|(<:)/)) { + if (stream.match(/^<:/)) { return 'operator'; } + if (stream.match(typeAnnotation)) { + return 'builtin'; + } + // Handle symbols - if(!leaving_expr && stream.match(symbol)) { - return 'string'; + if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) { + return 'builtin'; + } + + // Handle parametric types + if (stream.match(/^{[^}]*}(?=\()/)) { + return 'builtin'; } // Handle operators and Delimiters @@ -176,7 +194,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return 'operator'; } - // Handle Strings if (stream.match(stringPrefixes)) { state.tokenize = tokenStringFactory(stream.current()); @@ -187,7 +204,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return 'meta'; } - if (stream.match(delimiters)) { return null; } @@ -200,21 +216,74 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return 'builtin'; } + var isDefinition = state.isDefinition || + state.lastToken == 'function' || + state.lastToken == 'macro' || + state.lastToken == 'type' || + state.lastToken == 'immutable'; if (stream.match(identifiers)) { - state.leaving_expr=true; + if (isDefinition) { + if (stream.peek() === '.') { + state.isDefinition = true; + return 'variable'; + } + state.isDefinition = false; + return 'def'; + } + if (stream.match(/^({[^}]*})*\(/, false)) { + return callOrDef(stream, state); + } + state.leavingExpr = true; return 'variable'; } + // Handle non-detected items stream.next(); return ERRORCLASS; } + function callOrDef(stream, state) { + var match = stream.match(/^(\(\s*)/); + if (match) { + if (state.firstParenPos < 0) + state.firstParenPos = state.scopes.length; + state.scopes.push('('); + state.charsAdvanced += match[1].length; + } + if (currentScope(state) == '(' && stream.match(/^\)/)) { + state.scopes.pop(); + state.charsAdvanced += 1; + if (state.scopes.length <= state.firstParenPos) { + var isDefinition = stream.match(/^\s*?=(?!=)/, false); + stream.backUp(state.charsAdvanced); + state.firstParenPos = -1; + state.charsAdvanced = 0; + if (isDefinition) + return 'def'; + return 'builtin'; + } + } + // Unfortunately javascript does not support multiline strings, so we have + // to undo anything done upto here if a function call or definition splits + // over two or more lines. + if (stream.match(/^$/g, false)) { + stream.backUp(state.charsAdvanced); + while (state.scopes.length > state.firstParenPos + 1) + state.scopes.pop(); + state.firstParenPos = -1; + state.charsAdvanced = 0; + return 'builtin'; + } + state.charsAdvanced += stream.match(/^([^()]*)/)[1].length; + return callOrDef(stream, state); + } + function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { + while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { delimiter = delimiter.substr(1); } - var singleline = delimiter.length == 1; + var singleline = delimiter == "'"; var OUTCLASS = 'string'; function tokenString(stream, state) { @@ -245,45 +314,41 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) { return tokenString; } - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style === null && state.lastStyle === 'meta') { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = 'meta'; - } - return style; - } - - return style; - } - var external = { startState: function() { return { tokenize: tokenBase, scopes: [], - leaving_expr: false + lastToken: null, + leavingExpr: false, + isDefinition: false, + charsAdvanced: 0, + firstParenPos: -1 }; }, token: function(stream, state) { - var style = tokenLexer(stream, state); - state.lastStyle = style; + var style = state.tokenize(stream, state); + var current = stream.current(); + + if (current && style) { + state.lastToken = current; + } + + // Handle '.' connected identifiers + if (current === '.') { + style = stream.match(identifiers, false) || stream.match(macro, false) || + stream.match(/\(/, false) ? 'operator' : ERRORCLASS; + } return style; }, indent: function(state, textAfter) { var delta = 0; - if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") { + if (textAfter == "end" || textAfter == "]" || textAfter == "}" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") { delta = -1; } - return (state.scopes.length + delta) * 4; + return (state.scopes.length + delta) * _conf.indentUnit; }, lineComment: "#", diff --git a/public/vendor/codemirror/mode/kotlin/index.html b/public/vendor/codemirror/mode/kotlin/index.html deleted file mode 100755 index 859e109f..00000000 --- a/public/vendor/codemirror/mode/kotlin/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -CodeMirror: Kotlin mode - - - - - - - - - -
    -

    Kotlin mode

    - - -
    - - -

    Mode for Kotlin (http://kotlin.jetbrains.org/)

    -

    Developed by Hadi Hariri (https://github.com/hhariri).

    -

    MIME type defined: text/x-kotlin.

    -
    diff --git a/public/vendor/codemirror/mode/kotlin/kotlin.js b/public/vendor/codemirror/mode/kotlin/kotlin.js deleted file mode 100755 index e9a6a94e..00000000 --- a/public/vendor/codemirror/mode/kotlin/kotlin.js +++ /dev/null @@ -1,284 +0,0 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -(function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); - else // Plain browser env - mod(CodeMirror); -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("kotlin", function (config, parserConfig) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var multiLineStrings = parserConfig.multiLineStrings; - - var keywords = words( - "package continue return object while break class data trait interface throw super" + - " when type this else This try val var fun for is in if do as true false null get set"); - var softKeywords = words("import" + - " where by get set abstract enum open annotation override private public internal" + - " protected catch out vararg inline finally final ref"); - var blockKeywords = words("catch class do else finally for if where try while enum"); - var atoms = words("null true false this"); - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - // Wildcard import w/o trailing semicolon (import smth.*) - if (ch == "." && stream.eat("*")) { - return "word"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null; - } - if (/\d/.test(ch)) { - if (stream.eat(/eE/)) { - stream.eat(/\+\-/); - stream.eatWhile(/\d/); - } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken)) { - return startString(ch, stream, state); - } - } - // Commented - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[\-+*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[\-+*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { - return "atom"; - } - if (softKeywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "softKeyword"; - } - - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - return "word"; - } - - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { - break; - } - if (stream.match(quote + quote)) { - end = true; - break; - } - } - - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - - if (next == "$" && !escaped && !stream.eat(" ")) { - state.tokenize.push(tokenBaseUntilSpace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (multiLineStrings) - state.tokenize.push(t); - if (end) state.tokenize.pop(); - return "string"; - } - - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length - 1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - - t.isBase = true; - return t; - } - - function tokenBaseUntilSpace() { - function t(stream, state) { - if (stream.eat(/[\w]/)) { - var isWord = stream.eatWhile(/[\w]/); - if (isWord) { - state.tokenize.pop(); - return "word"; - } - } - state.tokenize.pop(); - return "string"; - } - - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function (basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function (stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken)) { - popContext(state); - ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length - 1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function (state, textAfter) { - if (!state.tokenize[state.tokenize.length - 1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") { - return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - } - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - closeBrackets: {triples: "'\""}, - electricChars: "{}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - lineComment: "//" - }; -}); - -CodeMirror.defineMIME("text/x-kotlin", "kotlin"); - -}); diff --git a/public/vendor/codemirror/mode/livescript/index.html b/public/vendor/codemirror/mode/livescript/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/lua/index.html b/public/vendor/codemirror/mode/lua/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/lua/lua.js b/public/vendor/codemirror/mode/lua/lua.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/markdown/index.html b/public/vendor/codemirror/mode/markdown/index.html old mode 100755 new mode 100644 index c3bb8df9..15660c26 --- a/public/vendor/codemirror/mode/markdown/index.html +++ b/public/vendor/codemirror/mode/markdown/index.html @@ -350,8 +350,10 @@ Output: }); -

    Optionally depends on the XML mode for properly highlighted inline XML blocks.

    +

    You might want to use the Github-Flavored Markdown mode instead, which adds support for fenced code blocks and a few other things.

    +

    Optionally depends on the XML mode for properly highlighted inline XML blocks.

    +

    MIME types defined: text/x-markdown.

    Parsing/Highlighting Tests: normal, verbose.

    diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js old mode 100755 new mode 100644 index bef37b8a..70889205 --- a/public/vendor/codemirror/mode/markdown/markdown.js +++ b/public/vendor/codemirror/mode/markdown/markdown.js @@ -39,8 +39,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (modeCfg.underscoresBreakWords === undefined) modeCfg.underscoresBreakWords = true; - // Turn on fenced code blocks? ("```" to start/end) - if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false; + // Use `fencedCodeBlocks` to configure fenced code blocks. false to + // disable, string to specify a precise regexp that the fence should + // match, and true to allow three or more backticks or tildes (as + // per CommonMark). // Turn on task lists? ("- [ ] " and "- [x] ") if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; @@ -49,32 +51,46 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (modeCfg.strikethrough === undefined) modeCfg.strikethrough = false; + // Allow token types to be overridden by user-provided token types. + if (modeCfg.tokenTypeOverrides === undefined) + modeCfg.tokenTypeOverrides = {}; + var codeDepth = 0; - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list1 = 'variable-2' - , list2 = 'variable-3' - , list3 = 'keyword' - , hr = 'hr' - , image = 'tag' - , formatting = 'formatting' - , linkinline = 'link' - , linkemail = 'link' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong' - , strikethrough = 'strikethrough'; + var tokenTypes = { + header: "header", + code: "comment", + quote: "quote", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + hr: "hr", + image: "tag", + formatting: "formatting", + linkInline: "link", + linkEmail: "link", + linkText: "link", + linkHref: "string", + em: "em", + strong: "strong", + strikethrough: "strikethrough" + }; + + for (var tokenType in tokenTypes) { + if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { + tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; + } + } var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ , ulRE = /^[*\-+]\s+/ , olRE = /^[0-9]+([.)])\s+/ , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE - , atxHeaderRE = /^(#+)(?: |$)/ + , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ - , textRE = /^[^#!\[\]*_\\<>` "'(~]+/; + , textRE = /^[^#!\[\]*_\\<>` "'(~]+/ + , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) + + ")[ \\t]*([\\w+#]*)"); function switchInline(stream, state, f) { state.f = state.inline = f; @@ -86,6 +102,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return f(stream, state); } + function lineIsEmpty(line) { + return !line || !/\S/.test(line.string) + } // Blocks @@ -110,7 +129,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.trailingSpace = 0; state.trailingSpaceNewLine = false; // Mark this line as blank - state.thisLineHasContent = false; + state.prevLine = state.thisLine + state.thisLine = null return null; } @@ -141,10 +161,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { var match = null; if (state.indentationDiff >= 4) { stream.skipToEnd(); - if (prevLineIsIndentedCode || !state.prevLineHasContent) { + if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) { state.indentation -= 4; state.indentedCode = true; - return code; + return tokenTypes.code; } else { return null; } @@ -155,7 +175,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (modeCfg.highlightFormatting) state.formatting = "header"; state.f = state.inline; return getType(state); - } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { + } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList && + !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { state.header = match[0].charAt(0) == '=' ? 1 : 2; if (modeCfg.highlightFormatting) state.formatting = "header"; state.f = state.inline; @@ -169,8 +190,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return switchInline(stream, state, footnoteLink); } else if (stream.match(hrRE, true)) { state.hr = true; - return hr; - } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { + return tokenTypes.hr; + } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { var listType = null; if (stream.match(ulRE, true)) { listType = 'ul'; @@ -178,7 +199,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { stream.match(olRE, true); listType = 'ol'; } - state.indentation += 4; + state.indentation = stream.column() + stream.current().length; state.list = true; state.listDepth++; if (modeCfg.taskLists && stream.match(taskListRE, false)) { @@ -187,9 +208,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { state.f = state.inline; if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; return getType(state); - } else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) { + } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) { + state.fencedChars = match[1] // try switching mode - state.localMode = getMode(RegExp.$1); + state.localMode = getMode(match[2]); if (state.localMode) state.localState = state.localMode.startState(); state.f = state.block = local; if (modeCfg.highlightFormatting) state.formatting = "code-block"; @@ -202,7 +224,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { function htmlBlock(stream, state) { var style = htmlMode.token(stream, state.htmlState); - if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) || + if ((htmlFound && state.htmlState.tagStart === null && + (!state.htmlState.context && state.htmlState.tokenize.isInText)) || (state.md_inside && stream.current().indexOf(">") > -1)) { state.f = inlineNormal; state.block = blockNormal; @@ -212,7 +235,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } function local(stream, state) { - if (stream.sol() && stream.match("```", false)) { + if (stream.sol() && state.fencedChars && stream.match(state.fencedChars, false)) { state.localMode = state.localState = null; state.f = state.block = leavingLocal; return null; @@ -220,14 +243,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return state.localMode.token(stream, state.localState); } else { stream.skipToEnd(); - return code; + return tokenTypes.code; } } function leavingLocal(stream, state) { - stream.match("```"); + stream.match(state.fencedChars); state.block = blockNormal; state.f = inlineNormal; + state.fencedChars = null; if (modeCfg.highlightFormatting) state.formatting = "code-block"; state.code = true; var returnType = getType(state); @@ -240,22 +264,22 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { var styles = []; if (state.formatting) { - styles.push(formatting); + styles.push(tokenTypes.formatting); if (typeof state.formatting === "string") state.formatting = [state.formatting]; for (var i = 0; i < state.formatting.length; i++) { - styles.push(formatting + "-" + state.formatting[i]); + styles.push(tokenTypes.formatting + "-" + state.formatting[i]); if (state.formatting[i] === "header") { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.header); + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); } // Add `formatting-quote` and `formatting-quote-#` for blockquotes // Add `error` instead if the maximum blockquote nesting depth is passed if (state.formatting[i] === "quote") { if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote); + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); } else { styles.push("error"); } @@ -273,38 +297,36 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } if (state.linkHref) { - styles.push(linkhref, "url"); + styles.push(tokenTypes.linkHref, "url"); } else { // Only apply inline styles to non-url text - if (state.strong) { styles.push(strong); } - if (state.em) { styles.push(em); } - if (state.strikethrough) { styles.push(strikethrough); } - - if (state.linkText) { styles.push(linktext); } - - if (state.code) { styles.push(code); } + if (state.strong) { styles.push(tokenTypes.strong); } + if (state.em) { styles.push(tokenTypes.em); } + if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } + if (state.linkText) { styles.push(tokenTypes.linkText); } + if (state.code) { styles.push(tokenTypes.code); } } - if (state.header) { styles.push(header); styles.push(header + "-" + state.header); } + if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } if (state.quote) { - styles.push(quote); + styles.push(tokenTypes.quote); // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { - styles.push(quote + "-" + state.quote); + styles.push(tokenTypes.quote + "-" + state.quote); } else { - styles.push(quote + "-" + modeCfg.maxBlockquoteDepth); + styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); } } if (state.list !== false) { var listMod = (state.listDepth - 1) % 3; if (!listMod) { - styles.push(list1); + styles.push(tokenTypes.list1); } else if (listMod === 1) { - styles.push(list2); + styles.push(tokenTypes.list2); } else { - styles.push(list3); + styles.push(tokenTypes.list3); } } @@ -360,7 +382,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { stream.next(); if (modeCfg.highlightFormatting) { var type = getType(state); - return type ? type + " formatting-escape" : "formatting-escape"; + var formattingEscape = tokenTypes.formatting + "-escape"; + return type ? type + " " + formattingEscape : formattingEscape; } } @@ -374,7 +397,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; if (stream.match(new RegExp(regex), true)) { - return linkhref; + return tokenTypes.linkHref; } } @@ -405,7 +428,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { stream.match(/\[[^\]]*\]/); state.inline = state.f = linkHref; - return image; + return tokenTypes.image; } if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) { @@ -431,7 +454,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } else { type = ""; } - return type + linkinline; + return type + tokenTypes.linkInline; } if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { @@ -443,15 +466,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } else { type = ""; } - return type + linkemail; + return type + tokenTypes.linkEmail; } - if (ch === '<' && stream.match(/^\w/, false)) { - if (stream.string.indexOf(">") != -1) { - var atts = stream.string.substring(1,stream.string.indexOf(">")); - if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) { - state.md_inside = true; - } + if (ch === '<' && stream.match(/^(!--|\w)/, false)) { + var end = stream.string.indexOf(">", stream.pos); + if (end != -1) { + var atts = stream.string.substring(stream.start, end); + if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; } stream.backUp(1); state.htmlState = CodeMirror.startState(htmlMode); @@ -553,12 +575,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } else { type = ""; } - return type + linkinline; + return type + tokenTypes.linkInline; } stream.match(/^[^>]+/, true); - return linkinline; + return tokenTypes.linkInline; } function linkHref(stream, state) { @@ -598,7 +620,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { } function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, false)) { + if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { state.f = footnoteLinkInside; stream.next(); // Consume [ if (modeCfg.highlightFormatting) state.formatting = "link"; @@ -617,9 +639,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return returnType; } - stream.match(/^[^\]]+/, true); + stream.match(/^([^\]\\]|\\.)+/, true); - return linktext; + return tokenTypes.linkText; } function footnoteUrl(stream, state) { @@ -636,7 +658,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); } state.f = state.inline = inlineNormal; - return linkhref + " url"; + return tokenTypes.linkHref + " url"; } var savedInlineRE = []; @@ -656,8 +678,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return { f: blockNormal, - prevLineHasContent: false, - thisLineHasContent: false, + prevLine: null, + thisLine: null, block: blockNormal, htmlState: null, @@ -680,7 +702,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { quote: 0, trailingSpace: 0, trailingSpaceNewLine: false, - strikethrough: false + strikethrough: false, + fencedChars: null }; }, @@ -688,8 +711,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { return { f: s.f, - prevLineHasContent: s.prevLineHasContent, - thisLineHasContent: s.thisLineHasContent, + prevLine: s.prevLine, + thisLine: s.thisLine, block: s.block, htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), @@ -702,6 +725,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { text: s.text, formatting: false, linkTitle: s.linkTitle, + code: s.code, em: s.em, strong: s.strong, strikethrough: s.strikethrough, @@ -714,7 +738,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { indentedCode: s.indentedCode, trailingSpace: s.trailingSpace, trailingSpaceNewLine: s.trailingSpaceNewLine, - md_inside: s.md_inside + md_inside: s.md_inside, + fencedChars: s.fencedChars }; }, @@ -723,28 +748,25 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { // Reset state.formatting state.formatting = false; - if (stream.sol()) { - var forceBlankLine = !!state.header || state.hr; + if (stream != state.thisLine) { + var forceBlankLine = state.header || state.hr; // Reset state.header and state.hr state.header = 0; state.hr = false; if (stream.match(/^\s*$/, true) || forceBlankLine) { - state.prevLineHasContent = false; blankLine(state); - return forceBlankLine ? this.token(stream, state) : null; - } else { - state.prevLineHasContent = state.thisLineHasContent; - state.thisLineHasContent = true; + if (!forceBlankLine) return null + state.prevLine = null } + state.prevLine = state.thisLine + state.thisLine = stream + // Reset state.taskList state.taskList = false; - // Reset state.code - state.code = false; - // Reset state.trailingSpace state.trailingSpace = 0; state.trailingSpaceNewLine = false; diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js old mode 100755 new mode 100644 index 7cd0bf4b..6d7829fa --- a/public/vendor/codemirror/mode/markdown/test.js +++ b/public/vendor/codemirror/mode/markdown/test.js @@ -6,6 +6,39 @@ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true}); function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); } + var modeAtxNoSpace = CodeMirror.getMode({tabSize: 4}, {name: "markdown", allowAtxHeaderWithoutSpace: true}); + function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.prototype.slice.call(arguments, 1)); } + var modeFenced = CodeMirror.getMode({tabSize: 4}, {name: "markdown", fencedCodeBlocks: true}); + function FencedTest(name) { test.mode(name, modeFenced, Array.prototype.slice.call(arguments, 1)); } + var modeOverrideClasses = CodeMirror.getMode({tabsize: 4}, { + name: "markdown", + strikethrough: true, + tokenTypeOverrides: { + "header" : "override-header", + "code" : "override-code", + "quote" : "override-quote", + "list1" : "override-list1", + "list2" : "override-list2", + "list3" : "override-list3", + "hr" : "override-hr", + "image" : "override-image", + "linkInline" : "override-link-inline", + "linkEmail" : "override-link-email", + "linkText" : "override-link-text", + "linkHref" : "override-link-href", + "em" : "override-em", + "strong" : "override-strong", + "strikethrough" : "override-strikethrough" + }}); + function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClasses, Array.prototype.slice.call(arguments, 1)); } + var modeFormattingOverride = CodeMirror.getMode({tabsize: 4}, { + name: "markdown", + highlightFormatting: true, + tokenTypeOverrides: { + "formatting" : "override-formatting" + }}); + function FormatTokenTypeOverrideTest(name) { test.mode(name, modeFormattingOverride, Array.prototype.slice.call(arguments, 1)); } + FT("formatting_emAsterisk", "[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]"); @@ -110,7 +143,7 @@ // Block code using single backtick (shouldn't work) MT("blockCodeSingleBacktick", "[comment `]", - "foo", + "[comment foo]", "[comment `]"); // Unclosed backticks @@ -173,6 +206,16 @@ MT("noAtxH1WithoutSpace", "#5 bolt"); + // CommonMark requires a space after # but most parsers don't + AtxNoSpaceTest("atxNoSpaceAllowed_H1NoSpace", + "[header&header-1 #foo]"); + + AtxNoSpaceTest("atxNoSpaceAllowed_H4NoSpace", + "[header&header-4 ####foo]"); + + AtxNoSpaceTest("atxNoSpaceAllowed_H1Space", + "[header&header-1 # foo]"); + // Inline styles should be parsed inside headers MT("atxH1inline", "[header&header-1 # foo ][header&header-1&em *bar*]"); @@ -498,14 +541,14 @@ "", " [variable-3 * bar]", "", - " [variable-2 hello]" + " [variable-3 hello]" ); MT("listNested", "[variable-2 * foo]", "", " [variable-3 * bar]", "", - " [variable-3 * foo]" + " [keyword * foo]" ); // Code followed by text @@ -653,6 +696,15 @@ "[link [[foo]]:] [string&url http://example.com/]", "(bar\" hello"); + MT("labelEscape", + "[link [[foo \\]] ]]:] [string&url http://example.com/]"); + + MT("labelEscapeColon", + "[link [[foo \\]]: bar]]:] [string&url http://example.com/]"); + + MT("labelEscapeEnd", + "[[foo\\]]: http://example.com/"); + MT("linkWeb", "[link ] foo"); @@ -760,16 +812,128 @@ "\\", "[em *foo*]"); + // Class override tests + TokenTypeOverrideTest("overrideHeader1", + "[override-header&override-header-1 # Foo]"); + + TokenTypeOverrideTest("overrideHeader2", + "[override-header&override-header-2 ## Foo]"); + + TokenTypeOverrideTest("overrideHeader3", + "[override-header&override-header-3 ### Foo]"); + + TokenTypeOverrideTest("overrideHeader4", + "[override-header&override-header-4 #### Foo]"); + + TokenTypeOverrideTest("overrideHeader5", + "[override-header&override-header-5 ##### Foo]"); + + TokenTypeOverrideTest("overrideHeader6", + "[override-header&override-header-6 ###### Foo]"); + + TokenTypeOverrideTest("overrideCode", + "[override-code `foo`]"); + + TokenTypeOverrideTest("overrideCodeBlock", + "[override-code ```]", + "[override-code foo]", + "[override-code ```]"); + + TokenTypeOverrideTest("overrideQuote", + "[override-quote&override-quote-1 > foo]", + "[override-quote&override-quote-1 > bar]"); + + TokenTypeOverrideTest("overrideQuoteNested", + "[override-quote&override-quote-1 > foo]", + "[override-quote&override-quote-1 >][override-quote&override-quote-2 > bar]", + "[override-quote&override-quote-1 >][override-quote&override-quote-2 >][override-quote&override-quote-3 > baz]"); + + TokenTypeOverrideTest("overrideLists", + "[override-list1 - foo]", + "", + " [override-list2 + bar]", + "", + " [override-list3 * baz]", + "", + " [override-list1 1. qux]", + "", + " [override-list2 - quux]"); + + TokenTypeOverrideTest("overrideHr", + "[override-hr * * *]"); + + TokenTypeOverrideTest("overrideImage", + "[override-image ![[foo]]][override-link-href&url (http://example.com/)]") + + TokenTypeOverrideTest("overrideLinkText", + "[override-link-text [[foo]]][override-link-href&url (http://example.com)]"); + + TokenTypeOverrideTest("overrideLinkEmailAndInline", + "[override-link-email <][override-link-inline foo@example.com>]"); + + TokenTypeOverrideTest("overrideEm", + "[override-em *foo*]"); + + TokenTypeOverrideTest("overrideStrong", + "[override-strong **foo**]"); + + TokenTypeOverrideTest("overrideStrikethrough", + "[override-strikethrough ~~foo~~]"); + + FormatTokenTypeOverrideTest("overrideFormatting", + "[override-formatting-escape \\*]"); // Tests to make sure GFM-specific things aren't getting through MT("taskList", "[variable-2 * [ ]] bar]"); - MT("fencedCodeBlocks", - "[comment ```]", + MT("noFencedCodeBlocks", + "~~~", "foo", - "[comment ```]"); + "~~~"); + + FencedTest("fencedCodeBlocks", + "[comment ```]", + "[comment foo]", + "[comment ```]", + "bar"); + + FencedTest("fencedCodeBlocksMultipleChars", + "[comment `````]", + "[comment foo]", + "[comment ```]", + "[comment foo]", + "[comment `````]", + "bar"); + + FencedTest("fencedCodeBlocksTildes", + "[comment ~~~]", + "[comment foo]", + "[comment ~~~]", + "bar"); + + FencedTest("fencedCodeBlocksTildesMultipleChars", + "[comment ~~~~~]", + "[comment ~~~]", + "[comment foo]", + "[comment ~~~~~]", + "bar"); + + FencedTest("fencedCodeBlocksMultipleChars", + "[comment `````]", + "[comment foo]", + "[comment ```]", + "[comment foo]", + "[comment `````]", + "bar"); + + FencedTest("fencedCodeBlocksMixed", + "[comment ~~~]", + "[comment ```]", + "[comment foo]", + "[comment ~~~]", + "bar"); // Tests that require XML mode diff --git a/public/vendor/codemirror/mode/mathematica/index.html b/public/vendor/codemirror/mode/mathematica/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js old mode 100755 new mode 100644 index bb30c80f..49520717 --- a/public/vendor/codemirror/mode/meta.js +++ b/public/vendor/codemirror/mode/meta.js @@ -14,18 +14,21 @@ CodeMirror.modeInfo = [ {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]}, {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]}, - {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn, asn1"]}, + {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]}, {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i}, + {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]}, {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]}, {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]}, {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]}, {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]}, {name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]}, + {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]}, {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/}, {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]}, {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]}, {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]}, {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]}, + {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]}, {name: "CSS", mime: "text/css", mode: "css", ext: ["css"]}, {name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]}, {name: "D", mime: "text/x-d", mode: "d", ext: ["d"]}, @@ -53,6 +56,7 @@ {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]}, {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, + {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]}, {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]}, {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]}, {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]}, @@ -66,9 +70,10 @@ mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]}, {name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]}, {name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]}, + {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]}, {name: "Jinja2", mime: "null", mode: "jinja2"}, {name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]}, - {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]}, + {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]}, {name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]}, {name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]}, {name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]}, @@ -81,10 +86,12 @@ {name: "MS SQL", mime: "text/x-mssql", mode: "sql"}, {name: "MySQL", mime: "text/x-mysql", mode: "sql"}, {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i}, + {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]}, {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]}, {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]}, {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]}, {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]}, + {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]}, {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]}, {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]}, {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]}, @@ -106,7 +113,7 @@ {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]}, {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]}, {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]}, - {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]}, + {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/}, {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]}, {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]}, {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]}, @@ -116,6 +123,7 @@ {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]}, {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]}, {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]}, + {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]}, {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]}, {name: "MariaDB", mime: "text/x-mariadb", mode: "sql"}, {name: "sTeX", mime: "text/x-stex", mode: "stex"}, @@ -137,10 +145,14 @@ {name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]}, {name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]}, {name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]}, + {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]}, {name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]}, {name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]}, {name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]}, - {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]} + {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}, + {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]}, + {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]}, + {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]} ]; // Ensure all modes have a mime property for backwards compatibility for (var i = 0; i < CodeMirror.modeInfo.length; i++) { diff --git a/public/vendor/codemirror/mode/mirc/index.html b/public/vendor/codemirror/mode/mirc/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/mirc/mirc.js b/public/vendor/codemirror/mode/mirc/mirc.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/mllike/index.html b/public/vendor/codemirror/mode/mllike/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/mllike/mllike.js b/public/vendor/codemirror/mode/mllike/mllike.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/modelica/index.html b/public/vendor/codemirror/mode/modelica/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/modelica/modelica.js b/public/vendor/codemirror/mode/modelica/modelica.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/mscgen/index.html b/public/vendor/codemirror/mode/mscgen/index.html new file mode 100644 index 00000000..8c28ee62 --- /dev/null +++ b/public/vendor/codemirror/mode/mscgen/index.html @@ -0,0 +1,151 @@ + + +CodeMirror: MscGen mode + + + + + + + + + +
    +

    MscGen mode

    + +
    + +

    Xù mode

    + +
    + +

    MsGenny mode

    +
    + +

    + Simple mode for highlighting MscGen and two derived sequence + chart languages. +

    + + + +

    MIME types defined: + text/x-mscgen + text/x-xu + text/x-msgenny +

    + +
    diff --git a/public/vendor/codemirror/mode/mscgen/mscgen.js b/public/vendor/codemirror/mode/mscgen/mscgen.js new file mode 100644 index 00000000..d61b4706 --- /dev/null +++ b/public/vendor/codemirror/mode/mscgen/mscgen.js @@ -0,0 +1,169 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// mode(s) for the sequence chart dsl's mscgen, xù and msgenny +// For more information on mscgen, see the site of the original author: +// http://www.mcternan.me.uk/mscgen +// +// This mode for mscgen and the two derivative languages were +// originally made for use in the mscgen_js interpreter +// (https://sverweij.github.io/mscgen_js) + +(function(mod) { + if ( typeof exports == "object" && typeof module == "object")// CommonJS + mod(require("../../lib/codemirror")); + else if ( typeof define == "function" && define.amd)// AMD + define(["../../lib/codemirror"], mod); + else// Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var languages = { + mscgen: { + "keywords" : ["msc"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + xu: { + "keywords" : ["msc"], + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"], + "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + }, + msgenny: { + "keywords" : null, + "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"], + "attributes" : null, + "brackets" : ["\\{", "\\}"], + "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"], + "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"], + "singlecomment" : ["//", "#"], + "operators" : ["="] + } + } + + CodeMirror.defineMode("mscgen", function(_, modeConfig) { + var language = languages[modeConfig && modeConfig.language || "mscgen"] + return { + startState: startStateFn, + copyState: copyStateFn, + token: produceTokenFunction(language), + lineComment : "#", + blockCommentStart : "/*", + blockCommentEnd : "*/" + }; + }); + + CodeMirror.defineMIME("text/x-mscgen", "mscgen"); + CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"}); + CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"}); + + function wordRegexpBoundary(pWords) { + return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i"); + } + + function wordRegexp(pWords) { + return new RegExp("(" + pWords.join("|") + ")", "i"); + } + + function startStateFn() { + return { + inComment : false, + inString : false, + inAttributeList : false, + inScript : false + }; + } + + function copyStateFn(pState) { + return { + inComment : pState.inComment, + inString : pState.inString, + inAttributeList : pState.inAttributeList, + inScript : pState.inScript + }; + } + + function produceTokenFunction(pConfig) { + + return function(pStream, pState) { + if (pStream.match(wordRegexp(pConfig.brackets), true, true)) { + return "bracket"; + } + /* comments */ + if (!pState.inComment) { + if (pStream.match(/\/\*[^\*\/]*/, true, true)) { + pState.inComment = true; + return "comment"; + } + if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) { + pStream.skipToEnd(); + return "comment"; + } + } + if (pState.inComment) { + if (pStream.match(/[^\*\/]*\*\//, true, true)) + pState.inComment = false; + else + pStream.skipToEnd(); + return "comment"; + } + /* strings */ + if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) { + pState.inString = true; + return "string"; + } + if (pState.inString) { + if (pStream.match(/[^\"]*\"/, true, true)) + pState.inString = false; + else + pStream.skipToEnd(); + return "string"; + } + /* keywords & operators */ + if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.options), true, true)) + return "keyword"; + + if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true)) + return "keyword"; + + if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true)) + return "keyword"; + + if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true)) + return "operator"; + + /* attribute lists */ + if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) { + pConfig.inAttributeList = true; + return "bracket"; + } + if (pConfig.inAttributeList) { + if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) { + return "attribute"; + } + if (pStream.match(/]/, true, true)) { + pConfig.inAttributeList = false; + return "bracket"; + } + } + + pStream.next(); + return "base"; + }; + } + +}); diff --git a/public/vendor/codemirror/mode/mscgen/mscgen_test.js b/public/vendor/codemirror/mode/mscgen/mscgen_test.js new file mode 100644 index 00000000..e319a399 --- /dev/null +++ b/public/vendor/codemirror/mode/mscgen/mscgen_test.js @@ -0,0 +1,75 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("empty chart", + "[keyword msc][bracket {]", + "[base ]", + "[bracket }]" + ); + + MT("comments", + "[comment // a single line comment]", + "[comment # another single line comment /* and */ ignored here]", + "[comment /* A multi-line comment even though it contains]", + "[comment msc keywords and \"quoted text\"*/]"); + + MT("strings", + "[string \"// a string\"]", + "[string \"a string running over]", + "[string two lines\"]", + "[string \"with \\\"escaped quote\"]" + ); + + MT("xù/ msgenny keywords classify as 'base'", + "[base watermark]", + "[base alt loop opt ref else break par seq assert]" + ); + + MT("mscgen options classify as keyword", + "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" + ); + + MT("mscgen arcs classify as keyword", + "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", + "[keyword |||...---]", "[keyword ..--==::]", + "[keyword ->]", "[keyword <-]", "[keyword <->]", + "[keyword =>]", "[keyword <=]", "[keyword <=>]", + "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", + "[keyword >>]", "[keyword <<]", "[keyword <<>>]", + "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", + "[keyword :>]", "[keyword <:]", "[keyword <:>]" + ); + + MT("within an attribute list, attributes classify as attribute", + "[bracket [[][attribute label]", + "[attribute id]","[attribute url]","[attribute idurl]", + "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]", + "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]", + "[attribute arcskip][bracket ]]]" + ); + + MT("outside an attribute list, attributes classify as base", + "[base label]", + "[base id]","[base url]","[base idurl]", + "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]", + "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]", + "[base arcskip]" + ); + + MT("a typical program", + "[comment # typical mscgen program]", + "[keyword msc][base ][bracket {]", + "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]", + "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]", + "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]", + "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]", + "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]", + "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]", + "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]", + "[bracket }]" + ); +})(); diff --git a/public/vendor/codemirror/mode/mscgen/msgenny_test.js b/public/vendor/codemirror/mode/mscgen/msgenny_test.js new file mode 100644 index 00000000..80173de0 --- /dev/null +++ b/public/vendor/codemirror/mode/mscgen/msgenny_test.js @@ -0,0 +1,71 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); } + + MT("comments", + "[comment // a single line comment]", + "[comment # another single line comment /* and */ ignored here]", + "[comment /* A multi-line comment even though it contains]", + "[comment msc keywords and \"quoted text\"*/]"); + + MT("strings", + "[string \"// a string\"]", + "[string \"a string running over]", + "[string two lines\"]", + "[string \"with \\\"escaped quote\"]" + ); + + MT("xù/ msgenny keywords classify as 'keyword'", + "[keyword watermark]", + "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]" + ); + + MT("mscgen options classify as keyword", + "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" + ); + + MT("mscgen arcs classify as keyword", + "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", + "[keyword |||...---]", "[keyword ..--==::]", + "[keyword ->]", "[keyword <-]", "[keyword <->]", + "[keyword =>]", "[keyword <=]", "[keyword <=>]", + "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", + "[keyword >>]", "[keyword <<]", "[keyword <<>>]", + "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", + "[keyword :>]", "[keyword <:]", "[keyword <:>]" + ); + + MT("within an attribute list, mscgen/ xù attributes classify as base", + "[base [[label]", + "[base idurl id url]", + "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", + "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", + "[base arcskip]]]" + ); + + MT("outside an attribute list, mscgen/ xù attributes classify as base", + "[base label]", + "[base idurl id url]", + "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]", + "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]", + "[base arcskip]" + ); + + MT("a typical program", + "[comment # typical msgenny program]", + "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]", + "[base a : ][string \"Entity A\"][base ,]", + "[base b : Entity B,]", + "[base c : Entity C;]", + "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]", + "[base a ][keyword alt][base c][bracket {]", + "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]", + "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]", + "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]", + "[bracket }]", + "[base c ][keyword :>][base *: What about me?;]" + ); +})(); diff --git a/public/vendor/codemirror/mode/mscgen/xu_test.js b/public/vendor/codemirror/mode/mscgen/xu_test.js new file mode 100644 index 00000000..f9a50f0a --- /dev/null +++ b/public/vendor/codemirror/mode/mscgen/xu_test.js @@ -0,0 +1,75 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); } + + MT("empty chart", + "[keyword msc][bracket {]", + "[base ]", + "[bracket }]" + ); + + MT("comments", + "[comment // a single line comment]", + "[comment # another single line comment /* and */ ignored here]", + "[comment /* A multi-line comment even though it contains]", + "[comment msc keywords and \"quoted text\"*/]"); + + MT("strings", + "[string \"// a string\"]", + "[string \"a string running over]", + "[string two lines\"]", + "[string \"with \\\"escaped quote\"]" + ); + + MT("xù/ msgenny keywords classify as 'keyword'", + "[keyword watermark]", + "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]" + ); + + MT("mscgen options classify as keyword", + "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]" + ); + + MT("mscgen arcs classify as keyword", + "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]", + "[keyword |||...---]", "[keyword ..--==::]", + "[keyword ->]", "[keyword <-]", "[keyword <->]", + "[keyword =>]", "[keyword <=]", "[keyword <=>]", + "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]", + "[keyword >>]", "[keyword <<]", "[keyword <<>>]", + "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]", + "[keyword :>]", "[keyword <:]", "[keyword <:>]" + ); + + MT("within an attribute list, attributes classify as attribute", + "[bracket [[][attribute label]", + "[attribute id]","[attribute url]","[attribute idurl]", + "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]", + "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]", + "[attribute arcskip][bracket ]]]" + ); + + MT("outside an attribute list, attributes classify as base", + "[base label]", + "[base id]","[base url]","[base idurl]", + "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]", + "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]", + "[base arcskip]" + ); + + MT("a typical program", + "[comment # typical mscgen program]", + "[keyword msc][base ][bracket {]", + "[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]", + "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]", + "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]", + "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]", + "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]", + "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]", + "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]", + "[bracket }]" + ); +})(); diff --git a/public/vendor/codemirror/mode/mumps/index.html b/public/vendor/codemirror/mode/mumps/index.html old mode 100755 new mode 100644 index bd1f69ae..b1f92c21 --- a/public/vendor/codemirror/mode/mumps/index.html +++ b/public/vendor/codemirror/mode/mumps/index.html @@ -1,4 +1,4 @@ - + CodeMirror: MUMPS mode @@ -73,7 +73,7 @@ SET2() ;EF. Return error code (also called from XUSRB) IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434 Q 0 ; - + + + + + + + +
    +

    NSIS mode

    + + + + + + +

    MIME types defined: text/x-nsis.

    +
    \ No newline at end of file diff --git a/public/vendor/codemirror/mode/nsis/nsis.js b/public/vendor/codemirror/mode/nsis/nsis.js new file mode 100644 index 00000000..172207c5 --- /dev/null +++ b/public/vendor/codemirror/mode/nsis/nsis.js @@ -0,0 +1,95 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Author: Jan T. Sott (http://github.com/idleberg) + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineSimpleMode("nsis",{ + start:[ + // Numbers + {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"}, + + // Strings + { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" }, + { regex: /'(?:[^\\']|\\.)*'?/, token: "string" }, + { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" }, + + // Compile Time Commands + {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"}, + + // Conditional Compilation + {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true}, + {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true}, + + // Runtime Commands + {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"}, + {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true}, + {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true}, + + // Command Options + {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"}, + {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"}, + + // LogicLib.nsh + {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true}, + + // FileFunc.nsh + {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true}, + + // Memento.nsh + {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true}, + + // TextFunc.nsh + {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true}, + + // WinVer.nsh + {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true}, + + // WordFunc.nsh + {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true}, + + // x64.nsh + {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true}, + {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true}, + + // Line Comment + {regex: /(#|;).*/, token: "comment"}, + + // Block Comment + {regex: /\/\*/, token: "comment", next: "comment"}, + + // Operator + {regex: /[-+\/*=<>!]+/, token: "operator"}, + + // Variable + {regex: /\$[\w]+/, token: "variable"}, + + // Constant + {regex: /\${[\w]+}/,token: "variable-2"}, + + // Language String + {regex: /\$\([\w]+\)/,token: "variable-3"} + ], + comment: [ + {regex: /.*?\*\//, token: "comment", next: "start"}, + {regex: /.*/, token: "comment"} + ], + meta: { + electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/, + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: ["#", ";"] + } +}); + +CodeMirror.defineMIME("text/x-nsis", "nsis"); +}); diff --git a/public/vendor/codemirror/mode/ntriples/index.html b/public/vendor/codemirror/mode/ntriples/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ntriples/ntriples.js b/public/vendor/codemirror/mode/ntriples/ntriples.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/octave/index.html b/public/vendor/codemirror/mode/octave/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/octave/octave.js b/public/vendor/codemirror/mode/octave/octave.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/oz/index.html b/public/vendor/codemirror/mode/oz/index.html new file mode 100644 index 00000000..febd82a5 --- /dev/null +++ b/public/vendor/codemirror/mode/oz/index.html @@ -0,0 +1,59 @@ + + +CodeMirror: Oz mode + + + + + + + + + + +
    +

    Oz mode

    + +

    MIME type defined: text/x-oz.

    + + +
    diff --git a/public/vendor/codemirror/mode/oz/oz.js b/public/vendor/codemirror/mode/oz/oz.js new file mode 100644 index 00000000..ee8cb0ad --- /dev/null +++ b/public/vendor/codemirror/mode/oz/oz.js @@ -0,0 +1,252 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("oz", function (conf) { + + function wordRegexp(words) { + return new RegExp("^((" + words.join(")|(") + "))\\b"); + } + + var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/; + var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/; + var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/; + + var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch", + "finally", "with", "require", "prepare", "import", "export", "define", "do"]; + var end = ["end"]; + + var atoms = wordRegexp(["true", "false", "nil", "unit"]); + var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex", + "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]); + var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis", + "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]); + var middleKeywords = wordRegexp(middle); + var endKeywords = wordRegexp(end); + + // Tokenizers + function tokenBase(stream, state) { + if (stream.eatSpace()) { + return null; + } + + // Brackets + if(stream.match(/[{}]/)) { + return "bracket"; + } + + // Special [] keyword + if (stream.match(/(\[])/)) { + return "keyword" + } + + // Operators + if (stream.match(tripleOperators) || stream.match(doubleOperators)) { + return "operator"; + } + + // Atoms + if(stream.match(atoms)) { + return 'atom'; + } + + // Opening keywords + var matched = stream.match(openingKeywords); + if (matched) { + if (!state.doInCurrentLine) + state.currentIndent++; + else + state.doInCurrentLine = false; + + // Special matching for signatures + if(matched[0] == "proc" || matched[0] == "fun") + state.tokenize = tokenFunProc; + else if(matched[0] == "class") + state.tokenize = tokenClass; + else if(matched[0] == "meth") + state.tokenize = tokenMeth; + + return 'keyword'; + } + + // Middle and other keywords + if (stream.match(middleKeywords) || stream.match(commonKeywords)) { + return "keyword" + } + + // End keywords + if (stream.match(endKeywords)) { + state.currentIndent--; + return 'keyword'; + } + + // Eat the next char for next comparisons + var ch = stream.next(); + + // Strings + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } + + // Numbers + if (/[~\d]/.test(ch)) { + if (ch == "~") { + if(! /^[0-9]/.test(stream.peek())) + return null; + else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + } + + if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/)) + return "number"; + + return null; + } + + // Comments + if (ch == "%") { + stream.skipToEnd(); + return 'comment'; + } + else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } + } + + // Single operators + if(singleOperators.test(ch)) { + return "operator"; + } + + // If nothing match, we skip the entire alphanumerical block + stream.eatWhile(/\w/); + + return "variable"; + } + + function tokenClass(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "variable-3" + } + + function tokenMeth(stream, state) { + if (stream.eatSpace()) { + return null; + } + stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/); + state.tokenize = tokenBase; + return "def" + } + + function tokenFunProc(stream, state) { + if (stream.eatSpace()) { + return null; + } + + if(!state.hasPassedFirstStage && stream.eat("{")) { + state.hasPassedFirstStage = true; + return "bracket"; + } + else if(state.hasPassedFirstStage) { + stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/); + state.hasPassedFirstStage = false; + state.tokenize = tokenBase; + return "def" + } + else { + state.tokenize = tokenBase; + return null; + } + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return "comment"; + } + + function tokenString(quote) { + return function (stream, state) { + var escaped = false, next, end = false; + while ((next = stream.next()) != null) { + if (next == quote && !escaped) { + end = true; + break; + } + escaped = !escaped && next == "\\"; + } + if (end || !escaped) + state.tokenize = tokenBase; + return "string"; + }; + } + + function buildElectricInputRegEx() { + // Reindentation should occur on [] or on a match of any of + // the block closing keywords, at the end of a line. + var allClosings = middle.concat(end); + return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$"); + } + + return { + + startState: function () { + return { + tokenize: tokenBase, + currentIndent: 0, + doInCurrentLine: false, + hasPassedFirstStage: false + }; + }, + + token: function (stream, state) { + if (stream.sol()) + state.doInCurrentLine = 0; + + return state.tokenize(stream, state); + }, + + indent: function (state, textAfter) { + var trueText = textAfter.replace(/^\s+|\s+$/g, ''); + + if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/)) + return conf.indentUnit * (state.currentIndent - 1); + + if (state.currentIndent < 0) + return 0; + + return state.currentIndent * conf.indentUnit; + }, + fold: "indent", + electricInput: buildElectricInputRegEx(), + lineComment: "%", + blockCommentStart: "/*", + blockCommentEnd: "*/" + }; +}); + +CodeMirror.defineMIME("text/x-oz", "oz"); + +}); diff --git a/public/vendor/codemirror/mode/pascal/index.html b/public/vendor/codemirror/mode/pascal/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/pascal/pascal.js b/public/vendor/codemirror/mode/pascal/pascal.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/pegjs/index.html b/public/vendor/codemirror/mode/pegjs/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/pegjs/pegjs.js b/public/vendor/codemirror/mode/pegjs/pegjs.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/perl/index.html b/public/vendor/codemirror/mode/perl/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/perl/perl.js b/public/vendor/codemirror/mode/perl/perl.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/php/index.html b/public/vendor/codemirror/mode/php/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js old mode 100755 new mode 100644 index 0c3f21e5..22494467 --- a/public/vendor/codemirror/mode/php/php.js +++ b/public/vendor/codemirror/mode/php/php.js @@ -86,7 +86,7 @@ "die echo empty exit eval include include_once isset list require require_once return " + "print unset __halt_compiler self static parent yield insteadof finally"; var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__"; - var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; + var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count"; CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" ")); CodeMirror.registerHelper("wordChars", "php", /[\w$]/); @@ -105,14 +105,15 @@ return "variable-2"; }, "<": function(stream, state) { - if (stream.match(/<")) { state.curMode = htmlMode; state.curState = state.html; + if (!state.php.context.prev) state.php = null; return "meta"; } else { return phpMode.token(stream, state.curState); @@ -190,7 +193,8 @@ return { startState: function() { - var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode); + var html = CodeMirror.startState(htmlMode) + var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null return {html: html, php: php, curMode: parserConfig.startOpen ? phpMode : htmlMode, @@ -200,7 +204,7 @@ copyState: function(state) { var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; + php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur; if (state.curMode == htmlMode) cur = htmlNew; else cur = phpNew; return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, diff --git a/public/vendor/codemirror/mode/php/test.js b/public/vendor/codemirror/mode/php/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/pig/index.html b/public/vendor/codemirror/mode/pig/index.html old mode 100755 new mode 100644 index 984c9a18..ea77f704 --- a/public/vendor/codemirror/mode/pig/index.html +++ b/public/vendor/codemirror/mode/pig/index.html @@ -1,5 +1,4 @@ - - + CodeMirror: Pig Latin mode @@ -51,5 +50,4 @@ STORE c INTO "\path\to\output";

    MIME type defined: text/x-pig (PIG code) - diff --git a/public/vendor/codemirror/mode/pig/pig.js b/public/vendor/codemirror/mode/pig/pig.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/properties/index.html b/public/vendor/codemirror/mode/properties/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/properties/properties.js b/public/vendor/codemirror/mode/properties/properties.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/puppet/index.html b/public/vendor/codemirror/mode/puppet/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/puppet/puppet.js b/public/vendor/codemirror/mode/puppet/puppet.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/python/index.html b/public/vendor/codemirror/mode/python/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js old mode 100755 new mode 100644 index e5a09719..553f2d6f --- a/public/vendor/codemirror/mode/python/python.js +++ b/public/vendor/codemirror/mode/python/python.js @@ -48,18 +48,18 @@ CodeMirror.defineMode("python", function(conf, parserConf) { var ERRORCLASS = "error"; - var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"); - var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); + var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/; + var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/; + var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/; + var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/; if (parserConf.version && parseInt(parserConf.version, 10) == 3){ // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*"); + var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/; + var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/; } else { - var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); + var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/; + var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/; } var hangingIndent = parserConf.hangingIndent || conf.indentUnit; @@ -160,13 +160,16 @@ // Handle operators and Delimiters if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) - return null; + return "punctuation"; if (stream.match(doubleOperators) || stream.match(singleOperators)) return "operator"; if (stream.match(singleDelimiters)) - return null; + return "punctuation"; + + if (state.lastToken == "." && stream.match(identifiers)) + return "property"; if (stream.match(keywords) || stream.match(wordOperators)) return "keyword"; @@ -246,17 +249,6 @@ var style = state.tokenize(stream, state); var current = stream.current(); - // Handle '.' connected identifiers - if (current == ".") { - style = stream.match(identifiers, false) ? null : ERRORCLASS; - if (style == null && state.lastStyle == "meta") { - // Apply 'meta' style to '.' connected identifiers when - // appropriate. - style = "meta"; - } - return style; - } - // Handle decorators if (current == "@"){ if(parserConf.version && parseInt(parserConf.version, 10) == 3){ @@ -267,7 +259,7 @@ } if ((style == "variable" || style == "builtin") - && state.lastStyle == "meta") + && state.lastToken == "meta") style = "meta"; // Handle scope changes. @@ -300,7 +292,6 @@ return { tokenize: tokenBase, scopes: [{offset: basecolumn || 0, type: "py", align: null}], - lastStyle: null, lastToken: null, lambda: false, dedent: 0 @@ -312,11 +303,9 @@ if (addErr) state.errorToken = false; var style = tokenLexer(stream, state); - state.lastStyle = style; - - var current = stream.current(); - if (current && style) - state.lastToken = current; + if (style && style != "comment") + state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style; + if (style == "punctuation") style = null; if (stream.eol() && state.lambda) state.lambda = false; diff --git a/public/vendor/codemirror/mode/q/index.html b/public/vendor/codemirror/mode/q/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/q/q.js b/public/vendor/codemirror/mode/q/q.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/r/index.html b/public/vendor/codemirror/mode/r/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/r/r.js b/public/vendor/codemirror/mode/r/r.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/rpm/changes/index.html b/public/vendor/codemirror/mode/rpm/changes/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/rpm/index.html b/public/vendor/codemirror/mode/rpm/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/rpm/rpm.js b/public/vendor/codemirror/mode/rpm/rpm.js old mode 100755 new mode 100644 index 3bb7cd2f..87cde591 --- a/public/vendor/codemirror/mode/rpm/rpm.js +++ b/public/vendor/codemirror/mode/rpm/rpm.js @@ -34,10 +34,10 @@ CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes"); // Quick and dirty spec file highlighting CodeMirror.defineMode("rpm-spec", function() { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; + var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; + var preamble = /^[a-zA-Z0-9()]+:/; + var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/; var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros var control_flow_simple = /^%(else|endif)/; // rpm control flow macros var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros @@ -55,8 +55,8 @@ CodeMirror.defineMode("rpm-spec", function() { if (ch == "#") { stream.skipToEnd(); return "comment"; } if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } + if (stream.match(preamble)) { return "header"; } + if (stream.match(section)) { return "atom"; } } if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' @@ -73,21 +73,29 @@ CodeMirror.defineMode("rpm-spec", function() { if (stream.eol()) { state.controlFlow = false; } } - if (stream.match(arch)) { return "number"; } + if (stream.match(arch)) { + if (stream.eol()) { state.controlFlow = false; } + return "number"; + } // Macros like '%make_install' or '%attr(0775,root,root)' if (stream.match(/^%[\w]+/)) { if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; + return "keyword"; } if (state.macroParameters) { if (stream.match(/^\d+/)) { return "number";} if (stream.match(/^\)/)) { state.macroParameters = false; - return "macro"; + return "keyword"; } } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' + + // Macros like '%{defined fedora}' + if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) { + if (stream.eol()) { state.controlFlow = false; } + return "def"; + } //TODO: Include bash script sub-parser (CodeMirror supports that) stream.next(); diff --git a/public/vendor/codemirror/mode/rst/index.html b/public/vendor/codemirror/mode/rst/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/rst/rst.js b/public/vendor/codemirror/mode/rst/rst.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ruby/index.html b/public/vendor/codemirror/mode/ruby/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ruby/ruby.js b/public/vendor/codemirror/mode/ruby/ruby.js old mode 100755 new mode 100644 index eab9d9da..10cad8d9 --- a/public/vendor/codemirror/mode/ruby/ruby.js +++ b/public/vendor/codemirror/mode/ruby/ruby.js @@ -25,7 +25,7 @@ CodeMirror.defineMode("ruby", function(config) { "caller", "lambda", "proc", "public", "protected", "private", "require", "load", "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__" ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "module", "then", + var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then", "catch", "loop", "proc", "begin"]); var dedentWords = wordObj(["end", "until"]); var matching = {"[": "]", "{": "}", "(": ")"}; @@ -37,7 +37,6 @@ CodeMirror.defineMode("ruby", function(config) { } function tokenBase(stream, state) { - curPunc = null; if (stream.sol() && stream.match("=begin") && stream.eol()) { state.tokenize.push(readBlockComment); return "comment"; @@ -232,6 +231,7 @@ CodeMirror.defineMode("ruby", function(config) { }, token: function(stream, state) { + curPunc = null; if (stream.sol()) state.indented = stream.indentation(); var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; var thisTok = curPunc; @@ -275,7 +275,7 @@ CodeMirror.defineMode("ruby", function(config) { (state.continuedLine ? config.indentUnit : 0); }, - electricChars: "}de", // enD and rescuE + electricInput: /^\s*(?:end|rescue|\})$/, lineComment: "#" }; }); diff --git a/public/vendor/codemirror/mode/ruby/test.js b/public/vendor/codemirror/mode/ruby/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/rust/index.html b/public/vendor/codemirror/mode/rust/index.html old mode 100755 new mode 100644 index 407e84f2..1fe0ad1e --- a/public/vendor/codemirror/mode/rust/index.html +++ b/public/vendor/codemirror/mode/rust/index.html @@ -6,6 +6,7 @@ +

    diff --git a/public/vendor/codemirror/mode/rust/rust.js b/public/vendor/codemirror/mode/rust/rust.js old mode 100755 new mode 100644 index 2bffa9a6..8558b53f --- a/public/vendor/codemirror/mode/rust/rust.js +++ b/public/vendor/codemirror/mode/rust/rust.js @@ -3,449 +3,69 @@ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror")); + mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror"], mod); + define(["../../lib/codemirror", "../../addon/mode/simple"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; -CodeMirror.defineMode("rust", function() { - var indentUnit = 4, altIndentUnit = 2; - var valKeywords = { - "if": "if-style", "while": "if-style", "loop": "else-style", "else": "else-style", - "do": "else-style", "ret": "else-style", "fail": "else-style", - "break": "atom", "cont": "atom", "const": "let", "resource": "fn", - "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", - "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", - "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", - "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", - "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom", "struct": "enum" - }; - var typeKeywords = function() { - var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; - var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); - for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; - return keywords; - }(); - var operatorChar = /[+\-*&%=<>!?|\.@]/; - - // Tokenizer - - // Used as scratch variable to communicate multiple values without - // consing up tons of objects. - var tcat, content; - function r(tc, style) { - tcat = tc; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch == "'") { - tcat = "atom"; - if (stream.eat("\\")) { - if (stream.skipTo("'")) { stream.next(); return "string"; } - else { return "error"; } - } else { - stream.next(); - return stream.eat("'") ? "string" : "error"; - } - } - if (ch == "/") { - if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } - if (stream.eat("*")) { - state.tokenize = tokenComment(1); - return state.tokenize(stream, state); - } - } - if (ch == "#") { - if (stream.eat("[")) { tcat = "open-attr"; return null; } - stream.eatWhile(/\w/); - return r("macro", "meta"); - } - if (ch == ":" && stream.match(":<")) { - return r("op", null); - } - if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { - var flp = false; - if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { - stream.eatWhile(/\d/); - if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } - if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } - } - if (flp) stream.match(/^f(?:32|64)/); - else stream.match(/^[ui](?:8|16|32|64)/); - return r("atom", "number"); - } - if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); - if (ch == "-" && stream.eat(">")) return r("->", null); - if (ch.match(operatorChar)) { - stream.eatWhile(operatorChar); - return r("op", null); - } - stream.eatWhile(/\w/); - content = stream.current(); - if (stream.match(/^::\w/)) { - stream.backUp(1); - return r("prefix", "variable-2"); - } - if (state.keywords.propertyIsEnumerable(content)) - return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); - return r("name", "variable"); - } - - function tokenString(stream, state) { - var ch, escaped = false; - while (ch = stream.next()) { - if (ch == '"' && !escaped) { - state.tokenize = tokenBase; - return r("atom", "string"); - } - escaped = !escaped && ch == "\\"; - } - // Hack to not confuse the parser when a string is split in - // pieces. - return r("op", "string"); - } - - function tokenComment(depth) { - return function(stream, state) { - var lastCh = null, ch; - while (ch = stream.next()) { - if (ch == "/" && lastCh == "*") { - if (depth == 1) { - state.tokenize = tokenBase; - break; - } else { - state.tokenize = tokenComment(depth - 1); - return state.tokenize(stream, state); - } - } - if (ch == "*" && lastCh == "/") { - state.tokenize = tokenComment(depth + 1); - return state.tokenize(stream, state); - } - lastCh = ch; - } - return "comment"; - }; - } - - // Parser - - var cx = {state: null, stream: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = {indented: state.indented, column: cx.stream.column(), - type: type, prev: state.lexical, info: info}; - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - function typecx() { cx.state.keywords = typeKeywords; } - function valcx() { cx.state.keywords = valKeywords; } - poplex.lex = typecx.lex = valcx.lex = true; - - function commasep(comb, end) { - function more(type) { - if (type == ",") return cont(comb, more); - if (type == end) return cont(); - return cont(more); - } - return function(type) { - if (type == end) return cont(); - return pass(comb, more); - }; - } - - function stat_of(comb, tag) { - return cont(pushlex("stat", tag), comb, poplex, block); - } - function block(type) { - if (type == "}") return cont(); - if (type == "let") return stat_of(letdef1, "let"); - if (type == "fn") return stat_of(fndef); - if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); - if (type == "enum") return stat_of(enumdef); - if (type == "mod") return stat_of(mod); - if (type == "iface") return stat_of(iface); - if (type == "impl") return stat_of(impl); - if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); - if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); - return pass(pushlex("stat"), expression, poplex, endstatement, block); - } - function endstatement(type) { - if (type == ";") return cont(); - return pass(); - } - function expression(type) { - if (type == "atom" || type == "name") return cont(maybeop); - if (type == "{") return cont(pushlex("}"), exprbrace, poplex); - if (type.match(/[\[\(]/)) return matchBrackets(type, expression); - if (type.match(/[\]\)\};,]/)) return pass(); - if (type == "if-style") return cont(expression, expression); - if (type == "else-style" || type == "op") return cont(expression); - if (type == "for") return cont(pattern, maybetype, inop, expression, expression); - if (type == "alt") return cont(expression, altbody); - if (type == "fn") return cont(fndef); - if (type == "macro") return cont(macro); - return cont(); - } - function maybeop(type) { - if (content == ".") return cont(maybeprop); - if (content == "::<"){return cont(typarams, maybeop);} - if (type == "op" || content == ":") return cont(expression); - if (type == "(" || type == "[") return matchBrackets(type, expression); - return pass(); - } - function maybeprop() { - if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} - return pass(expression); - } - function exprbrace(type) { - if (type == "op") { - if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); - if (content == "||") return cont(poplex, pushlex("}", "block"), block); - } - if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" - && !cx.stream.match("::", false))) - return pass(record_of(expression)); - return pass(block); - } - function record_of(comb) { - function ro(type) { - if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} - if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} - if (type == ":") return cont(comb, ro); - if (type == "}") return cont(); - return cont(ro); - } - return ro; - } - function blockvars(type) { - if (type == "name") {cx.marked = "def"; return cont(blockvars);} - if (type == "op" && content == "|") return cont(); - return cont(blockvars); - } - - function letdef1(type) { - if (type.match(/[\]\)\};]/)) return cont(); - if (content == "=") return cont(expression, letdef2); - if (type == ",") return cont(letdef1); - return pass(pattern, maybetype, letdef1); - } - function letdef2(type) { - if (type.match(/[\]\)\};,]/)) return pass(letdef1); - else return pass(expression, letdef2); - } - function maybetype(type) { - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function inop(type) { - if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} - return pass(); - } - function fndef(type) { - if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} - if (type == "name") {cx.marked = "def"; return cont(fndef);} - if (content == "<") return cont(typarams, fndef); - if (type == "{") return pass(expression); - if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); - if (type == "->") return cont(typecx, rtype, valcx, fndef); - if (type == ";") return cont(); - return cont(fndef); - } - function tydef(type) { - if (type == "name") {cx.marked = "def"; return cont(tydef);} - if (content == "<") return cont(typarams, tydef); - if (content == "=") return cont(typecx, rtype, valcx); - return cont(tydef); - } - function enumdef(type) { - if (type == "name") {cx.marked = "def"; return cont(enumdef);} - if (content == "<") return cont(typarams, enumdef); - if (content == "=") return cont(typecx, rtype, valcx, endstatement); - if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); - return cont(enumdef); - } - function enumblock(type) { - if (type == "}") return cont(); - if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); - if (content.match(/^\w+$/)) cx.marked = "def"; - return cont(enumblock); - } - function mod(type) { - if (type == "name") {cx.marked = "def"; return cont(mod);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function iface(type) { - if (type == "name") {cx.marked = "def"; return cont(iface);} - if (content == "<") return cont(typarams, iface); - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function impl(type) { - if (content == "<") return cont(typarams, impl); - if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} - if (type == "name") {cx.marked = "def"; return cont(impl);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function typarams() { - if (content == ">") return cont(); - if (content == ",") return cont(typarams); - if (content == ":") return cont(rtype, typarams); - return pass(rtype, typarams); - } - function argdef(type) { - if (type == "name") {cx.marked = "def"; return cont(argdef);} - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function rtype(type) { - if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } - if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} - if (type == "atom") return cont(rtypemaybeparam); - if (type == "op" || type == "obj") return cont(rtype); - if (type == "fn") return cont(fntype); - if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); - return matchBrackets(type, rtype); - } - function rtypemaybeparam() { - if (content == "<") return cont(typarams); - return pass(); - } - function fntype(type) { - if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); - if (type == "->") return cont(rtype); - return pass(); - } - function pattern(type) { - if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} - if (type == "atom") return cont(patternmaybeop); - if (type == "op") return cont(pattern); - if (type.match(/[\]\)\};,]/)) return pass(); - return matchBrackets(type, pattern); - } - function patternmaybeop(type) { - if (type == "op" && content == ".") return cont(); - if (content == "to") {cx.marked = "keyword"; return cont(pattern);} - else return pass(); - } - function altbody(type) { - if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); - return pass(); - } - function altblock1(type) { - if (type == "}") return cont(); - if (type == "|") return cont(altblock1); - if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} - if (type.match(/[\]\);,]/)) return cont(altblock1); - return pass(pattern, altblock2); - } - function altblock2(type) { - if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); - else return pass(altblock1); - } - - function macro(type) { - if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); - return pass(); - } - function matchBrackets(type, comb) { - if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); - if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); - if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); - return cont(); - } - - function parse(state, stream, style) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - while (true) { - var combinator = cc.length ? cc.pop() : block; - if (combinator(tcat)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - return cx.marked || style; - } - } - } - - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, - keywords: valKeywords, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - tcat = content = null; - var style = state.tokenize(stream, state); - if (style == "comment") return style; - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - if (tcat == "prefix") return style; - if (!content) content = stream.current(); - return parse(state, stream, style); - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "stat") return lexical.indented + indentUnit; - if (lexical.align) return lexical.column + (closing ? 0 : 1); - return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); - }, - - electricChars: "{}", +CodeMirror.defineSimpleMode("rust",{ + start: [ + // string and byte string + {regex: /b?"/, token: "string", next: "string"}, + // raw string and raw byte string + {regex: /b?r"/, token: "string", next: "string_raw"}, + {regex: /b?r#+"/, token: "string", next: "string_raw_hash"}, + // character + {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"}, + // byte + {regex: /b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/, token: "string-2"}, + + {regex: /(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/, + token: "number"}, + {regex: /(let(?:\s+mut)?|fn|enum|mod|struct|type)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, token: ["keyword", null, "def"]}, + {regex: /(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, token: "keyword"}, + {regex: /\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/, token: "atom"}, + {regex: /\b(?:true|false|Some|None|Ok|Err)\b/, token: "builtin"}, + {regex: /\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, + token: ["keyword", null ,"def"]}, + {regex: /#!?\[.*\]/, token: "meta"}, + {regex: /\/\/.*/, token: "comment"}, + {regex: /\/\*/, token: "comment", next: "comment"}, + {regex: /[-+\/*=<>!]+/, token: "operator"}, + {regex: /[a-zA-Z_]\w*!/,token: "variable-3"}, + {regex: /[a-zA-Z_]\w*/, token: "variable"}, + {regex: /[\{\[\(]/, indent: true}, + {regex: /[\}\]\)]/, dedent: true} + ], + string: [ + {regex: /"/, token: "string", next: "start"}, + {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"} + ], + string_raw: [ + {regex: /"/, token: "string", next: "start"}, + {regex: /[^"]*/, token: "string"} + ], + string_raw_hash: [ + {regex: /"#+/, token: "string", next: "start"}, + {regex: /(?:[^"]|"(?!#))*/, token: "string"} + ], + comment: [ + {regex: /.*?\*\//, token: "comment", next: "start"}, + {regex: /.*/, token: "comment"} + ], + meta: { + dontIndentStates: ["comment"], + electricInput: /^\s*\}$/, blockCommentStart: "/*", blockCommentEnd: "*/", lineComment: "//", fold: "brace" - }; + } }); -CodeMirror.defineMIME("text/x-rustsrc", "rust"); +CodeMirror.defineMIME("text/x-rustsrc", "rust"); }); diff --git a/public/vendor/codemirror/mode/rust/test.js b/public/vendor/codemirror/mode/rust/test.js new file mode 100644 index 00000000..eb256c47 --- /dev/null +++ b/public/vendor/codemirror/mode/rust/test.js @@ -0,0 +1,39 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); + function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} + + MT('integer_test', + '[number 123i32]', + '[number 123u32]', + '[number 123_u32]', + '[number 0xff_u8]', + '[number 0o70_i16]', + '[number 0b1111_1111_1001_0000_i32]', + '[number 0usize]'); + + MT('float_test', + '[number 123.0f64]', + '[number 0.1f64]', + '[number 0.1f32]', + '[number 12E+99_f64]'); + + MT('string-literals-test', + '[string "foo"]', + '[string r"foo"]', + '[string "\\"foo\\""]', + '[string r#""foo""#]', + '[string "foo #\\"# bar"]', + + '[string b"foo"]', + '[string br"foo"]', + '[string b"\\"foo\\""]', + '[string br#""foo""#]', + '[string br##"foo #" bar"##]', + + "[string-2 'h']", + "[string-2 b'h']"); + +})(); diff --git a/public/vendor/codemirror/mode/sass/index.html b/public/vendor/codemirror/mode/sass/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sass/sass.js b/public/vendor/codemirror/mode/sass/sass.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/scheme/index.html b/public/vendor/codemirror/mode/scheme/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/scheme/scheme.js b/public/vendor/codemirror/mode/scheme/scheme.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/shell/index.html b/public/vendor/codemirror/mode/shell/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/shell/shell.js b/public/vendor/codemirror/mode/shell/shell.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/shell/test.js b/public/vendor/codemirror/mode/shell/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sieve/index.html b/public/vendor/codemirror/mode/sieve/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sieve/sieve.js b/public/vendor/codemirror/mode/sieve/sieve.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/slim/index.html b/public/vendor/codemirror/mode/slim/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/slim/slim.js b/public/vendor/codemirror/mode/slim/slim.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/slim/test.js b/public/vendor/codemirror/mode/slim/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/smalltalk/index.html b/public/vendor/codemirror/mode/smalltalk/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/smalltalk/smalltalk.js b/public/vendor/codemirror/mode/smalltalk/smalltalk.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/smarty/index.html b/public/vendor/codemirror/mode/smarty/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/smarty/smarty.js b/public/vendor/codemirror/mode/smarty/smarty.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/solr/index.html b/public/vendor/codemirror/mode/solr/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/solr/solr.js b/public/vendor/codemirror/mode/solr/solr.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/soy/index.html b/public/vendor/codemirror/mode/soy/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/soy/soy.js b/public/vendor/codemirror/mode/soy/soy.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sparql/index.html b/public/vendor/codemirror/mode/sparql/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sparql/sparql.js b/public/vendor/codemirror/mode/sparql/sparql.js old mode 100755 new mode 100644 index bbf8a76a..0cf40f58 --- a/public/vendor/codemirror/mode/sparql/sparql.js +++ b/public/vendor/codemirror/mode/sparql/sparql.js @@ -165,7 +165,9 @@ CodeMirror.defineMode("sparql", function(config) { return context.col + (closing ? 0 : 1); else return context.indent + (closing ? 0 : indentUnit); - } + }, + + lineComment: "#" }; }); diff --git a/public/vendor/codemirror/mode/spreadsheet/index.html b/public/vendor/codemirror/mode/spreadsheet/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sql/index.html b/public/vendor/codemirror/mode/sql/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js old mode 100755 new mode 100644 index a9082771..86c68f72 --- a/public/vendor/codemirror/mode/sql/sql.js +++ b/public/vendor/codemirror/mode/sql/sql.js @@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) { } // these keywords are used by all SQL dialects (however, a mode can still overwrite it) - var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where "; + var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit"; // turn a space-separated list into an array function set(str) { diff --git a/public/vendor/codemirror/mode/stex/index.html b/public/vendor/codemirror/mode/stex/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/stex/stex.js b/public/vendor/codemirror/mode/stex/stex.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/stex/test.js b/public/vendor/codemirror/mode/stex/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/stylus/index.html b/public/vendor/codemirror/mode/stylus/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/stylus/stylus.js b/public/vendor/codemirror/mode/stylus/stylus.js old mode 100755 new mode 100644 index fc46a016..662cd03c --- a/public/vendor/codemirror/mode/stylus/stylus.js +++ b/public/vendor/codemirror/mode/stylus/stylus.js @@ -126,19 +126,16 @@ if (stream.match(/^&{1}\s*$/)) { return ["variable-3", "reference"]; } - // Variable - if (ch == "$" && stream.match(/^\$[\w-]+/i)) { - return ["variable-2", "variable-name"]; - } // Word operator if (stream.match(wordOperatorKeywordsRegexp)) { return ["operator", "operator"]; } // Word - if (stream.match(/^[-_]*[a-z0-9]+[\w-]*/i)) { + if (stream.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)) { + // Variable if (stream.match(/^(\.|\[)[\w-\'\"\]]+/i, false)) { if (!wordIsTag(stream.current())) { - stream.match(/[\w-]+/); + stream.match(/\./); return ["variable-2", "variable-name"]; } } @@ -323,7 +320,7 @@ return pushContext(state, stream, "block", 0); } if (type == "variable-name") { - if ((stream.indentation() == 0 && startOfLine(stream)) || wordIsBlock(firstWordOfLine(stream))) { + if (stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/) || wordIsBlock(firstWordOfLine(stream))) { return pushContext(state, stream, "variableName"); } else { @@ -429,6 +426,11 @@ return pushContext(state, stream, "block"); } if (word == "return") return pushContext(state, stream, "block", 0); + + // Placeholder selector + if (override == "variable-2" && stream.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)) { + return pushContext(state, stream, "block"); + } } return state.context.type; }; @@ -639,7 +641,6 @@ states.variableName = function(type, stream, state) { if (type == "string" || type == "[" || type == "]" || stream.current().match(/^(\.|\$)/)) { if (stream.current().match(/^\.[\w-]+/i)) override = "variable-2"; - if (endOfLine(stream)) return popContext(state); return "variableName"; } return popAndPass(type, stream, state); @@ -735,7 +736,7 @@ var nonStandardPropertyKeywords_ = ["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]; var fontProperties_ = ["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]; var colorKeywords_ = ["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]; - var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale"]; + var valueKeywords_ = ["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around"]; var wordOperatorKeywords_ = ["in","and","or","not","is not","is a","is","isnt","defined","if unless"], blockKeywords_ = ["for","if","else","unless", "from", "to"], diff --git a/public/vendor/codemirror/mode/swift/index.html b/public/vendor/codemirror/mode/swift/index.html old mode 100755 new mode 100644 index 2649dc37..109f3fdb --- a/public/vendor/codemirror/mode/swift/index.html +++ b/public/vendor/codemirror/mode/swift/index.html @@ -35,11 +35,11 @@ // Created by Main Account on 12/18/14. // Copyright (c) 2014 Razeware LLC. All rights reserved. // - + import Foundation - + class TipCalculatorModel { - + var total: Double var taxPct: Double var subtotal: Double { @@ -47,30 +47,30 @@ class TipCalculatorModel { return total / (taxPct + 1) } } - + init(total: Double, taxPct: Double) { self.total = total self.taxPct = taxPct } - + func calcTipWithTipPct(tipPct: Double) -> Double { return subtotal * tipPct } - + func returnPossibleTips() -> [Int: Double] { - + let possibleTipsInferred = [0.15, 0.18, 0.20] let possibleTipsExplicit:[Double] = [0.15, 0.18, 0.20] - + var retval = [Int: Double]() for possibleTip in possibleTipsInferred { let intPct = Int(possibleTip*100) retval[intPct] = calcTipWithTipPct(possibleTip) } return retval - + } - + } diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js old mode 100755 new mode 100644 index cf784fef..7a2339fc --- a/public/vendor/codemirror/mode/swift/swift.js +++ b/public/vendor/codemirror/mode/swift/swift.js @@ -13,189 +13,149 @@ })(function(CodeMirror) { "use strict" - function trim(str) { return /^\s*(.*?)\s*$/.exec(str)[1] } + function wordSet(words) { + var set = {} + for (var i = 0; i < words.length; i++) set[words[i]] = true + return set + } + + var keywords = wordSet(["var","let","class","deinit","enum","extension","func","import","init","protocol", + "static","struct","subscript","typealias","as","dynamicType","is","new","super", + "self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case", + "continue","default","do","else","fallthrough","if","in","for","return","switch", + "where","while","associativity","didSet","get","infix","inout","left","mutating", + "none","nonmutating","operator","override","postfix","precedence","prefix","right", + "set","unowned","weak","willSet"]) + var definingKeywords = wordSet(["var","let","class","enum","extension","func","import","protocol","struct", + "typealias","dynamicType","for"]) + var atoms = wordSet(["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null", + "this","super"]) + var types = wordSet(["String","bool","int","string","double","Double","Int","Float","float","public", + "private","extension"]) + var operators = "+-/*%=|&<>#" + var punc = ";,.(){}[]" + var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/ + var number = /^-?(?:(?:[\d_]+\.[_\d]*|\.[_\d]+|0o[0-7_\.]+|0b[01_\.]+)(?:e-?[\d_]+)?|0x[\d_a-f\.]+(?:p-?[\d_]+)?)/i + var identifier = /^[_A-Za-z$][_A-Za-z$0-9]*/ + var property = /^[@\.][_A-Za-z$][_A-Za-z$0-9]*/ + var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\// - var separators = [" ","\\\+","\\\-","\\\(","\\\)","\\\*","/",":","\\\?","\\\<","\\\>"," ","\\\."] - var tokens = new RegExp(separators.join("|"),"g") + function tokenBase(stream, state, prev) { + if (stream.eatSpace()) return null - function getWord(string, pos) { - var index = -1, count = 1 - var words = string.split(tokens) - for (var i = 0; i < words.length; i++) { - for(var j = 1; j <= words[i].length; j++) { - if (count==pos) index = i - count++ + var ch = stream.peek() + if (ch == "/") { + if (stream.match("//")) { + stream.skipToEnd() + return "comment" } - count++ + if (stream.match("/*")) { + state.tokenize.push(tokenComment) + return tokenComment(stream, state) + } + if (stream.match(regexp)) return "string-2" } - var ret = ["", ""] - if (pos == 0) { - ret[1] = words[0] - ret[0] = null - } else { - ret[1] = words[index] - ret[0] = words[index-1] + if (operators.indexOf(ch) > -1) { + stream.next() + return "operator" + } + if (punc.indexOf(ch) > -1) { + stream.match(delimiters) + return "punctuation" + } + if (ch == '"' || ch == "'") { + stream.next() + var tokenize = tokenString(ch) + state.tokenize.push(tokenize) + return tokenize(stream, state) } - return ret - } - CodeMirror.defineMode("swift", function() { - var keywords=["var","let","class","deinit","enum","extension","func","import","init","let","protocol","static","struct","subscript","typealias","var","as","dynamicType","is","new","super","self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case","continue","default","do","else","fallthrough","if","in","for","return","switch","where","while","associativity","didSet","get","infix","inout","left","mutating","none","nonmutating","operator","override","postfix","precedence","prefix","right","set","unowned","unowned(safe)","unowned(unsafe)","weak","willSet"] - var commonConstants=["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null","this","super"] - var types=["String","bool","int","string","double","Double","Int","Float","float","public","private","extension"] - var numbers=["0","1","2","3","4","5","6","7","8","9"] - var operators=["+","-","/","*","%","=","|","&","<",">"] - var punc=[";",",",".","(",")","{","}","[","]"] - var delimiters=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/ - var identifiers=/^[_A-Za-z$][_A-Za-z$0-9]*/ - var properties=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/ - var regexPrefixes=/^(\/{3}|\/)/ + if (stream.match(number)) return "number" + if (stream.match(property)) return "property" - return { - startState: function() { - return { - prev: false, - string: false, - escape: false, - inner: false, - comment: false, - num_left: 0, - num_right: 0, - doubleString: false, - singleString: false + if (stream.match(identifier)) { + var ident = stream.current() + if (keywords.hasOwnProperty(ident)) { + if (definingKeywords.hasOwnProperty(ident)) + state.prev = "define" + return "keyword" + } + if (types.hasOwnProperty(ident)) return "variable-2" + if (atoms.hasOwnProperty(ident)) return "atom" + if (prev == "define") return "def" + return "variable" + } + + stream.next() + return null + } + + function tokenUntilClosingParen() { + var depth = 0 + return function(stream, state, prev) { + var inner = tokenBase(stream, state, prev) + if (inner == "punctuation") { + if (stream.current() == "(") ++depth + else if (stream.current() == ")") { + if (depth == 0) { + stream.backUp(1) + state.tokenize.pop() + return state.tokenize[state.tokenize.length - 1](stream, state) + } + else --depth } - }, - token: function(stream, state) { - if (stream.eatSpace()) return null + } + return inner + } + } - var ch = stream.next() - if (state.string) { - if (state.escape) { - state.escape = false + function tokenString(quote) { + return function(stream, state) { + var ch, escaped = false + while (ch = stream.next()) { + if (escaped) { + if (ch == "(") { + state.tokenize.push(tokenUntilClosingParen()) return "string" - } else { - if ((ch == "\"" && (state.doubleString && !state.singleString) || - (ch == "'" && (!state.doubleString && state.singleString))) && - !state.escape) { - state.string = false - state.doubleString = false - state.singleString = false - return "string" - } else if (ch == "\\" && stream.peek() == "(") { - state.inner = true - state.string = false - return "keyword" - } else if (ch == "\\" && stream.peek() != "(") { - state.escape = true - state.string = true - return "string" - } else { - return "string" - } - } - } else if (state.comment) { - if (ch == "*" && stream.peek() == "/") { - state.prev = "*" - return "comment" - } else if (ch == "/" && state.prev == "*") { - state.prev = false - state.comment = false - return "comment" } - return "comment" + escaped = false + } else if (ch == quote) { + break } else { - if (ch == "/") { - if (stream.peek() == "/") { - stream.skipToEnd() - return "comment" - } - if (stream.peek() == "*") { - state.comment = true - return "comment" - } - } - if (ch == "(" && state.inner) { - state.num_left++ - return null - } - if (ch == ")" && state.inner) { - state.num_right++ - if (state.num_left == state.num_right) { - state.inner=false - state.string=true - } - return null - } - - var ret = getWord(stream.string, stream.pos) - var the_word = ret[1] - var prev_word = ret[0] - - if (operators.indexOf(ch + "") > -1) return "operator" - if (punc.indexOf(ch) > -1) return "punctuation" - - if (typeof the_word != "undefined") { - the_word = trim(the_word) - if (typeof prev_word != "undefined") prev_word = trim(prev_word) - if (the_word.charAt(0) == "#") return null - - if (types.indexOf(the_word) > -1) return "def" - if (commonConstants.indexOf(the_word) > -1) return "atom" - if (numbers.indexOf(the_word) > -1) return "number" + escaped = ch == "\\" + } + } + state.tokenize.pop() + return "string" + } + } - if ((numbers.indexOf(the_word.charAt(0) + "") > -1 || - operators.indexOf(the_word.charAt(0) + "") > -1) && - numbers.indexOf(ch) > -1) { - return "number" - } + function tokenComment(stream, state) { + stream.match(/^(?:[^*]|\*(?!\/))*/) + if (stream.match("*/")) state.tokenize.pop() + return "comment" + } - if (keywords.indexOf(the_word) > -1 || - keywords.indexOf(the_word.split(tokens)[0]) > -1) - return "keyword" - if (keywords.indexOf(prev_word) > -1) return "def" - } - if (ch == '"' && !state.doubleString) { - state.string = true - state.doubleString = true - return "string" - } - if (ch == "'" && !state.singleString) { - state.string = true - state.singleString = true - return "string" - } - if (ch == "(" && state.inner) - state.num_left++ - if (ch == ")" && state.inner) { - state.num_right++ - if (state.num_left == state.num_right) { - state.inner = false - state.string = true - } - return null - } - if (stream.match(/^-?[0-9\.]/, false)) { - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) || - stream.match(/^-?\d+\.\d*/) || - stream.match(/^-?\.\d+/)) { - if (stream.peek() == ".") stream.backUp(1) - return "number" - } - if (stream.match(/^-?0x[0-9a-f]+/i) || - stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) || - stream.match(/^-?0(?![\dx])/i)) - return "number" - } - if (stream.match(regexPrefixes)) { - if (stream.current()!="/" || stream.match(/^.*\//,false)) return "string" - else stream.backUp(1) - } - if (stream.match(delimiters)) return "punctuation" - if (stream.match(identifiers)) return "variable" - if (stream.match(properties)) return "property" - return "variable" + CodeMirror.defineMode("swift", function() { + return { + startState: function() { + return { + prev: null, + tokenize: [] } - } + }, + token: function(stream, state) { + var prev = state.prev + state.prev = null + var tokenize = state.tokenize[state.tokenize.length - 1] || tokenBase + var style = tokenize(stream, state, prev) + if (!style || style == "comment") state.prev = prev + else if (!state.prev) state.prev = style + return style + }, + lineComment: "//", + blockCommentStart: "/*", + blockCommentEnd: "*/" } }) diff --git a/public/vendor/codemirror/mode/tcl/index.html b/public/vendor/codemirror/mode/tcl/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tcl/tcl.js b/public/vendor/codemirror/mode/tcl/tcl.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/textile/index.html b/public/vendor/codemirror/mode/textile/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/textile/test.js b/public/vendor/codemirror/mode/textile/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/textile/textile.js b/public/vendor/codemirror/mode/textile/textile.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tiddlywiki/index.html b/public/vendor/codemirror/mode/tiddlywiki/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tiki/index.html b/public/vendor/codemirror/mode/tiki/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tiki/tiki.css b/public/vendor/codemirror/mode/tiki/tiki.css old mode 100755 new mode 100644 index 0dbc3ea0..1d8704c7 --- a/public/vendor/codemirror/mode/tiki/tiki.css +++ b/public/vendor/codemirror/mode/tiki/tiki.css @@ -15,7 +15,7 @@ } .cm-tw-box { - border-top-width: 0px ! important; + border-top-width: 0px !important; border-style: solid; border-width: 1px; border-color: inherit; diff --git a/public/vendor/codemirror/mode/tiki/tiki.js b/public/vendor/codemirror/mode/tiki/tiki.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/toml/index.html b/public/vendor/codemirror/mode/toml/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/toml/toml.js b/public/vendor/codemirror/mode/toml/toml.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tornado/index.html b/public/vendor/codemirror/mode/tornado/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/tornado/tornado.js b/public/vendor/codemirror/mode/tornado/tornado.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/troff/index.html b/public/vendor/codemirror/mode/troff/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/troff/troff.js b/public/vendor/codemirror/mode/troff/troff.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ttcn-cfg/index.html b/public/vendor/codemirror/mode/ttcn-cfg/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ttcn/index.html b/public/vendor/codemirror/mode/ttcn/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/ttcn/ttcn.js b/public/vendor/codemirror/mode/ttcn/ttcn.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/turtle/index.html b/public/vendor/codemirror/mode/turtle/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/turtle/turtle.js b/public/vendor/codemirror/mode/turtle/turtle.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/twig/index.html b/public/vendor/codemirror/mode/twig/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/vb/index.html b/public/vendor/codemirror/mode/vb/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/vb/vb.js b/public/vendor/codemirror/mode/vb/vb.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/vbscript/index.html b/public/vendor/codemirror/mode/vbscript/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/vbscript/vbscript.js b/public/vendor/codemirror/mode/vbscript/vbscript.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/velocity/index.html b/public/vendor/codemirror/mode/velocity/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/velocity/velocity.js b/public/vendor/codemirror/mode/velocity/velocity.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/verilog/index.html b/public/vendor/codemirror/mode/verilog/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/verilog/test.js b/public/vendor/codemirror/mode/verilog/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/verilog/verilog.js b/public/vendor/codemirror/mode/verilog/verilog.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/vhdl/index.html b/public/vendor/codemirror/mode/vhdl/index.html new file mode 100644 index 00000000..3051bc37 --- /dev/null +++ b/public/vendor/codemirror/mode/vhdl/index.html @@ -0,0 +1,95 @@ + + +CodeMirror: VHDL mode + + + + + + + + + + +
    +

    VHDL mode

    + +
    + + + +

    +Syntax highlighting and indentation for the VHDL language. +

    Configuration options:

    +
      +
    • atoms - List of atom words. Default: "null"
    • +
    • hooks - List of meta hooks. Default: ["`", "$"]
    • +
    • multiLineStrings - Whether multi-line strings are accepted. Default: false
    • +
    +

    + +

    MIME types defined: text/x-vhdl.

    +
    diff --git a/public/vendor/codemirror/mode/vhdl/vhdl.js b/public/vendor/codemirror/mode/vhdl/vhdl.js new file mode 100644 index 00000000..d3b555aa --- /dev/null +++ b/public/vendor/codemirror/mode/vhdl/vhdl.js @@ -0,0 +1,189 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +// Originally written by Alf Nielsen, re-written by Michael Zhou +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +function words(str) { + var obj = {}, words = str.split(","); + for (var i = 0; i < words.length; ++i) { + var allCaps = words[i].toUpperCase(); + var firstCap = words[i].charAt(0).toUpperCase() + words[i].slice(1); + obj[words[i]] = true; + obj[allCaps] = true; + obj[firstCap] = true; + } + return obj; +} + +function metaHook(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; +} + +CodeMirror.defineMode("vhdl", function(config, parserConfig) { + var indentUnit = config.indentUnit, + atoms = parserConfig.atoms || words("null"), + hooks = parserConfig.hooks || {"`": metaHook, "$": metaHook}, + multiLineStrings = parserConfig.multiLineStrings; + + var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," + + "body,buffer,bus,case,component,configuration,constant,disconnent,downto,else,elsif,end,end block,end case," + + "end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," + + "function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," + + "literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," + + "postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal," + + "sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor"); + + var blockKeywords = words("architecture,entity,begin,case,port,else,elsif,end,for,function,if"); + + var isOperatorChar = /[&|~> + +CodeMirror: Vue.js mode + + + + + + + + + + + + + + + + + + + + + +
    +

    Vue.js mode

    +
    + + +

    MIME types defined: text/x-vue

    + +
    diff --git a/public/vendor/codemirror/mode/vue/vue.js b/public/vendor/codemirror/mode/vue/vue.js new file mode 100644 index 00000000..d89a5523 --- /dev/null +++ b/public/vendor/codemirror/mode/vue/vue.js @@ -0,0 +1,69 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + "use strict"; + if (typeof exports === "object" && typeof module === "object") {// CommonJS + mod(require("../../lib/codemirror"), + require("../../addon/mode/overlay"), + require("../xml/xml"), + require("../javascript/javascript"), + require("../coffeescript/coffeescript"), + require("../css/css"), + require("../sass/sass"), + require("../stylus/stylus"), + require("../jade/jade"), + require("../handlebars/handlebars")); + } else if (typeof define === "function" && define.amd) { // AMD + define(["../../lib/codemirror", + "../../addon/mode/overlay", + "../xml/xml", + "../javascript/javascript", + "../coffeescript/coffeescript", + "../css/css", + "../sass/sass", + "../stylus/stylus", + "../jade/jade", + "../handlebars/handlebars"], mod); + } else { // Plain browser env + mod(CodeMirror); + } +})(function (CodeMirror) { + var tagLanguages = { + script: [ + ["lang", /coffee(script)?/, "coffeescript"], + ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"] + ], + style: [ + ["lang", /^stylus$/i, "stylus"], + ["lang", /^sass$/i, "sass"], + ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"], + ["type", /^text\/sass/i, "sass"] + ], + template: [ + ["lang", /^vue-template$/i, "vue"], + ["lang", /^jade$/i, "jade"], + ["lang", /^handlebars$/i, "handlebars"], + ["type", /^(text\/)?(x-)?jade$/i, "jade"], + ["type", /^text\/x-handlebars-template$/i, "handlebars"], + [null, null, "vue-template"] + ] + }; + + CodeMirror.defineMode("vue-template", function (config, parserConfig) { + var mustacheOverlay = { + token: function (stream) { + if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache"; + while (stream.next() && !stream.match("{{", false)) {} + return null; + } + }; + return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay); + }); + + CodeMirror.defineMode("vue", function (config) { + return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages}); + }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "jade", "handlebars"); + + CodeMirror.defineMIME("script/x-vue", "vue"); +}); diff --git a/public/vendor/codemirror/mode/xml/index.html b/public/vendor/codemirror/mode/xml/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/xml/test.js b/public/vendor/codemirror/mode/xml/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/xml/xml.js b/public/vendor/codemirror/mode/xml/xml.js old mode 100755 new mode 100644 index 2f3b8f87..014f7d84 --- a/public/vendor/codemirror/mode/xml/xml.js +++ b/public/vendor/codemirror/mode/xml/xml.js @@ -11,54 +11,56 @@ })(function(CodeMirror) { "use strict"; -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1; - var multilineTagIndentPastTag = parserConfig.multilineTagIndentPastTag; - if (multilineTagIndentPastTag == null) multilineTagIndentPastTag = true; +var htmlConfig = { + autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, + 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + 'track': true, 'wbr': true, 'menuitem': true}, + implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, + 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, + 'th': true, 'tr': true}, + contextGrabbers: { + 'dd': {'dd': true, 'dt': true}, + 'dt': {'dd': true, 'dt': true}, + 'li': {'li': true}, + 'option': {'option': true, 'optgroup': true}, + 'optgroup': {'optgroup': true}, + 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, + 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, + 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, + 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, + 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, + 'rp': {'rp': true, 'rt': true}, + 'rt': {'rp': true, 'rt': true}, + 'tbody': {'tbody': true, 'tfoot': true}, + 'td': {'td': true, 'th': true}, + 'tfoot': {'tbody': true}, + 'th': {'td': true, 'th': true}, + 'thead': {'tbody': true, 'tfoot': true}, + 'tr': {'tr': true} + }, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: true, + caseFold: true +} - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true - } : { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - caseFold: false - }; - var alignCDATA = parserConfig.alignCDATA; +var xmlConfig = { + autoSelfClosers: {}, + implicitlyClosed: {}, + contextGrabbers: {}, + doNotIndent: {}, + allowUnquoted: false, + allowMissing: false, + caseFold: false +} + +CodeMirror.defineMode("xml", function(editorConf, config_) { + var indentUnit = editorConf.indentUnit + var config = {} + var defaults = config_.htmlMode ? htmlConfig : xmlConfig + for (var prop in defaults) config[prop] = defaults[prop] + for (var prop in config_) config[prop] = config_[prop] // Return variables for tokenizers var type, setStyle; @@ -109,6 +111,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { return null; } } + inText.isInText = true; function inTag(stream, state) { var ch = stream.next(); @@ -187,7 +190,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { this.tagName = tagName; this.indent = state.indented; this.startOfLine = startOfLine; - if (Kludges.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) this.noIndent = true; } function popContext(state) { @@ -200,8 +203,8 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { return; } parentTagName = state.context.tagName; - if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) || - !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + if (!config.contextGrabbers.hasOwnProperty(parentTagName) || + !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { return; } popContext(state); @@ -232,7 +235,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { if (type == "word") { var tagName = stream.current(); if (state.context && state.context.tagName != tagName && - Kludges.implicitlyClosed.hasOwnProperty(state.context.tagName)) + config.implicitlyClosed.hasOwnProperty(state.context.tagName)) popContext(state); if (state.context && state.context.tagName == tagName) { setStyle = "tag"; @@ -268,7 +271,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { var tagName = state.tagName, tagStart = state.tagStart; state.tagName = state.tagStart = null; if (type == "selfcloseTag" || - Kludges.autoSelfClosers.hasOwnProperty(tagName)) { + config.autoSelfClosers.hasOwnProperty(tagName)) { maybePopContext(state, tagName); } else { maybePopContext(state, tagName); @@ -281,12 +284,12 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { } function attrEqState(type, stream, state) { if (type == "equals") return attrValueState; - if (!Kludges.allowMissing) setStyle = "error"; + if (!config.allowMissing) setStyle = "error"; return attrState(type, stream, state); } function attrValueState(type, stream, state) { if (type == "string") return attrContinuedState; - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return attrState;} + if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} setStyle = "error"; return attrState(type, stream, state); } @@ -296,12 +299,14 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { } return { - startState: function() { - return {tokenize: inText, - state: baseState, - indented: 0, - tagName: null, tagStart: null, - context: null}; + startState: function(baseIndent) { + var state = {tokenize: inText, + state: baseState, + indented: baseIndent || 0, + tagName: null, tagStart: null, + context: null} + if (baseIndent != null) state.baseIndent = baseIndent + return state }, token: function(stream, state) { @@ -334,19 +339,19 @@ CodeMirror.defineMode("xml", function(config, parserConfig) { return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; // Indent the starts of attribute names. if (state.tagName) { - if (multilineTagIndentPastTag) + if (config.multilineTagIndentPastTag !== false) return state.tagStart + state.tagName.length + 2; else - return state.tagStart + indentUnit * multilineTagIndentFactor; + return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); } - if (alignCDATA && /$/, blockCommentStart: "", - configuration: parserConfig.htmlMode ? "html" : "xml", - helperType: parserConfig.htmlMode ? "html" : "xml" + configuration: config.htmlMode ? "html" : "xml", + helperType: config.htmlMode ? "html" : "xml", + + skipAttribute: function(state) { + if (state.state == attrValueState) + state.state = attrState + } }; }); diff --git a/public/vendor/codemirror/mode/xquery/index.html b/public/vendor/codemirror/mode/xquery/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/xquery/test.js b/public/vendor/codemirror/mode/xquery/test.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/index.html b/public/vendor/codemirror/mode/yaml-frontmatter/index.html new file mode 100644 index 00000000..30bed2f8 --- /dev/null +++ b/public/vendor/codemirror/mode/yaml-frontmatter/index.html @@ -0,0 +1,121 @@ + + +CodeMirror: YAML front matter mode + + + + + + + + + + + + + +
    +

    YAML front matter mode

    +
    + +

    Defines a mode that parses +a YAML frontmatter +at the start of a file, switching to a base mode at the end of that. +Takes a mode configuration option base to configure the +base mode, which defaults to "gfm".

    + + + +
    diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js new file mode 100644 index 00000000..9f081b00 --- /dev/null +++ b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js @@ -0,0 +1,68 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../yaml/yaml")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../yaml/yaml"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + + var START = 0, FRONTMATTER = 1, BODY = 2 + + // a mixed mode for Markdown text with an optional YAML front matter + CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) { + var yamlMode = CodeMirror.getMode(config, "yaml") + var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm") + + function curMode(state) { + return state.state == BODY ? innerMode : yamlMode + } + + return { + startState: function () { + return { + state: START, + inner: CodeMirror.startState(yamlMode) + } + }, + copyState: function (state) { + return { + state: state.state, + inner: CodeMirror.copyState(curMode(state), state.inner) + } + }, + token: function (stream, state) { + if (state.state == START) { + if (stream.match(/---/, false)) { + state.state = FRONTMATTER + return yamlMode.token(stream, state.inner) + } else { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + return innerMode.token(stream, state.inner) + } + } else if (state.state == FRONTMATTER) { + var end = stream.sol() && stream.match(/---/, false) + var style = yamlMode.token(stream, state.inner) + if (end) { + state.state = BODY + state.inner = CodeMirror.startState(innerMode) + } + return style + } else { + return innerMode.token(stream, state.inner) + } + }, + innerMode: function (state) { + return {mode: curMode(state), state: state.inner} + }, + blankLine: function (state) { + var mode = curMode(state) + if (mode.blankLine) return mode.blankLine(state.inner) + } + } + }) +}) diff --git a/public/vendor/codemirror/mode/yaml/index.html b/public/vendor/codemirror/mode/yaml/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/yaml/yaml.js b/public/vendor/codemirror/mode/yaml/yaml.js old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/z80/index.html b/public/vendor/codemirror/mode/z80/index.html old mode 100755 new mode 100644 diff --git a/public/vendor/codemirror/mode/z80/z80.js b/public/vendor/codemirror/mode/z80/z80.js old mode 100755 new mode 100644 -- cgit v1.2.3