summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/apl/apl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/apl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asciiarmor/asciiarmor.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asciiarmor/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asn.1/asn.1.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asn.1/index.html3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asterisk/asterisk.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/asterisk/index.html0
-rw-r--r--public/vendor/codemirror/mode/brainfuck/brainfuck.js85
-rw-r--r--public/vendor/codemirror/mode/brainfuck/index.html85
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/clike.js245
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/index.html111
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/scala.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clike/test.js18
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clojure/clojure.js3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/clojure/index.html3
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cmake/cmake.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cmake/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cobol/cobol.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cobol/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/coffeescript/coffeescript.js40
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/coffeescript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/commonlisp/commonlisp.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/commonlisp/index.html0
-rw-r--r--public/vendor/codemirror/mode/crystal/crystal.js391
-rw-r--r--public/vendor/codemirror/mode/crystal/index.html119
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/css.js147
-rw-r--r--public/vendor/codemirror/mode/css/gss.html103
-rw-r--r--public/vendor/codemirror/mode/css/gss_test.js17
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/less.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/less_test.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/scss.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/scss_test.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/css/test.js22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cypher/cypher.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/cypher/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/d/d.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/d/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dart/dart.js86
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dart/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/diff/diff.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/diff/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/django/django.js25
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/django/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dockerfile/dockerfile.js5
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dockerfile/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dtd/dtd.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dtd/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dylan/dylan.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/dylan/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ebnf/ebnf.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ebnf/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ecl/ecl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ecl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/eiffel/eiffel.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/eiffel/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/elm/elm.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/elm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/erlang/erlang.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/erlang/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/factor/factor.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/factor/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/forth/forth.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/forth/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/fortran/fortran.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/fortran/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gas/gas.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gas/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/gfm.js45
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gfm/test.js21
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gherkin/gherkin.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/gherkin/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/go/go.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/go/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/groovy/groovy.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/groovy/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/haml.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haml/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/handlebars/handlebars.js19
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/handlebars/index.html15
-rw-r--r--public/vendor/codemirror/mode/haskell-literate/haskell-literate.js43
-rw-r--r--public/vendor/codemirror/mode/haskell-literate/index.html282
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haskell/haskell.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haskell/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haxe/haxe.js165
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/haxe/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlembedded/htmlembedded.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlembedded/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlmixed/htmlmixed.js221
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/htmlmixed/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/http/http.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/http/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/idl/idl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/idl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/index.html15
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jade/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jade/jade.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/javascript.js84
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/json-ld.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/test.js55
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/javascript/typescript.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jinja2/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/jinja2/jinja2.js0
-rw-r--r--public/vendor/codemirror/mode/jsx/index.html89
-rw-r--r--public/vendor/codemirror/mode/jsx/jsx.js147
-rw-r--r--public/vendor/codemirror/mode/jsx/test.js69
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/julia/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/julia/julia.js223
-rwxr-xr-xpublic/vendor/codemirror/mode/kotlin/index.html89
-rwxr-xr-xpublic/vendor/codemirror/mode/kotlin/kotlin.js284
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/livescript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/livescript/livescript.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/lua/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/lua/lua.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/markdown.js192
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/markdown/test.js176
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mathematica/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mathematica/mathematica.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/meta.js20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mirc/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mirc/mirc.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mllike/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mllike/mllike.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/modelica/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/modelica/modelica.js0
-rw-r--r--public/vendor/codemirror/mode/mscgen/index.html151
-rw-r--r--public/vendor/codemirror/mode/mscgen/mscgen.js169
-rw-r--r--public/vendor/codemirror/mode/mscgen/mscgen_test.js75
-rw-r--r--public/vendor/codemirror/mode/mscgen/msgenny_test.js71
-rw-r--r--public/vendor/codemirror/mode/mscgen/xu_test.js75
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mumps/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/mumps/mumps.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/nginx/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/nginx/nginx.js2
-rw-r--r--public/vendor/codemirror/mode/nsis/index.html80
-rw-r--r--public/vendor/codemirror/mode/nsis/nsis.js95
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ntriples/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ntriples/ntriples.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/octave/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/octave/octave.js0
-rw-r--r--public/vendor/codemirror/mode/oz/index.html59
-rw-r--r--public/vendor/codemirror/mode/oz/oz.js252
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pascal/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pascal/pascal.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pegjs/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pegjs/pegjs.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/perl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/perl/perl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/php.js20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/php/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pig/index.html4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/pig/pig.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/properties/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/properties/properties.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/puppet/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/puppet/puppet.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/python/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/python/python.js45
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/q/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/q/q.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/r/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/r/r.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/changes/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rpm/rpm.js26
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rst/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rst/rst.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/ruby.js6
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ruby/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rust/index.html22
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/rust/rust.js484
-rw-r--r--public/vendor/codemirror/mode/rust/test.js39
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sass/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sass/sass.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/scheme/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/scheme/scheme.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/shell.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/shell/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sieve/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sieve/sieve.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/slim.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/slim/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smalltalk/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smalltalk/smalltalk.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smarty/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/smarty/smarty.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/solr/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/solr/solr.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/soy/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/soy/soy.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sparql/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sparql/sparql.js4
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/spreadsheet/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/spreadsheet/spreadsheet.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sql/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/sql/sql.js2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/stex.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stex/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stylus/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/stylus/stylus.js19
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/swift/index.html20
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/swift/swift.js296
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tcl/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tcl/tcl.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/textile/textile.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/tiki.css2
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tiki/tiki.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/toml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/toml/toml.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tornado/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/tornado/tornado.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/troff/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/troff/troff.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn-cfg/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/ttcn/ttcn.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/turtle/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/turtle/turtle.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/twig/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/twig/twig.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vb/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vb/vb.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vbscript/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/vbscript/vbscript.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/velocity/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/velocity/velocity.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/verilog/verilog.js0
-rw-r--r--public/vendor/codemirror/mode/vhdl/index.html95
-rw-r--r--public/vendor/codemirror/mode/vhdl/vhdl.js189
-rw-r--r--public/vendor/codemirror/mode/vue/index.html69
-rw-r--r--public/vendor/codemirror/mode/vue/vue.js69
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xml/xml.js148
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/test.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/xquery/xquery.js0
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/index.html121
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js68
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/yaml/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/yaml/yaml.js0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/z80/index.html0
-rw-r--r--[-rwxr-xr-x]public/vendor/codemirror/mode/z80/z80.js0
262 files changed, 4876 insertions, 1707 deletions
diff --git a/public/vendor/codemirror/mode/apl/apl.js b/public/vendor/codemirror/mode/apl/apl.js
index caafe4e9..caafe4e9 100755..100644
--- a/public/vendor/codemirror/mode/apl/apl.js
+++ b/public/vendor/codemirror/mode/apl/apl.js
diff --git a/public/vendor/codemirror/mode/apl/index.html b/public/vendor/codemirror/mode/apl/index.html
index 53dda6b5..53dda6b5 100755..100644
--- a/public/vendor/codemirror/mode/apl/index.html
+++ b/public/vendor/codemirror/mode/apl/index.html
diff --git a/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js b/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
index d8309037..d8309037 100755..100644
--- a/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
+++ b/public/vendor/codemirror/mode/asciiarmor/asciiarmor.js
diff --git a/public/vendor/codemirror/mode/asciiarmor/index.html b/public/vendor/codemirror/mode/asciiarmor/index.html
index 8ba1b5c7..8ba1b5c7 100755..100644
--- a/public/vendor/codemirror/mode/asciiarmor/index.html
+++ b/public/vendor/codemirror/mode/asciiarmor/index.html
diff --git a/public/vendor/codemirror/mode/asn.1/asn.1.js b/public/vendor/codemirror/mode/asn.1/asn.1.js
index 9600247e..9600247e 100755..100644
--- a/public/vendor/codemirror/mode/asn.1/asn.1.js
+++ b/public/vendor/codemirror/mode/asn.1/asn.1.js
diff --git a/public/vendor/codemirror/mode/asn.1/index.html b/public/vendor/codemirror/mode/asn.1/index.html
index 8346f8e5..699fd447 100755..100644
--- a/public/vendor/codemirror/mode/asn.1/index.html
+++ b/public/vendor/codemirror/mode/asn.1/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: ASN.1 mode</title>
<meta charset="utf-8"/>
@@ -73,6 +73,5 @@
<p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
</a>.</p>
<p>Coded by Asmelash Tsegay Gebretsadkan </p>
- </article>
</article>
diff --git a/public/vendor/codemirror/mode/asterisk/asterisk.js b/public/vendor/codemirror/mode/asterisk/asterisk.js
index b7ebfc5a..b7ebfc5a 100755..100644
--- a/public/vendor/codemirror/mode/asterisk/asterisk.js
+++ b/public/vendor/codemirror/mode/asterisk/asterisk.js
diff --git a/public/vendor/codemirror/mode/asterisk/index.html b/public/vendor/codemirror/mode/asterisk/index.html
index 257bd398..257bd398 100755..100644
--- a/public/vendor/codemirror/mode/asterisk/index.html
+++ b/public/vendor/codemirror/mode/asterisk/index.html
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 @@
+<!doctype html>
+
+<title>CodeMirror: Brainfuck mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="./brainfuck.js"></script>
+<style>
+ .CodeMirror { border: 2px inset #dee; }
+ </style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#"></a>
+ </ul>
+</div>
+
+<article>
+<h2>Brainfuck mode</h2>
+<form><textarea id="code" name="code">
+[ This program prints "Hello World!" and a newline to the screen, its
+ length is 106 active command characters [it is not the shortest.]
+
+ This loop is a "comment loop", it's a simple way of adding a comment
+ to a BF program such that you don't have to worry about any command
+ characters. Any ".", ",", "+", "-", "&lt;" and "&gt;" characters are simply
+ ignored, the "[" and "]" characters just have to be balanced.
+]
++++++ +++ Set Cell #0 to 8
+[
+ &gt;++++ Add 4 to Cell #1; this will always set Cell #1 to 4
+ [ as the cell will be cleared by the loop
+ &gt;++ Add 2 to Cell #2
+ &gt;+++ Add 3 to Cell #3
+ &gt;+++ Add 3 to Cell #4
+ &gt;+ Add 1 to Cell #5
+ &lt;&lt;&lt;&lt;- Decrement the loop counter in Cell #1
+ ] Loop till Cell #1 is zero; number of iterations is 4
+ &gt;+ Add 1 to Cell #2
+ &gt;+ Add 1 to Cell #3
+ &gt;- Subtract 1 from Cell #4
+ &gt;&gt;+ Add 1 to Cell #6
+ [&lt;] Move back to the first zero cell you find; this will
+ be Cell #1 which was cleared by the previous loop
+ &lt;- Decrement the loop Counter in Cell #0
+] Loop till Cell #0 is zero; number of iterations is 8
+
+The result of this is:
+Cell No : 0 1 2 3 4 5 6
+Contents: 0 0 72 104 88 32 8
+Pointer : ^
+
+&gt;&gt;. Cell #2 has value 72 which is 'H'
+&gt;---. Subtract 3 from Cell #3 to get 101 which is 'e'
++++++++..+++. Likewise for 'llo' from Cell #3
+&gt;&gt;. Cell #5 is 32 for the space
+&lt;-. Subtract 1 from Cell #4 for 87 to give a 'W'
+&lt;. Cell #3 was set to 'o' from the end of 'Hello'
++++.------.--------. Cell #3 for 'rl' and 'd'
+&gt;&gt;+. Add 1 to Cell #5 gives us an exclamation point
+&gt;++. And finally a newline from Cell #6
+</textarea></form>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-brainfuck"
+ });
+ </script>
+
+ <p>A mode for Brainfuck</p>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-brainfuck</code></p>
+ </article>
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js
index f1a7e7a9..4f5c0cf3 100755..100644
--- 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
index 8b386d22..45c670ae 100755..100644
--- a/public/vendor/codemirror/mode/clike/index.html
+++ b/public/vendor/codemirror/mode/clike/index.html
@@ -206,6 +206,103 @@ object FilterTest extends App {
}
</textarea></div>
+<h2>Kotlin mode</h2>
+
+<div><textarea id="kotlin-code">
+package org.wasabi.http
+
+import java.util.concurrent.Executors
+import java.net.InetSocketAddress
+import org.wasabi.app.AppConfiguration
+import io.netty.bootstrap.ServerBootstrap
+import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.socket.nio.NioServerSocketChannel
+import org.wasabi.app.AppServer
+
+public class HttpServer(private val appServer: AppServer) {
+
+ val bootstrap: ServerBootstrap
+ val primaryGroup: NioEventLoopGroup
+ val workerGroup: NioEventLoopGroup
+
+ init {
+ // Define worker groups
+ primaryGroup = NioEventLoopGroup()
+ workerGroup = NioEventLoopGroup()
+
+ // Initialize bootstrap of server
+ bootstrap = ServerBootstrap()
+
+ bootstrap.group(primaryGroup, workerGroup)
+ bootstrap.channel(javaClass<NioServerSocketChannel>())
+ bootstrap.childHandler(NettyPipelineInitializer(appServer))
+ }
+
+ public fun start(wait: Boolean = true) {
+ val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
+
+ if (wait) {
+ channel?.closeFuture()?.sync()
+ }
+ }
+
+ public fun stop() {
+ // Shutdown all event loops
+ primaryGroup.shutdownGracefully()
+ workerGroup.shutdownGracefully()
+
+ // Wait till all threads are terminated
+ primaryGroup.terminationFuture().sync()
+ workerGroup.terminationFuture().sync()
+ }
+}
+</textarea></div>
+
+<h2>Ceylon mode</h2>
+
+<div><textarea id="ceylon-code">
+"Produces the [[stream|Iterable]] that results from repeated
+ application of the given [[function|next]] to the given
+ [[first]] element of the stream, until the function first
+ returns [[finished]]. If the given function never returns
+ `finished`, the resulting stream is infinite.
+
+ For example:
+
+ loop(0)(2.plus).takeWhile(10.largerThan)
+
+ produces the stream `{ 0, 2, 4, 6, 8 }`."
+tagged("Streams")
+shared {Element+} loop&lt;Element&gt;(
+ "The first element of the resulting stream."
+ Element first)(
+ "The function that produces the next element of the
+ stream, given the current element. The function may
+ return [[finished]] to indicate the end of the
+ stream."
+ Element|Finished next(Element element))
+ =&gt; let (start = first)
+ object satisfies {Element+} {
+ first =&gt; start;
+ empty =&gt; false;
+ function nextElement(Element element)
+ =&gt; next(element);
+ iterator()
+ =&gt; object satisfies Iterator&lt;Element&gt; {
+ variable Element|Finished current = start;
+ shared actual Element|Finished next() {
+ if (!is Finished result = current) {
+ current = nextElement(result);
+ return result;
+ }
+ else {
+ return finished;
+ }
+ }
+ };
+ };
+</textarea></div>
+
<script>
var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
lineNumbers: true,
@@ -232,6 +329,16 @@ object FilterTest extends App {
matchBrackets: true,
mode: "text/x-scala"
});
+ var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-kotlin"
+ });
+ var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: "text/x-ceylon"
+ });
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
</script>
@@ -247,5 +354,7 @@ object FilterTest extends App {
(Java), <code>text/x-csharp</code> (C#),
<code>text/x-objectivec</code> (Objective-C),
<code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
- and <code>x-shader/x-fragment</code> (shader programs).</p>
+ <code>x-shader/x-fragment</code> (shader programs),
+ <code>text/x-squirrel</code> (Squirrel) and
+ <code>text/x-ceylon</code> (Ceylon)</p>
</article>
diff --git a/public/vendor/codemirror/mode/clike/scala.html b/public/vendor/codemirror/mode/clike/scala.html
index aa04cf0f..aa04cf0f 100755..100644
--- a/public/vendor/codemirror/mode/clike/scala.html
+++ b/public/vendor/codemirror/mode/clike/scala.html
diff --git a/public/vendor/codemirror/mode/clike/test.js b/public/vendor/codemirror/mode/clike/test.js
index 79b006de..c2600326 100755..100644
--- 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 <baz> ][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
index d531022a..44948d04 100755..100644
--- 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
index 3ecf4c48..81294bc1 100755..100644
--- 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)
+
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
diff --git a/public/vendor/codemirror/mode/cmake/cmake.js b/public/vendor/codemirror/mode/cmake/cmake.js
index 9f9eda54..9f9eda54 100755..100644
--- a/public/vendor/codemirror/mode/cmake/cmake.js
+++ b/public/vendor/codemirror/mode/cmake/cmake.js
diff --git a/public/vendor/codemirror/mode/cmake/index.html b/public/vendor/codemirror/mode/cmake/index.html
index ed114fec..ed114fec 100755..100644
--- a/public/vendor/codemirror/mode/cmake/index.html
+++ b/public/vendor/codemirror/mode/cmake/index.html
diff --git a/public/vendor/codemirror/mode/cobol/cobol.js b/public/vendor/codemirror/mode/cobol/cobol.js
index 897022b1..897022b1 100755..100644
--- a/public/vendor/codemirror/mode/cobol/cobol.js
+++ b/public/vendor/codemirror/mode/cobol/cobol.js
diff --git a/public/vendor/codemirror/mode/cobol/index.html b/public/vendor/codemirror/mode/cobol/index.html
index 4352419a..4352419a 100755..100644
--- a/public/vendor/codemirror/mode/cobol/index.html
+++ b/public/vendor/codemirror/mode/cobol/index.html
diff --git a/public/vendor/codemirror/mode/coffeescript/coffeescript.js b/public/vendor/codemirror/mode/coffeescript/coffeescript.js
index da0eb2d5..adf2184f 100755..100644
--- a/public/vendor/codemirror/mode/coffeescript/coffeescript.js
+++ b/public/vendor/codemirror/mode/coffeescript/coffeescript.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
var operators = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/;
var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/;
var identifiers = /^[_A-Za-z$][_A-Za-z$0-9]*/;
- var properties = /^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/;
+ var atProp = /^@[_A-Za-z$][_A-Za-z$0-9]*/;
var wordOperators = wordRegexp(["and", "or", "not",
"is", "isnt", "in",
@@ -145,6 +145,8 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
}
}
+
+
// Handle operators and delimiters
if (stream.match(operators) || stream.match(wordOperators)) {
return "operator";
@@ -157,6 +159,10 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return "atom";
}
+ if (stream.match(atProp) || state.prop && stream.match(identifiers)) {
+ return "property";
+ }
+
if (stream.match(keywords)) {
return "keyword";
}
@@ -165,10 +171,6 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return "variable";
}
- if (stream.match(properties)) {
- return "property";
- }
-
// Handle non-detected items
stream.next();
return ERRORCLASS;
@@ -265,24 +267,11 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
var style = state.tokenize(stream, state);
var current = stream.current();
- // Handle "." connected identifiers
- if (current === ".") {
- style = state.tokenize(stream, state);
- current = stream.current();
- if (/^\.[\w$]+$/.test(current)) {
- return "variable";
- } else {
- return ERRORCLASS;
- }
- }
-
// Handle scope changes.
if (current === "return") {
state.dedent = true;
}
- if (((current === "->" || current === "=>") &&
- !state.lambda &&
- !stream.peek())
+ if (((current === "->" || current === "=>") && stream.eol())
|| style === "indent") {
indent(stream, state);
}
@@ -324,8 +313,7 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
return {
tokenize: tokenBase,
scope: {offset:basecolumn || 0, type:"coffee", prev: null, align: false},
- lastToken: null,
- lambda: false,
+ prop: false,
dedent: 0
};
},
@@ -335,12 +323,9 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
if (fillAlign && stream.sol()) fillAlign.align = false;
var style = tokenLexer(stream, state);
- if (fillAlign && style && style != "comment") fillAlign.align = true;
-
- state.lastToken = {style:style, content: stream.current()};
-
- if (stream.eol() && stream.lambda) {
- state.lambda = false;
+ if (style && style != "comment") {
+ if (fillAlign) fillAlign.align = true;
+ state.prop = style == "punctuation" && stream.current() == "."
}
return style;
@@ -365,5 +350,6 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
});
CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");
+CodeMirror.defineMIME("text/coffeescript", "coffeescript");
});
diff --git a/public/vendor/codemirror/mode/coffeescript/index.html b/public/vendor/codemirror/mode/coffeescript/index.html
index 93a5f4f3..93a5f4f3 100755..100644
--- a/public/vendor/codemirror/mode/coffeescript/index.html
+++ b/public/vendor/codemirror/mode/coffeescript/index.html
diff --git a/public/vendor/codemirror/mode/commonlisp/commonlisp.js b/public/vendor/codemirror/mode/commonlisp/commonlisp.js
index fb1f99c6..fb1f99c6 100755..100644
--- a/public/vendor/codemirror/mode/commonlisp/commonlisp.js
+++ b/public/vendor/codemirror/mode/commonlisp/commonlisp.js
diff --git a/public/vendor/codemirror/mode/commonlisp/index.html b/public/vendor/codemirror/mode/commonlisp/index.html
index f2bf4522..f2bf4522 100755..100644
--- a/public/vendor/codemirror/mode/commonlisp/index.html
+++ b/public/vendor/codemirror/mode/commonlisp/index.html
diff --git a/public/vendor/codemirror/mode/crystal/crystal.js b/public/vendor/codemirror/mode/crystal/crystal.js
new file mode 100644
index 00000000..2e74bee4
--- /dev/null
+++ b/public/vendor/codemirror/mode/crystal/crystal.js
@@ -0,0 +1,391 @@
+// 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("crystal", function(config) {
+ function wordRegExp(words, end) {
+ return new RegExp((end ? "" : "^") + "(?:" + words.join("|") + ")" + (end ? "$" : "\\b"));
+ }
+
+ function chain(tokenize, stream, state) {
+ state.tokenize.push(tokenize);
+ return tokenize(stream, state);
+ }
+
+ var operators = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/;
+ var conditionalOperators = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/;
+ var indexingOperators = /^(?:\[\][?=]?)/;
+ var anotherOperators = /^(?:\.(?:\.{2})?|->|[?:])/;
+ var idents = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
+ var types = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/;
+ var keywords = wordRegExp([
+ "abstract", "alias", "as", "asm", "begin", "break", "case", "class", "def", "do",
+ "else", "elsif", "end", "ensure", "enum", "extend", "for", "fun", "if", "ifdef",
+ "include", "instance_sizeof", "lib", "macro", "module", "next", "of", "out", "pointerof",
+ "private", "protected", "rescue", "return", "require", "sizeof", "struct",
+ "super", "then", "type", "typeof", "union", "unless", "until", "when", "while", "with",
+ "yield", "__DIR__", "__FILE__", "__LINE__"
+ ]);
+ var atomWords = wordRegExp(["true", "false", "nil", "self"]);
+ var indentKeywordsArray = [
+ "def", "fun", "macro",
+ "class", "module", "struct", "lib", "enum", "union",
+ "if", "unless", "case", "while", "until", "begin", "then",
+ "do",
+ "for", "ifdef"
+ ];
+ var indentKeywords = wordRegExp(indentKeywordsArray);
+ var dedentKeywordsArray = [
+ "end",
+ "else", "elsif",
+ "rescue", "ensure"
+ ];
+ var dedentKeywords = wordRegExp(dedentKeywordsArray);
+ var dedentPunctualsArray = ["\\)", "\\}", "\\]"];
+ var dedentPunctuals = new RegExp("^(?:" + dedentPunctualsArray.join("|") + ")$");
+ var nextTokenizer = {
+ "def": tokenFollowIdent, "fun": tokenFollowIdent, "macro": tokenMacroDef,
+ "class": tokenFollowType, "module": tokenFollowType, "struct": tokenFollowType,
+ "lib": tokenFollowType, "enum": tokenFollowType, "union": tokenFollowType
+ };
+ var matching = {"[": "]", "{": "}", "(": ")", "<": ">"};
+
+ function tokenBase(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ // Macros
+ if (state.lastToken != "\\" && stream.match("{%", false)) {
+ return chain(tokenMacro("%", "%"), stream, state);
+ }
+
+ if (state.lastToken != "\\" && stream.match("{{", false)) {
+ return chain(tokenMacro("{", "}"), stream, state);
+ }
+
+ // Comments
+ if (stream.peek() == "#") {
+ stream.skipToEnd();
+ return "comment";
+ }
+
+ // Variables and keywords
+ var matched;
+ if (stream.match(idents)) {
+ stream.eat(/[?!]/);
+
+ matched = stream.current();
+ if (stream.eat(":")) {
+ return "atom";
+ } else if (state.lastToken == ".") {
+ return "property";
+ } else if (keywords.test(matched)) {
+ if (state.lastToken != "abstract" && indentKeywords.test(matched)) {
+ if (!(matched == "fun" && state.blocks.indexOf("lib") >= 0)) {
+ state.blocks.push(matched);
+ state.currentIndent += 1;
+ }
+ } else if (dedentKeywords.test(matched)) {
+ state.blocks.pop();
+ state.currentIndent -= 1;
+ }
+
+ if (nextTokenizer.hasOwnProperty(matched)) {
+ state.tokenize.push(nextTokenizer[matched]);
+ }
+
+ return "keyword";
+ } else if (atomWords.test(matched)) {
+ return "atom";
+ }
+
+ return "variable";
+ }
+
+ // Class variables and instance variables
+ // or attributes
+ if (stream.eat("@")) {
+ if (stream.peek() == "[") {
+ return chain(tokenNest("[", "]", "meta"), stream, state);
+ }
+
+ stream.eat("@");
+ stream.match(idents) || stream.match(types);
+ return "variable-2";
+ }
+
+ // Global variables
+ if (stream.eat("$")) {
+ stream.eat(/[0-9]+|\?/) || stream.match(idents) || stream.match(types);
+ return "variable-3";
+ }
+
+ // Constants and types
+ if (stream.match(types)) {
+ return "tag";
+ }
+
+ // Symbols or ':' operator
+ if (stream.eat(":")) {
+ if (stream.eat("\"")) {
+ return chain(tokenQuote("\"", "atom", false), stream, state);
+ } else if (stream.match(idents) || stream.match(types) ||
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators)) {
+ return "atom";
+ }
+ stream.eat(":");
+ return "operator";
+ }
+
+ // Strings
+ if (stream.eat("\"")) {
+ return chain(tokenQuote("\"", "string", true), stream, state);
+ }
+
+ // Strings or regexps or macro variables or '%' operator
+ if (stream.peek() == "%") {
+ var style = "string";
+ var embed = true;
+ var delim;
+
+ if (stream.match("%r")) {
+ // Regexps
+ style = "string-2";
+ delim = stream.next();
+ } else if (stream.match("%w")) {
+ embed = false;
+ delim = stream.next();
+ } else {
+ if(delim = stream.match(/^%([^\w\s=])/)) {
+ delim = delim[1];
+ } else if (stream.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)) {
+ // Macro variables
+ return "meta";
+ } else {
+ // '%' operator
+ return "operator";
+ }
+ }
+
+ if (matching.hasOwnProperty(delim)) {
+ delim = matching[delim];
+ }
+ return chain(tokenQuote(delim, style, embed), stream, state);
+ }
+
+ // Characters
+ if (stream.eat("'")) {
+ stream.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/);
+ stream.eat("'");
+ return "atom";
+ }
+
+ // Numbers
+ if (stream.eat("0")) {
+ if (stream.eat("x")) {
+ stream.match(/^[0-9a-fA-F]+/);
+ } else if (stream.eat("o")) {
+ stream.match(/^[0-7]+/);
+ } else if (stream.eat("b")) {
+ stream.match(/^[01]+/);
+ }
+ return "number";
+ }
+
+ if (stream.eat(/\d/)) {
+ stream.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/);
+ return "number";
+ }
+
+ // Operators
+ if (stream.match(operators)) {
+ stream.eat("="); // Operators can follow assigin symbol.
+ return "operator";
+ }
+
+ if (stream.match(conditionalOperators) || stream.match(anotherOperators)) {
+ return "operator";
+ }
+
+ // Parens and braces
+ if (matched = stream.match(/[({[]/, false)) {
+ matched = matched[0];
+ return chain(tokenNest(matched, matching[matched], null), stream, state);
+ }
+
+ // Escapes
+ if (stream.eat("\\")) {
+ stream.next();
+ return "meta";
+ }
+
+ stream.next();
+ return null;
+ }
+
+ function tokenNest(begin, end, style, started) {
+ return function (stream, state) {
+ if (!started && stream.match(begin)) {
+ state.tokenize[state.tokenize.length - 1] = tokenNest(begin, end, style, true);
+ state.currentIndent += 1;
+ return style;
+ }
+
+ var nextStyle = tokenBase(stream, state);
+ if (stream.current() === end) {
+ state.tokenize.pop();
+ state.currentIndent -= 1;
+ nextStyle = style;
+ }
+
+ return nextStyle;
+ };
+ }
+
+ function tokenMacro(begin, end, started) {
+ return function (stream, state) {
+ if (!started && stream.match("{" + begin)) {
+ state.currentIndent += 1;
+ state.tokenize[state.tokenize.length - 1] = tokenMacro(begin, end, true);
+ return "meta";
+ }
+
+ if (stream.match(end + "}")) {
+ state.currentIndent -= 1;
+ state.tokenize.pop();
+ return "meta";
+ }
+
+ return tokenBase(stream, state);
+ };
+ }
+
+ function tokenMacroDef(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ var matched;
+ if (matched = stream.match(idents)) {
+ if (matched == "def") {
+ return "keyword";
+ }
+ stream.eat(/[?!]/);
+ }
+
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenFollowIdent(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ if (stream.match(idents)) {
+ stream.eat(/[!?]/);
+ } else {
+ stream.match(operators) || stream.match(conditionalOperators) || stream.match(indexingOperators);
+ }
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenFollowType(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ stream.match(types);
+ state.tokenize.pop();
+ return "def";
+ }
+
+ function tokenQuote(end, style, embed) {
+ return function (stream, state) {
+ var escaped = false;
+
+ while (stream.peek()) {
+ if (!escaped) {
+ if (stream.match("{%", false)) {
+ state.tokenize.push(tokenMacro("%", "%"));
+ return style;
+ }
+
+ if (stream.match("{{", false)) {
+ state.tokenize.push(tokenMacro("{", "}"));
+ return style;
+ }
+
+ if (embed && stream.match("#{", false)) {
+ state.tokenize.push(tokenNest("#{", "}", "meta"));
+ return style;
+ }
+
+ var ch = stream.next();
+
+ if (ch == end) {
+ state.tokenize.pop();
+ return style;
+ }
+
+ escaped = ch == "\\";
+ } else {
+ stream.next();
+ escaped = false;
+ }
+ }
+
+ return style;
+ };
+ }
+
+ return {
+ startState: function () {
+ return {
+ tokenize: [tokenBase],
+ currentIndent: 0,
+ lastToken: null,
+ blocks: []
+ };
+ },
+
+ token: function (stream, state) {
+ var style = state.tokenize[state.tokenize.length - 1](stream, state);
+ var token = stream.current();
+
+ if (style && style != "comment") {
+ state.lastToken = token;
+ }
+
+ return style;
+ },
+
+ indent: function (state, textAfter) {
+ textAfter = textAfter.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, "");
+
+ if (dedentKeywords.test(textAfter) || dedentPunctuals.test(textAfter)) {
+ return config.indentUnit * (state.currentIndent - 1);
+ }
+
+ return config.indentUnit * state.currentIndent;
+ },
+
+ fold: "indent",
+ electricInput: wordRegExp(dedentPunctualsArray.concat(dedentKeywordsArray), true),
+ lineComment: '#'
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-crystal", "crystal");
+});
diff --git a/public/vendor/codemirror/mode/crystal/index.html b/public/vendor/codemirror/mode/crystal/index.html
new file mode 100644
index 00000000..ec03e250
--- /dev/null
+++ b/public/vendor/codemirror/mode/crystal/index.html
@@ -0,0 +1,119 @@
+<!doctype html>
+
+<title>CodeMirror: Crystal mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="crystal.js"></script>
+<style>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+ .cm-s-default span.cm-arrow { color: red; }
+</style>
+
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Crystal</a>
+ </ul>
+</div>
+
+<article>
+<h2>Crystal mode</h2>
+<form><textarea id="code" name="code">
+# Features of Crystal
+# - Ruby-inspired syntax.
+# - Statically type-checked but without having to specify the type of variables or method arguments.
+# - Be able to call C code by writing bindings to it in Crystal.
+# - Have compile-time evaluation and generation of code, to avoid boilerplate code.
+# - Compile to efficient native code.
+
+# A very basic HTTP server
+require "http/server"
+
+server = HTTP::Server.new(8080) do |request|
+ HTTP::Response.ok "text/plain", "Hello world, got #{request.path}!"
+end
+
+puts "Listening on http://0.0.0.0:8080"
+server.listen
+
+module Foo
+ def initialize(@foo); end
+
+ abstract def abstract_method : String
+
+ @[AlwaysInline]
+ def with_foofoo
+ with Foo.new(self) yield
+ end
+
+ struct Foo
+ def initialize(@foo); end
+
+ def hello_world
+ @foo.abstract_method
+ end
+ end
+end
+
+class Bar
+ include Foo
+
+ @@foobar = 12345
+
+ def initialize(@bar)
+ super(@bar.not_nil! + 100)
+ end
+
+ macro alias_method(name, method)
+ def {{ name }}(*args)
+ {{ method }}(*args)
+ end
+ end
+
+ def a_method
+ "Hello, World"
+ end
+
+ alias_method abstract_method, a_method
+
+ macro def show_instance_vars : Nil
+ {% for var in @type.instance_vars %}
+ puts "@{{ var }} = #{ @{{ var }} }"
+ {% end %}
+ nil
+ end
+end
+
+class Baz &lt; Bar; end
+
+lib LibC
+ fun c_puts = "puts"(str : Char*) : Int
+end
+
+$baz = Baz.new(100)
+$baz.show_instance_vars
+$baz.with_foofoo do
+ LibC.c_puts hello_world
+end
+</textarea></form>
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: "text/x-crystal",
+ matchBrackets: true,
+ indentUnit: 2
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-crystal</code>.</p>
+</article>
diff --git a/public/vendor/codemirror/mode/css/css.js b/public/vendor/codemirror/mode/css/css.js
index 1e6d2ddb..e9656e3d 100755..100644
--- 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 @@
+<!doctype html>
+
+<title>CodeMirror: Closure Stylesheets (GSS) mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<link rel="stylesheet" href="../../addon/hint/show-hint.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="css.js"></script>
+<script src="../../addon/hint/show-hint.js"></script>
+<script src="../../addon/hint/css-hint.js"></script>
+<style>.CodeMirror {background: #f8f8f8;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Closure Stylesheets (GSS)</a>
+ </ul>
+</div>
+
+<article>
+<h2>Closure Stylesheets (GSS) mode</h2>
+<form><textarea id="code" name="code">
+/* Some example Closure Stylesheets */
+
+@provide 'some.styles';
+
+@require 'other.styles';
+
+@component {
+
+@def FONT_FAMILY "Times New Roman", Georgia, Serif;
+@def FONT_SIZE_NORMAL 15px;
+@def FONT_NORMAL normal FONT_SIZE_NORMAL FONT_FAMILY;
+
+@def BG_COLOR rgb(235, 239, 249);
+
+@def DIALOG_BORDER_COLOR rgb(107, 144, 218);
+@def DIALOG_BG_COLOR BG_COLOR;
+
+@def LEFT_HAND_NAV_WIDTH 180px;
+@def LEFT_HAND_NAV_PADDING 3px;
+
+@defmixin size(WIDTH, HEIGHT) {
+ width: WIDTH;
+ height: HEIGHT;
+}
+
+body {
+ background-color: BG_COLOR;
+ margin: 0;
+ padding: 3em 6em;
+ font: FONT_NORMAL;
+ color: #000;
+}
+
+#navigation a {
+ font-weight: bold;
+ text-decoration: none !important;
+}
+
+.dialog {
+ background-color: DIALOG_BG_COLOR;
+ border: 1px solid DIALOG_BORDER_COLOR;
+}
+
+.content {
+ position: absolute;
+ margin-left: add(LEFT_HAND_NAV_PADDING, /* padding left */
+ LEFT_HAND_NAV_WIDTH,
+ LEFT_HAND_NAV_PADDING); /* padding right */
+
+}
+
+.logo {
+ @mixin size(150px, 55px);
+ background-image: url('http://www.google.com/images/logo_sm.gif');
+}
+
+}
+</textarea></form>
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ extraKeys: {"Ctrl-Space": "autocomplete"},
+ lineNumbers: true,
+ matchBrackets: "text/x-less",
+ mode: "text/x-gss"
+ });
+ </script>
+
+ <p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p>
+ <p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p>
+
+ <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>, <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p>
+
+ </article>
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
index 2d2b9b07..2d2b9b07 100755..100644
--- a/public/vendor/codemirror/mode/css/index.html
+++ b/public/vendor/codemirror/mode/css/index.html
diff --git a/public/vendor/codemirror/mode/css/less.html b/public/vendor/codemirror/mode/css/less.html
index adf7427d..adf7427d 100755..100644
--- a/public/vendor/codemirror/mode/css/less.html
+++ b/public/vendor/codemirror/mode/css/less.html
diff --git a/public/vendor/codemirror/mode/css/less_test.js b/public/vendor/codemirror/mode/css/less_test.js
index 7b77f584..dd821558 100755..100644
--- 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
index f8e4d373..f8e4d373 100755..100644
--- a/public/vendor/codemirror/mode/css/scss.html
+++ b/public/vendor/codemirror/mode/css/scss.html
diff --git a/public/vendor/codemirror/mode/css/scss_test.js b/public/vendor/codemirror/mode/css/scss_test.js
index 26c226a1..785921b3 100755..100644
--- 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
index 55ae676e..7a496fb0 100755..100644
--- 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
index e218d473..107e4f6d 100755..100644
--- 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
index b8bd75c8..b8bd75c8 100755..100644
--- a/public/vendor/codemirror/mode/cypher/index.html
+++ b/public/vendor/codemirror/mode/cypher/index.html
diff --git a/public/vendor/codemirror/mode/d/d.js b/public/vendor/codemirror/mode/d/d.js
index c927a7e3..c927a7e3 100755..100644
--- a/public/vendor/codemirror/mode/d/d.js
+++ b/public/vendor/codemirror/mode/d/d.js
diff --git a/public/vendor/codemirror/mode/d/index.html b/public/vendor/codemirror/mode/d/index.html
index 08cabd8a..08cabd8a 100755..100644
--- a/public/vendor/codemirror/mode/d/index.html
+++ b/public/vendor/codemirror/mode/d/index.html
diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js
index a49e218c..d92eb519 100755..100644
--- 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
index e79da5a8..e79da5a8 100755..100644
--- a/public/vendor/codemirror/mode/dart/index.html
+++ b/public/vendor/codemirror/mode/dart/index.html
diff --git a/public/vendor/codemirror/mode/diff/diff.js b/public/vendor/codemirror/mode/diff/diff.js
index fe0305e7..fe0305e7 100755..100644
--- a/public/vendor/codemirror/mode/diff/diff.js
+++ b/public/vendor/codemirror/mode/diff/diff.js
diff --git a/public/vendor/codemirror/mode/diff/index.html b/public/vendor/codemirror/mode/diff/index.html
index 0af611fa..0af611fa 100755..100644
--- a/public/vendor/codemirror/mode/diff/index.html
+++ b/public/vendor/codemirror/mode/diff/index.html
diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js
index 2f08b063..eb8d6591 100755..100644
--- 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
index 41ea07c9..41ea07c9 100755..100644
--- a/public/vendor/codemirror/mode/django/index.html
+++ b/public/vendor/codemirror/mode/django/index.html
diff --git a/public/vendor/codemirror/mode/dockerfile/dockerfile.js b/public/vendor/codemirror/mode/dockerfile/dockerfile.js
index 6d517750..4419009a 100755..100644
--- 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
index a31759bc..a31759bc 100755..100644
--- a/public/vendor/codemirror/mode/dockerfile/index.html
+++ b/public/vendor/codemirror/mode/dockerfile/index.html
diff --git a/public/vendor/codemirror/mode/dtd/dtd.js b/public/vendor/codemirror/mode/dtd/dtd.js
index f37029a7..f37029a7 100755..100644
--- a/public/vendor/codemirror/mode/dtd/dtd.js
+++ b/public/vendor/codemirror/mode/dtd/dtd.js
diff --git a/public/vendor/codemirror/mode/dtd/index.html b/public/vendor/codemirror/mode/dtd/index.html
index e6798a74..e6798a74 100755..100644
--- a/public/vendor/codemirror/mode/dtd/index.html
+++ b/public/vendor/codemirror/mode/dtd/index.html
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
index 85f0166c..85f0166c 100755..100644
--- a/public/vendor/codemirror/mode/dylan/dylan.js
+++ b/public/vendor/codemirror/mode/dylan/dylan.js
diff --git a/public/vendor/codemirror/mode/dylan/index.html b/public/vendor/codemirror/mode/dylan/index.html
index ddf5ad06..ddf5ad06 100755..100644
--- a/public/vendor/codemirror/mode/dylan/index.html
+++ b/public/vendor/codemirror/mode/dylan/index.html
diff --git a/public/vendor/codemirror/mode/ebnf/ebnf.js b/public/vendor/codemirror/mode/ebnf/ebnf.js
index 6b51aba0..6b51aba0 100755..100644
--- a/public/vendor/codemirror/mode/ebnf/ebnf.js
+++ b/public/vendor/codemirror/mode/ebnf/ebnf.js
diff --git a/public/vendor/codemirror/mode/ebnf/index.html b/public/vendor/codemirror/mode/ebnf/index.html
index 13845629..13845629 100755..100644
--- a/public/vendor/codemirror/mode/ebnf/index.html
+++ b/public/vendor/codemirror/mode/ebnf/index.html
diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js
index 8df7ebe4..8df7ebe4 100755..100644
--- a/public/vendor/codemirror/mode/ecl/ecl.js
+++ b/public/vendor/codemirror/mode/ecl/ecl.js
diff --git a/public/vendor/codemirror/mode/ecl/index.html b/public/vendor/codemirror/mode/ecl/index.html
index 2306860d..2306860d 100755..100644
--- a/public/vendor/codemirror/mode/ecl/index.html
+++ b/public/vendor/codemirror/mode/ecl/index.html
diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js
index b8b70e36..b8b70e36 100755..100644
--- a/public/vendor/codemirror/mode/eiffel/eiffel.js
+++ b/public/vendor/codemirror/mode/eiffel/eiffel.js
diff --git a/public/vendor/codemirror/mode/eiffel/index.html b/public/vendor/codemirror/mode/eiffel/index.html
index 108a71be..108a71be 100755..100644
--- a/public/vendor/codemirror/mode/eiffel/index.html
+++ b/public/vendor/codemirror/mode/eiffel/index.html
diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js
index 7124c50a..b31e6637 100755..100644
--- 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
index d5cb16ab..d5cb16ab 100755..100644
--- a/public/vendor/codemirror/mode/elm/index.html
+++ b/public/vendor/codemirror/mode/elm/index.html
diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js
index fbca292f..5aed76a5 100755..100644
--- 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
index 6d06a890..6d06a890 100755..100644
--- a/public/vendor/codemirror/mode/erlang/index.html
+++ b/public/vendor/codemirror/mode/erlang/index.html
diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js
index 86d7adf6..86d7adf6 100755..100644
--- a/public/vendor/codemirror/mode/factor/factor.js
+++ b/public/vendor/codemirror/mode/factor/factor.js
diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html
index 9f154891..9f154891 100755..100644
--- a/public/vendor/codemirror/mode/factor/index.html
+++ b/public/vendor/codemirror/mode/factor/index.html
diff --git a/public/vendor/codemirror/mode/forth/forth.js b/public/vendor/codemirror/mode/forth/forth.js
index 1f519d88..1f519d88 100755..100644
--- a/public/vendor/codemirror/mode/forth/forth.js
+++ b/public/vendor/codemirror/mode/forth/forth.js
diff --git a/public/vendor/codemirror/mode/forth/index.html b/public/vendor/codemirror/mode/forth/index.html
index ae8cd345..ae8cd345 100755..100644
--- a/public/vendor/codemirror/mode/forth/index.html
+++ b/public/vendor/codemirror/mode/forth/index.html
diff --git a/public/vendor/codemirror/mode/fortran/fortran.js b/public/vendor/codemirror/mode/fortran/fortran.js
index 4d88f006..4d88f006 100755..100644
--- a/public/vendor/codemirror/mode/fortran/fortran.js
+++ b/public/vendor/codemirror/mode/fortran/fortran.js
diff --git a/public/vendor/codemirror/mode/fortran/index.html b/public/vendor/codemirror/mode/fortran/index.html
index 102e8f82..102e8f82 100755..100644
--- a/public/vendor/codemirror/mode/fortran/index.html
+++ b/public/vendor/codemirror/mode/fortran/index.html
diff --git a/public/vendor/codemirror/mode/gas/gas.js b/public/vendor/codemirror/mode/gas/gas.js
index 0c74bedc..0c74bedc 100755..100644
--- a/public/vendor/codemirror/mode/gas/gas.js
+++ b/public/vendor/codemirror/mode/gas/gas.js
diff --git a/public/vendor/codemirror/mode/gas/index.html b/public/vendor/codemirror/mode/gas/index.html
index df75ca2d..df75ca2d 100755..100644
--- a/public/vendor/codemirror/mode/gas/index.html
+++ b/public/vendor/codemirror/mode/gas/index.html
diff --git a/public/vendor/codemirror/mode/gfm/gfm.js b/public/vendor/codemirror/mode/gfm/gfm.js
index 80a8e2c8..6e74ad4f 100755..100644
--- 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
index 7e38c52d..7e38c52d 100755..100644
--- a/public/vendor/codemirror/mode/gfm/index.html
+++ b/public/vendor/codemirror/mode/gfm/index.html
diff --git a/public/vendor/codemirror/mode/gfm/test.js b/public/vendor/codemirror/mode/gfm/test.js
index c2bc38fd..0dcd3619 100755..100644
--- 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");
@@ -143,6 +157,9 @@
"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];}",
"[comment ```][link http://www.example.com/]");
@@ -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
index fc2ebee1..fc2ebee1 100755..100644
--- a/public/vendor/codemirror/mode/gherkin/gherkin.js
+++ b/public/vendor/codemirror/mode/gherkin/gherkin.js
diff --git a/public/vendor/codemirror/mode/gherkin/index.html b/public/vendor/codemirror/mode/gherkin/index.html
index af8184c9..af8184c9 100755..100644
--- a/public/vendor/codemirror/mode/gherkin/index.html
+++ b/public/vendor/codemirror/mode/gherkin/index.html
diff --git a/public/vendor/codemirror/mode/go/go.js b/public/vendor/codemirror/mode/go/go.js
index b121f4e6..21fe9a2d 100755..100644
--- 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
index 72e3b364..72e3b364 100755..100644
--- a/public/vendor/codemirror/mode/go/index.html
+++ b/public/vendor/codemirror/mode/go/index.html
diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js
index 721933b0..721933b0 100755..100644
--- a/public/vendor/codemirror/mode/groovy/groovy.js
+++ b/public/vendor/codemirror/mode/groovy/groovy.js
diff --git a/public/vendor/codemirror/mode/groovy/index.html b/public/vendor/codemirror/mode/groovy/index.html
index bb0df078..bb0df078 100755..100644
--- a/public/vendor/codemirror/mode/groovy/index.html
+++ b/public/vendor/codemirror/mode/groovy/index.html
diff --git a/public/vendor/codemirror/mode/haml/haml.js b/public/vendor/codemirror/mode/haml/haml.js
index 8fe63b02..03ce8335 100755..100644
--- 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
index 2894a938..2894a938 100755..100644
--- a/public/vendor/codemirror/mode/haml/index.html
+++ b/public/vendor/codemirror/mode/haml/index.html
diff --git a/public/vendor/codemirror/mode/haml/test.js b/public/vendor/codemirror/mode/haml/test.js
index 508458a4..508458a4 100755..100644
--- a/public/vendor/codemirror/mode/haml/test.js
+++ b/public/vendor/codemirror/mode/haml/test.js
diff --git a/public/vendor/codemirror/mode/handlebars/handlebars.js b/public/vendor/codemirror/mode/handlebars/handlebars.js
index 40dfea42..2174e538 100755..100644
--- 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
index beaef87a..4f82d602 100755..100644
--- a/public/vendor/codemirror/mode/handlebars/index.html
+++ b/public/vendor/codemirror/mode/handlebars/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: Handlebars mode</title>
<meta charset="utf-8"/>
@@ -61,22 +61,13 @@
</textarea></form>
<script>
- CodeMirror.defineMode("htmlhandlebars", function(config) {
- return CodeMirror.multiplexingMode(
- CodeMirror.getMode(config, "text/html"),
- {open: "{{", close: "}}",
- mode: CodeMirror.getMode(config, "handlebars"),
- parseDelimiters: true});
- });
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
- mode: "htmlhandlebars"
+ mode: {name: "handlebars", base: "text/html"}
});
</script>
- </script>
-
+
<p>Handlebars syntax highlighting for CodeMirror.</p>
<p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
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 @@
+<!doctype html>
+
+<title>CodeMirror: Haskell-literate mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="haskell-literate.js"></script>
+<script src="../haskell/haskell.js"></script>
+<style>.CodeMirror {
+ border-top : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo
+ src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Haskell-literate</a>
+ </ul>
+</div>
+
+<article>
+ <h2>Haskell literate mode</h2>
+ <form>
+ <textarea id="code" name="code">
+> {-# LANGUAGE OverloadedStrings #-}
+> {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
+> import Control.Applicative ((<$>), (<*>))
+> import Data.Maybe (isJust)
+
+> import Data.Text (Text)
+> import Text.Blaze ((!))
+> import qualified Data.Text as T
+> import qualified Happstack.Server as Happstack
+> import qualified Text.Blaze.Html5 as H
+> import qualified Text.Blaze.Html5.Attributes as A
+
+> import Text.Digestive
+> import Text.Digestive.Blaze.Html5
+> import Text.Digestive.Happstack
+> import Text.Digestive.Util
+
+Simple forms and validation
+---------------------------
+
+Let's start by creating a very simple datatype to represent a user:
+
+> data User = User
+> { userName :: Text
+> , userMail :: Text
+> } deriving (Show)
+
+And dive in immediately to create a `Form` for a user. The `Form v m a` type
+has three parameters:
+
+- `v`: the type for messages and errors (usually a `String`-like type, `Text` in
+ this case);
+- `m`: the monad we are operating in, not specified here;
+- `a`: the return type of the `Form`, in this case, this is obviously `User`.
+
+> userForm :: Monad m => Form Text m User
+
+We create forms by using the `Applicative` interface. A few form types are
+provided in the `Text.Digestive.Form` module, such as `text`, `string`,
+`bool`...
+
+In the `digestive-functors` library, the developer is required to label each
+field using the `.:` operator. This might look like a bit of a burden, but it
+allows you to do some really useful stuff, like separating the `Form` from the
+actual HTML layout.
+
+> userForm = User
+> <$> "name" .: text Nothing
+> <*> "mail" .: check "Not a valid email address" checkEmail (text Nothing)
+
+The `check` function enables you to validate the result of a form. For example,
+we can validate the email address with a really naive `checkEmail` function.
+
+> checkEmail :: Text -> Bool
+> checkEmail = isJust . T.find (== '@')
+
+More validation
+---------------
+
+For our example, we also want descriptions of Haskell libraries, and in order to
+do that, we need package versions...
+
+> type Version = [Int]
+
+We want to let the user input a version number such as `0.1.0.0`. This means we
+need to validate if the input `Text` is of this form, and then we need to parse
+it to a `Version` type. Fortunately, we can do this in a single function:
+`validate` allows conversion between values, which can optionally fail.
+
+`readMaybe :: Read a => String -> Maybe a` is a utility function imported from
+`Text.Digestive.Util`.
+
+> validateVersion :: Text -> Result Text Version
+> validateVersion = maybe (Error "Cannot parse version") Success .
+> mapM (readMaybe . T.unpack) . T.split (== '.')
+
+A quick test in GHCi:
+
+ ghci> validateVersion (T.pack "0.3.2.1")
+ Success [0,3,2,1]
+ ghci> validateVersion (T.pack "0.oops")
+ Error "Cannot parse version"
+
+It works! This means we can now easily add a `Package` type and a `Form` for it:
+
+> data Category = Web | Text | Math
+> deriving (Bounded, Enum, Eq, Show)
+
+> data Package = Package Text Version Category
+> deriving (Show)
+
+> packageForm :: Monad m => Form Text m Package
+> packageForm = Package
+> <$> "name" .: text Nothing
+> <*> "version" .: validate validateVersion (text (Just "0.0.0.1"))
+> <*> "category" .: choice categories Nothing
+> where
+> categories = [(x, T.pack (show x)) | x <- [minBound .. maxBound]]
+
+Composing forms
+---------------
+
+A release has an author and a package. Let's use this to illustrate the
+composability of the digestive-functors library: we can reuse the forms we have
+written earlier on.
+
+> data Release = Release User Package
+> deriving (Show)
+
+> releaseForm :: Monad m => Form Text m Release
+> releaseForm = Release
+> <$> "author" .: userForm
+> <*> "package" .: packageForm
+
+Views
+-----
+
+As mentioned before, one of the advantages of using digestive-functors is
+separation of forms and their actual HTML layout. In order to do this, we have
+another type, `View`.
+
+We can get a `View` from a `Form` by supplying input. A `View` contains more
+information than a `Form`, it has:
+
+- the original form;
+- the input given by the user;
+- any errors that have occurred.
+
+It is this view that we convert to HTML. For this tutorial, we use the
+[blaze-html] library, and some helpers from the `digestive-functors-blaze`
+library.
+
+[blaze-html]: http://jaspervdj.be/blaze/
+
+Let's write a view for the `User` form. As you can see, we here refer to the
+different fields in the `userForm`. The `errorList` will generate a list of
+errors for the `"mail"` field.
+
+> userView :: View H.Html -> H.Html
+> userView view = do
+> label "name" view "Name: "
+> inputText "name" view
+> H.br
+>
+> errorList "mail" view
+> label "mail" view "Email address: "
+> inputText "mail" view
+> H.br
+
+Like forms, views are also composable: let's illustrate that by adding a view
+for the `releaseForm`, in which we reuse `userView`. In order to do this, we
+take only the parts relevant to the author from the view by using `subView`. We
+can then pass the resulting view to our own `userView`.
+We have no special view code for `Package`, so we can just add that to
+`releaseView` as well. `childErrorList` will generate a list of errors for each
+child of the specified form. In this case, this means a list of errors from
+`"package.name"` and `"package.version"`. Note how we use `foo.bar` to refer to
+nested forms.
+
+> releaseView :: View H.Html -> H.Html
+> releaseView view = do
+> H.h2 "Author"
+> userView $ subView "author" view
+>
+> H.h2 "Package"
+> childErrorList "package" view
+>
+> label "package.name" view "Name: "
+> inputText "package.name" view
+> H.br
+>
+> label "package.version" view "Version: "
+> inputText "package.version" view
+> H.br
+>
+> label "package.category" view "Category: "
+> inputSelect "package.category" view
+> H.br
+
+The attentive reader might have wondered what the type parameter for `View` is:
+it is the `String`-like type used for e.g. error messages.
+But wait! We have
+ releaseForm :: Monad m => Form Text m Release
+ releaseView :: View H.Html -> H.Html
+... doesn't this mean that we need a `View Text` rather than a `View Html`? The
+answer is yes -- but having `View Html` allows us to write these views more
+easily with the `digestive-functors-blaze` library. Fortunately, we will be able
+to fix this using the `Functor` instance of `View`.
+ fmap :: Monad m => (v -> w) -> View v -> View w
+A backend
+---------
+To finish this tutorial, we need to be able to actually run this code. We need
+an HTTP server for that, and we use [Happstack] for this tutorial. The
+`digestive-functors-happstack` library gives about everything we need for this.
+[Happstack]: http://happstack.com/
+
+> site :: Happstack.ServerPart Happstack.Response
+> site = do
+> Happstack.decodeBody $ Happstack.defaultBodyPolicy "/tmp" 4096 4096 4096
+> r <- runForm "test" releaseForm
+> case r of
+> (view, Nothing) -> do
+> let view' = fmap H.toHtml view
+> Happstack.ok $ Happstack.toResponse $
+> template $
+> form view' "/" $ do
+> releaseView view'
+> H.br
+> inputSubmit "Submit"
+> (_, Just release) -> Happstack.ok $ Happstack.toResponse $
+> template $ do
+> css
+> H.h1 "Release received"
+> H.p $ H.toHtml $ show release
+>
+> main :: IO ()
+> main = Happstack.simpleHTTP Happstack.nullConf site
+
+Utilities
+---------
+
+> template :: H.Html -> H.Html
+> template body = H.docTypeHtml $ do
+> H.head $ do
+> H.title "digestive-functors tutorial"
+> css
+> H.body body
+> css :: H.Html
+> css = H.style ! A.type_ "text/css" $ do
+> "label {width: 130px; float: left; clear: both}"
+> "ul.digestive-functors-error-list {"
+> " color: red;"
+> " list-style-type: none;"
+> " padding-left: 0px;"
+> "}"
+ </textarea>
+ </form>
+
+ <p><strong>MIME types
+ defined:</strong> <code>text/x-literate-haskell</code>.</p>
+
+ <p>Parser configuration parameters recognized: <code>base</code> to
+ set the base mode (defaults to <code>"haskell"</code>).</p>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "haskell-literate"});
+ </script>
+
+</article>
diff --git a/public/vendor/codemirror/mode/haskell/haskell.js b/public/vendor/codemirror/mode/haskell/haskell.js
index fe0bab67..fe0bab67 100755..100644
--- a/public/vendor/codemirror/mode/haskell/haskell.js
+++ b/public/vendor/codemirror/mode/haskell/haskell.js
diff --git a/public/vendor/codemirror/mode/haskell/index.html b/public/vendor/codemirror/mode/haskell/index.html
index 42240b0f..42240b0f 100755..100644
--- a/public/vendor/codemirror/mode/haskell/index.html
+++ b/public/vendor/codemirror/mode/haskell/index.html
diff --git a/public/vendor/codemirror/mode/haxe/haxe.js b/public/vendor/codemirror/mode/haxe/haxe.js
index d49ad70f..a9573dd7 100755..100644
--- 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<len; i++)
- if(state.importedtypes[i]==typename) return true;
+ function imported(state, typename) {
+ if (/[a-z]/.test(typename.charAt(0)))
+ return false;
+ var len = state.importedtypes.length;
+ for (var i = 0; i<len; i++)
+ if(state.importedtypes[i]==typename) return true;
}
-
function registerimport(importname) {
- var state = cx.state;
- for (var t = state.importedtypes; t; t = t.next)
- if(t.name == importname) return;
- state.importedtypes = { name: importname, next: state.importedtypes };
+ var state = cx.state;
+ for (var t = state.importedtypes; t; t = t.next)
+ if(t.name == importname) return;
+ state.importedtypes = { name: importname, next: state.importedtypes };
}
// Combinator utils
@@ -208,13 +191,20 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
pass.apply(null, arguments);
return true;
}
+ function inList(name, list) {
+ for (var v = list; v; v = v.next)
+ if (v.name == name) return true;
+ return false;
+ }
function register(varname) {
var state = cx.state;
if (state.context) {
cx.marked = "def";
- for (var v = state.localVars; v; v = v.next)
- if (v.name == varname) return;
+ if (inList(varname, state.localVars)) return;
state.localVars = {name: varname, next: state.localVars};
+ } else if (state.globalVars) {
+ if (inList(varname, state.globalVars)) return;
+ state.globalVars = {name: varname, next: state.globalVars};
}
}
@@ -229,6 +219,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
cx.state.localVars = cx.state.context.vars;
cx.state.context = cx.state.context.prev;
}
+ popcontext.lex = true;
function pushlex(type, info) {
var result = function() {
var state = cx.state;
@@ -252,7 +243,7 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == wanted) return cont();
else if (wanted == ";") return pass();
else return cont(f);
- };
+ }
return f;
}
@@ -266,25 +257,26 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == "attribute") return cont(maybeattribute);
if (type == "function") return cont(functiondef);
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
- poplex, statement, poplex);
+ poplex, statement, poplex);
if (type == "variable") return cont(pushlex("stat"), maybelabel);
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
- block, poplex, poplex);
+ block, poplex, poplex);
if (type == "case") return cont(expression, expect(":"));
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
- statement, poplex, popcontext);
+ statement, poplex, popcontext);
if (type == "import") return cont(importdef, expect(";"));
if (type == "typedef") return cont(typedef);
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function expression(type) {
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
+ if (type == "type" ) return cont(maybeoperator);
if (type == "function") return cont(functiondef);
if (type == "keyword c") return cont(maybeexpression);
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
if (type == "operator") return cont(expression);
- if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator);
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
return cont();
}
@@ -318,14 +310,14 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
}
function importdef (type, value) {
- if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
- else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
+ else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
}
function typedef (type, value)
{
- if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
- else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
+ else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
}
function maybelabel(type) {
@@ -363,16 +355,19 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
if (type == ",") return cont(vardef1);
}
function forspec1(type, value) {
- if (type == "variable") {
- register(value);
- }
- return cont(pushlex(")"), pushcontext, forin, expression, poplex, statement, popcontext);
+ if (type == "variable") {
+ register(value);
+ return cont(forin, expression)
+ } else {
+ return pass()
+ }
}
function forin(_type, value) {
if (value == "in") return cont();
}
function functiondef(type, value) {
- if (type == "variable") {register(value); return cont(functiondef);}
+ //function names starting with upper-case letters are recognised as types, so cludging them together here.
+ if (type == "variable" || type == "type") {register(value); return cont(functiondef);}
if (value == "new") return cont(functiondef);
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext);
}
@@ -392,21 +387,23 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
}
// Interface
-
return {
startState: function(basecolumn) {
- var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
- return {
+ var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
+ var state = {
tokenize: haxeTokenBase,
reAllowed: true,
kwAllowed: true,
cc: [],
lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
- importedtypes: defaulttypes,
+ importedtypes: defaulttypes,
context: parserConfig.localVars && {vars: parserConfig.localVars},
indented: 0
};
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
+ state.globalVars = parserConfig.globalVars;
+ return state;
},
token: function(stream, state) {
diff --git a/public/vendor/codemirror/mode/haxe/index.html b/public/vendor/codemirror/mode/haxe/index.html
index d415b5e1..d415b5e1 100755..100644
--- a/public/vendor/codemirror/mode/haxe/index.html
+++ b/public/vendor/codemirror/mode/haxe/index.html
diff --git a/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js b/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
index 464dc57f..464dc57f 100755..100644
--- a/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
+++ b/public/vendor/codemirror/mode/htmlembedded/htmlembedded.js
diff --git a/public/vendor/codemirror/mode/htmlembedded/index.html b/public/vendor/codemirror/mode/htmlembedded/index.html
index 365ef8f3..365ef8f3 100755..100644
--- a/public/vendor/codemirror/mode/htmlembedded/index.html
+++ b/public/vendor/codemirror/mode/htmlembedded/index.html
diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
index 24552e2d..21e74f16 100755..100644
--- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
+++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
@@ -9,113 +9,142 @@
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
- var htmlMode = CodeMirror.getMode(config, {name: "xml",
- htmlMode: true,
- multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
- multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag});
- var cssMode = CodeMirror.getMode(config, "css");
-
- var scriptTypes = [], scriptTypesConf = parserConfig && parserConfig.scriptTypes;
- scriptTypes.push({matches: /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,
- mode: CodeMirror.getMode(config, "javascript")});
- if (scriptTypesConf) for (var i = 0; i < scriptTypesConf.length; ++i) {
- var conf = scriptTypesConf[i];
- scriptTypes.push({matches: conf.matches, mode: conf.mode && CodeMirror.getMode(config, conf.mode)});
- }
- scriptTypes.push({matches: /./,
- mode: CodeMirror.getMode(config, "text/plain")});
-
- function html(stream, state) {
- var tagName = state.htmlState.tagName;
- if (tagName) tagName = tagName.toLowerCase();
- var style = htmlMode.token(stream, state.htmlState);
- if (tagName == "script" && /\btag\b/.test(style) && stream.current() == ">") {
- // 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
index f94df9e2..f94df9e2 100755..100644
--- a/public/vendor/codemirror/mode/htmlmixed/index.html
+++ b/public/vendor/codemirror/mode/htmlmixed/index.html
diff --git a/public/vendor/codemirror/mode/http/http.js b/public/vendor/codemirror/mode/http/http.js
index 9a3c5f9f..9a3c5f9f 100755..100644
--- a/public/vendor/codemirror/mode/http/http.js
+++ b/public/vendor/codemirror/mode/http/http.js
diff --git a/public/vendor/codemirror/mode/http/index.html b/public/vendor/codemirror/mode/http/index.html
index 0b8d5315..0b8d5315 100755..100644
--- a/public/vendor/codemirror/mode/http/index.html
+++ b/public/vendor/codemirror/mode/http/index.html
diff --git a/public/vendor/codemirror/mode/idl/idl.js b/public/vendor/codemirror/mode/idl/idl.js
index 07308d71..07308d71 100755..100644
--- a/public/vendor/codemirror/mode/idl/idl.js
+++ b/public/vendor/codemirror/mode/idl/idl.js
diff --git a/public/vendor/codemirror/mode/idl/index.html b/public/vendor/codemirror/mode/idl/index.html
index 4c169e2d..4c169e2d 100755..100644
--- a/public/vendor/codemirror/mode/idl/index.html
+++ b/public/vendor/codemirror/mode/idl/index.html
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
index 8c6d0a43..a6c293ec 100755..100644
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -33,12 +33,16 @@ option.</p>
<li><a href="apl/index.html">APL</a></li>
<li><a href="asn.1/index.html">ASN.1</a></li>
<li><a href="asterisk/index.html">Asterisk dialplan</a></li>
+ <li><a href="brainfuck/index.html">Brainfuck</a></li>
<li><a href="clike/index.html">C, C++, C#</a></li>
+ <li><a href="clike/index.html">Ceylon</a></li>
<li><a href="clojure/index.html">Clojure</a></li>
+ <li><a href="css/gss.html">Closure Stylesheets (GSS)</a></li>
<li><a href="cmake/index.html">CMake</a></li>
<li><a href="cobol/index.html">COBOL</a></li>
<li><a href="coffeescript/index.html">CoffeeScript</a></li>
<li><a href="commonlisp/index.html">Common Lisp</a></li>
+ <li><a href="crystal/index.html">Crystal</a></li>
<li><a href="css/index.html">CSS</a></li>
<li><a href="cypher/index.html">Cypher</a></li>
<li><a href="python/index.html">Cython</a></li>
@@ -64,7 +68,7 @@ option.</p>
<li><a href="groovy/index.html">Groovy</a></li>
<li><a href="haml/index.html">HAML</a></li>
<li><a href="handlebars/index.html">Handlebars</a></li>
- <li><a href="haskell/index.html">Haskell</a></li>
+ <li><a href="haskell/index.html">Haskell</a> (<a href="haskell-literate/index.html">Literate</a>)</li>
<li><a href="haxe/index.html">Haxe</a></li>
<li><a href="htmlembedded/index.html">HTML embedded</a> (JSP, ASP.NET)</li>
<li><a href="htmlmixed/index.html">HTML mixed-mode</a></li>
@@ -72,7 +76,7 @@ option.</p>
<li><a href="idl/index.html">IDL</a></li>
<li><a href="clike/index.html">Java</a></li>
<li><a href="jade/index.html">Jade</a></li>
- <li><a href="javascript/index.html">JavaScript</a></li>
+ <li><a href="javascript/index.html">JavaScript</a> (<a href="jsx/index.html">JSX</a>)</li>
<li><a href="jinja2/index.html">Jinja2</a></li>
<li><a href="julia/index.html">Julia</a></li>
<li><a href="kotlin/index.html">Kotlin</a></li>
@@ -83,12 +87,15 @@ option.</p>
<li><a href="mathematica/index.html">Mathematica</a></li>
<li><a href="mirc/index.html">mIRC</a></li>
<li><a href="modelica/index.html">Modelica</a></li>
+ <li><a href="mscgen/index.html">MscGen</a></li>
<li><a href="mumps/index.html">MUMPS</a></li>
<li><a href="nginx/index.html">Nginx</a></li>
+ <li><a href="nsis/index.html">NSIS</a></li>
<li><a href="ntriples/index.html">NTriples</a></li>
<li><a href="clike/index.html">Objective C</a></li>
<li><a href="mllike/index.html">OCaml</a></li>
<li><a href="octave/index.html">Octave</a> (MATLAB)</li>
+ <li><a href="oz/index.html">Oz</a></li>
<li><a href="pascal/index.html">Pascal</a></li>
<li><a href="pegjs/index.html">PEG.js</a></li>
<li><a href="perl/index.html">Perl</a></li>
@@ -119,6 +126,7 @@ option.</p>
<li><a href="stylus/index.html">Stylus</a></li>
<li><a href="sql/index.html">SQL</a> (several dialects)</li>
<li><a href="sparql/index.html">SPARQL</a></li>
+ <li><a href="clike/index.html">Squirrel</a></li>
<li><a href="swift/index.html">Swift</a></li>
<li><a href="stex/index.html">sTeX, LaTeX</a></li>
<li><a href="tcl/index.html">Tcl</a></li>
@@ -136,9 +144,12 @@ option.</p>
<li><a href="vbscript/index.html">VBScript</a></li>
<li><a href="velocity/index.html">Velocity</a></li>
<li><a href="verilog/index.html">Verilog/SystemVerilog</a></li>
+ <li><a href="vhdl/index.html">VHDL</a></li>
+ <li><a href="vue/index.html">Vue.js app</a></li>
<li><a href="xml/index.html">XML/HTML</a></li>
<li><a href="xquery/index.html">XQuery</a></li>
<li><a href="yaml/index.html">YAML</a></li>
+ <li><a href="yaml-frontmatter/index.html">YAML frontmatter</a></li>
<li><a href="z80/index.html">Z80</a></li>
</ul>
</div>
diff --git a/public/vendor/codemirror/mode/jade/index.html b/public/vendor/codemirror/mode/jade/index.html
index e534981b..e534981b 100755..100644
--- a/public/vendor/codemirror/mode/jade/index.html
+++ b/public/vendor/codemirror/mode/jade/index.html
diff --git a/public/vendor/codemirror/mode/jade/jade.js b/public/vendor/codemirror/mode/jade/jade.js
index 96fadb19..1db069a9 100755..100644
--- 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
index 592a133d..592a133d 100755..100644
--- a/public/vendor/codemirror/mode/javascript/index.html
+++ b/public/vendor/codemirror/mode/javascript/index.html
diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js
index c86f49e1..fa5721d5 100755..100644
--- 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
index 3a37f0bc..3a37f0bc 100755..100644
--- a/public/vendor/codemirror/mode/javascript/json-ld.html
+++ b/public/vendor/codemirror/mode/javascript/json-ld.html
diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js
index 092d25dc..cb43d089 100755..100644
--- 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
index 2cfc5381..2cfc5381 100755..100644
--- a/public/vendor/codemirror/mode/javascript/typescript.html
+++ b/public/vendor/codemirror/mode/javascript/typescript.html
diff --git a/public/vendor/codemirror/mode/jinja2/index.html b/public/vendor/codemirror/mode/jinja2/index.html
index 5a70e915..5a70e915 100755..100644
--- a/public/vendor/codemirror/mode/jinja2/index.html
+++ b/public/vendor/codemirror/mode/jinja2/index.html
diff --git a/public/vendor/codemirror/mode/jinja2/jinja2.js b/public/vendor/codemirror/mode/jinja2/jinja2.js
index ed195581..ed195581 100755..100644
--- a/public/vendor/codemirror/mode/jinja2/jinja2.js
+++ b/public/vendor/codemirror/mode/jinja2/jinja2.js
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 @@
+<!doctype html>
+
+<title>CodeMirror: JSX mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../javascript/javascript.js"></script>
+<script src="../xml/xml.js"></script>
+<script src="jsx.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">JSX</a>
+ </ul>
+</div>
+
+<article>
+<h2>JSX mode</h2>
+
+<div><textarea id="code" name="code">// Code snippets from http://facebook.github.io/react/docs/jsx-in-depth.html
+
+// Rendering HTML tags
+var myDivElement = <div className="foo" />;
+ReactDOM.render(myDivElement, document.getElementById('example'));
+
+// Rendering React components
+var MyComponent = React.createClass({/*...*/});
+var myElement = <MyComponent someProperty={true} />;
+ReactDOM.render(myElement, document.getElementById('example'));
+
+// Namespaced components
+var Form = MyFormComponent;
+
+var App = (
+ <Form>
+ <Form.Row>
+ <Form.Label />
+ <Form.Input />
+ </Form.Row>
+ </Form>
+);
+
+// Attribute JavaScript expressions
+var person = <Person name={window.isLoggedIn ? window.name : ''} />;
+
+// Boolean attributes
+<input type="button" disabled />;
+<input type="button" disabled={true} />;
+
+// Child JavaScript expressions
+var content = <Container>{window.isLoggedIn ? <Nav /> : <Login />}</Container>;
+
+// Comments
+var content = (
+ <Nav>
+ {/* child comment, put {} around */}
+ <Person
+ /* multi
+ line
+ comment */
+ name={window.isLoggedIn ? window.name : ''} // end of line comment
+ />
+ </Nav>
+);
+</textarea></div>
+
+<script>
+var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ mode: "jsx"
+})
+</script>
+
+<p>JSX Mode for <a href="http://facebook.github.io/react">React</a>'s
+JavaScript syntax extension.</p>
+
+<p><strong>MIME types defined:</strong> <code>text/jsx</code>.</p>
+
+</article>
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 (/^</.test(cur)) {
+ cx.depth = 1
+ }
+ } else if (!style && (stop = cur.indexOf("{")) > -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 &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("attr",
+ "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_attr",
+ "([bracket&tag <][tag foo] [attribute abc]={[number 10]}[bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_text",
+ "([bracket&tag <][tag foo][bracket&tag >]hello {[number 10]} [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("nested_tag",
+ "([bracket&tag <][tag foo][bracket&tag ><][tag bar][bracket&tag ></][tag bar][bracket&tag ></][tag foo][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 </][tag foo][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 ></][tag foo][bracket&tag >][operator ++])")
+
+ MT("line_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >] // hello",
+ " [bracket&tag </][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment",
+ "([bracket&tag <][tag foo] [comment /* hello]",
+ "[comment line 2]",
+ "[comment line 3 */] [bracket&tag ></][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >]/* hello",
+ " line 2",
+ " line 3 */ [bracket&tag </][tag foo][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 </][tag foo][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
index e1492c21..e1492c21 100755..100644
--- a/public/vendor/codemirror/mode/julia/index.html
+++ b/public/vendor/codemirror/mode/julia/index.html
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
index d0a74cef..4471896b 100755..100644
--- 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 @@
-<!doctype html>
-
-<title>CodeMirror: Kotlin mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="kotlin.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
- <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
- <ul>
- <li><a href="../../index.html">Home</a>
- <li><a href="../../doc/manual.html">Manual</a>
- <li><a href="https://github.com/codemirror/codemirror">Code</a>
- </ul>
- <ul>
- <li><a href="../index.html">Language modes</a>
- <li><a class=active href="#">Kotlin</a>
- </ul>
-</div>
-
-<article>
-<h2>Kotlin mode</h2>
-
-
-<div><textarea id="code" name="code">
-package org.wasabi.http
-
-import java.util.concurrent.Executors
-import java.net.InetSocketAddress
-import org.wasabi.app.AppConfiguration
-import io.netty.bootstrap.ServerBootstrap
-import io.netty.channel.nio.NioEventLoopGroup
-import io.netty.channel.socket.nio.NioServerSocketChannel
-import org.wasabi.app.AppServer
-
-public class HttpServer(private val appServer: AppServer) {
-
- val bootstrap: ServerBootstrap
- val primaryGroup: NioEventLoopGroup
- val workerGroup: NioEventLoopGroup
-
- {
- // Define worker groups
- primaryGroup = NioEventLoopGroup()
- workerGroup = NioEventLoopGroup()
-
- // Initialize bootstrap of server
- bootstrap = ServerBootstrap()
-
- bootstrap.group(primaryGroup, workerGroup)
- bootstrap.channel(javaClass<NioServerSocketChannel>())
- bootstrap.childHandler(NettyPipelineInitializer(appServer))
- }
-
- public fun start(wait: Boolean = true) {
- val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
-
- if (wait) {
- channel?.closeFuture()?.sync()
- }
- }
-
- public fun stop() {
- // Shutdown all event loops
- primaryGroup.shutdownGracefully()
- workerGroup.shutdownGracefully()
-
- // Wait till all threads are terminated
- primaryGroup.terminationFuture().sync()
- workerGroup.terminationFuture().sync()
- }
-}
-</textarea></div>
-
- <script>
- var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- mode: {name: "kotlin"},
- lineNumbers: true,
- indentUnit: 4
- });
- </script>
- <h3>Mode for Kotlin (http://kotlin.jetbrains.org/)</h3>
- <p>Developed by Hadi Hariri (https://github.com/hhariri).</p>
- <p><strong>MIME type defined:</strong> <code>text/x-kotlin</code>.</p>
-</article>
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
index f4154798..f4154798 100755..100644
--- a/public/vendor/codemirror/mode/livescript/index.html
+++ b/public/vendor/codemirror/mode/livescript/index.html
diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js
index 4b26e046..4b26e046 100755..100644
--- a/public/vendor/codemirror/mode/livescript/livescript.js
+++ b/public/vendor/codemirror/mode/livescript/livescript.js
diff --git a/public/vendor/codemirror/mode/lua/index.html b/public/vendor/codemirror/mode/lua/index.html
index fc98b944..fc98b944 100755..100644
--- a/public/vendor/codemirror/mode/lua/index.html
+++ b/public/vendor/codemirror/mode/lua/index.html
diff --git a/public/vendor/codemirror/mode/lua/lua.js b/public/vendor/codemirror/mode/lua/lua.js
index 0b19abd3..0b19abd3 100755..100644
--- a/public/vendor/codemirror/mode/lua/lua.js
+++ b/public/vendor/codemirror/mode/lua/lua.js
diff --git a/public/vendor/codemirror/mode/markdown/index.html b/public/vendor/codemirror/mode/markdown/index.html
index c3bb8df9..15660c26 100755..100644
--- a/public/vendor/codemirror/mode/markdown/index.html
+++ b/public/vendor/codemirror/mode/markdown/index.html
@@ -350,8 +350,10 @@ Output:
});
</script>
- <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
+ <p>You might want to use the <a href="../gfm/index.html">Github-Flavored Markdown mode</a> instead, which adds support for fenced code blocks and a few other things.</p>
+ <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
+
<p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>, <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
index bef37b8a..70889205 100755..100644
--- 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
index 7cd0bf4b..6d7829fa 100755..100644
--- 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 <http://example.com/>] 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
index 57c42985..57c42985 100755..100644
--- a/public/vendor/codemirror/mode/mathematica/index.html
+++ b/public/vendor/codemirror/mode/mathematica/index.html
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
index 5ae6f55c..5ae6f55c 100755..100644
--- a/public/vendor/codemirror/mode/mathematica/mathematica.js
+++ b/public/vendor/codemirror/mode/mathematica/mathematica.js
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
index bb30c80f..49520717 100755..100644
--- 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
index fd2f34e4..fd2f34e4 100755..100644
--- a/public/vendor/codemirror/mode/mirc/index.html
+++ b/public/vendor/codemirror/mode/mirc/index.html
diff --git a/public/vendor/codemirror/mode/mirc/mirc.js b/public/vendor/codemirror/mode/mirc/mirc.js
index f0d5c6ad..f0d5c6ad 100755..100644
--- a/public/vendor/codemirror/mode/mirc/mirc.js
+++ b/public/vendor/codemirror/mode/mirc/mirc.js
diff --git a/public/vendor/codemirror/mode/mllike/index.html b/public/vendor/codemirror/mode/mllike/index.html
index 5923af8f..5923af8f 100755..100644
--- a/public/vendor/codemirror/mode/mllike/index.html
+++ b/public/vendor/codemirror/mode/mllike/index.html
diff --git a/public/vendor/codemirror/mode/mllike/mllike.js b/public/vendor/codemirror/mode/mllike/mllike.js
index bf0b8a67..bf0b8a67 100755..100644
--- a/public/vendor/codemirror/mode/mllike/mllike.js
+++ b/public/vendor/codemirror/mode/mllike/mllike.js
diff --git a/public/vendor/codemirror/mode/modelica/index.html b/public/vendor/codemirror/mode/modelica/index.html
index 408c3b17..408c3b17 100755..100644
--- a/public/vendor/codemirror/mode/modelica/index.html
+++ b/public/vendor/codemirror/mode/modelica/index.html
diff --git a/public/vendor/codemirror/mode/modelica/modelica.js b/public/vendor/codemirror/mode/modelica/modelica.js
index 77ec7a3c..77ec7a3c 100755..100644
--- a/public/vendor/codemirror/mode/modelica/modelica.js
+++ b/public/vendor/codemirror/mode/modelica/modelica.js
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 @@
+<!doctype html>
+
+<title>CodeMirror: MscGen mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="mscgen.js"></script>
+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">MscGen</a>
+ </ul>
+</div>
+
+<article>
+<h2>MscGen mode</h2>
+
+<div><textarea id="mscgen-code">
+# Sample mscgen program
+# See http://www.mcternan.me.uk/mscgen or
+# https://sverweij.github.io/mscgen_js for more samples
+msc {
+ # options
+ hscale="1.2";
+
+ # entities/ lifelines
+ a [label="Entity A"],
+ b [label="Entity B", linecolor="red", arclinecolor="red", textbgcolor="pink"],
+ c [label="Entity C"];
+
+ # arcs/ messages
+ a => c [label="doSomething(args)"];
+ b => c [label="doSomething(args)"];
+ c >> * [label="everyone asked me", arcskip="1"];
+ c =>> c [label="doing something"];
+ c -x * [label="report back", arcskip="1"];
+ |||;
+ --- [label="shows's over, however ..."];
+ b => a [label="did you see c doing something?"];
+ a -> b [label="nope"];
+ b :> a [label="shall we ask again?"];
+ a => b [label="naah"];
+ ...;
+}
+</textarea></div>
+
+<h2>Xù mode</h2>
+
+<div><textarea id="xu-code">
+# Xù - expansions to MscGen to support inline expressions
+# https://github.com/sverweij/mscgen_js/blob/master/wikum/xu.md
+# More samples: https://sverweij.github.io/mscgen_js
+msc {
+ hscale="0.8",
+ width="700";
+
+ a,
+ b [label="change store"],
+ c,
+ d [label="necro queue"],
+ e [label="natalis queue"],
+ f;
+
+ a =>> b [label="get change list()"];
+ a alt f [label="changes found"] { /* alt is a xu specific keyword*/
+ b >> a [label="list of changes"];
+ a =>> c [label="cull old stuff (list of changes)"];
+ b loop e [label="for each change"] { // loop is xu specific as well...
+ /*
+ * Interesting stuff happens.
+ */
+ c =>> b [label="get change()"];
+ b >> c [label="change"];
+ c alt e [label="change too old"] {
+ c =>> d [label="queue(change)"];
+ --- [label="change newer than latest run"];
+ c =>> e [label="queue(change)"];
+ --- [label="all other cases"];
+ ||| [label="leave well alone"];
+ };
+ };
+
+ c >> a [label="done
+ processing"];
+
+ /* shucks! nothing found ...*/
+ --- [label="nothing found"];
+ b >> a [label="nothing"];
+ a note a [label="silent exit"];
+ };
+}
+</textarea></div>
+
+<h2>MsGenny mode</h2>
+<div><textarea id="msgenny-code">
+# MsGenny - simplified version of MscGen / Xù
+# https://github.com/sverweij/mscgen_js/blob/master/wikum/msgenny.md
+# More samples: https://sverweij.github.io/mscgen_js
+a -> b : a -> b (signal);
+a => b : a => b (method);
+b >> a : b >> a (return value);
+a =>> b : a =>> b (callback);
+a -x b : a -x b (lost);
+a :> b : a :> b (emphasis);
+a .. b : a .. b (dotted);
+a -- b : "a -- b straight line";
+a note a : a note a\n(note),
+b box b : b box b\n(action);
+a rbox a : a rbox a\n(reference),
+b abox b : b abox b\n(state/ condition);
+||| : ||| (empty row);
+... : ... (omitted row);
+--- : --- (comment);
+</textarea></div>
+
+ <p>
+ Simple mode for highlighting MscGen and two derived sequence
+ chart languages.
+ </p>
+
+ <script>
+ var mscgenEditor = CodeMirror.fromTextArea(document.getElementById("mscgen-code"), {
+ lineNumbers: true,
+ mode: "text/x-mscgen",
+ });
+ var xuEditor = CodeMirror.fromTextArea(document.getElementById("xu-code"), {
+ lineNumbers: true,
+ mode: "text/x-xu",
+ });
+ var msgennyEditor = CodeMirror.fromTextArea(document.getElementById("msgenny-code"), {
+ lineNumbers: true,
+ mode: "text/x-msgenny",
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong>
+ <code>text/x-mscgen</code>
+ <code>text/x-xu</code>
+ <code>text/x-msgenny</code>
+ </p>
+
+</article>
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
index bd1f69ae..b1f92c21 100755..100644
--- a/public/vendor/codemirror/mode/mumps/index.html
+++ b/public/vendor/codemirror/mode/mumps/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: MUMPS mode</title>
<meta charset="utf-8"/>
@@ -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
;
- </textarea>
+ </textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "mumps",
diff --git a/public/vendor/codemirror/mode/mumps/mumps.js b/public/vendor/codemirror/mode/mumps/mumps.js
index 469f8c3d..469f8c3d 100755..100644
--- a/public/vendor/codemirror/mode/mumps/mumps.js
+++ b/public/vendor/codemirror/mode/mumps/mumps.js
diff --git a/public/vendor/codemirror/mode/nginx/index.html b/public/vendor/codemirror/mode/nginx/index.html
index 5ffdc081..03cf6714 100755..100644
--- a/public/vendor/codemirror/mode/nginx/index.html
+++ b/public/vendor/codemirror/mode/nginx/index.html
@@ -1,5 +1,5 @@
-<!doctype html>
-
+<!doctype html>
+<head>
<title>CodeMirror: NGINX mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
diff --git a/public/vendor/codemirror/mode/nginx/nginx.js b/public/vendor/codemirror/mode/nginx/nginx.js
index 135b9cc7..00a32249 100755..100644
--- a/public/vendor/codemirror/mode/nginx/nginx.js
+++ b/public/vendor/codemirror/mode/nginx/nginx.js
@@ -173,6 +173,6 @@ CodeMirror.defineMode("nginx", function(config) {
};
});
-CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf");
+CodeMirror.defineMIME("text/x-nginx-conf", "nginx");
});
diff --git a/public/vendor/codemirror/mode/nsis/index.html b/public/vendor/codemirror/mode/nsis/index.html
new file mode 100644
index 00000000..2afae87f
--- /dev/null
+++ b/public/vendor/codemirror/mode/nsis/index.html
@@ -0,0 +1,80 @@
+<!doctype html>
+
+<title>CodeMirror: NSIS mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel=stylesheet href=../../lib/codemirror.css>
+<script src=../../lib/codemirror.js></script>
+<script src="../../addon/mode/simple.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src=nsis.js></script>
+<style type=text/css>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">NSIS</a>
+ </ul>
+</div>
+
+<article>
+<h2>NSIS mode</h2>
+
+
+<textarea id=code>
+; This is a comment
+!ifdef ERROR
+ !error "Something went wrong"
+!endif
+
+OutFile "demo.exe"
+RequestExecutionLevel user
+SetDetailsPrint listonly
+
+!include "LogicLib.nsh"
+!include "WinVer.nsh"
+
+Section -mandatory
+
+ Call logWinVer
+
+ ${If} 1 > 0
+ MessageBox MB_OK "Hello world"
+ ${EndIf}
+
+SectionEnd
+
+Function logWinVer
+
+ ${If} ${IsWin10}
+ DetailPrint "Windows 10!"
+ ${ElseIf} ${AtLeastWinVista}
+ DetailPrint "We're post-XP"
+ ${Else}
+ DetailPrint "Legacy system"
+ ${EndIf}
+
+FunctionEnd
+</textarea>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
+ mode: 'nsis',
+ indentWithTabs: true,
+ smartIndent: true,
+ lineNumbers: true,
+ matchBrackets: true
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
+</article> \ 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
index 1355e718..1355e718 100755..100644
--- a/public/vendor/codemirror/mode/ntriples/index.html
+++ b/public/vendor/codemirror/mode/ntriples/index.html
diff --git a/public/vendor/codemirror/mode/ntriples/ntriples.js b/public/vendor/codemirror/mode/ntriples/ntriples.js
index 0524b1e8..0524b1e8 100755..100644
--- a/public/vendor/codemirror/mode/ntriples/ntriples.js
+++ b/public/vendor/codemirror/mode/ntriples/ntriples.js
diff --git a/public/vendor/codemirror/mode/octave/index.html b/public/vendor/codemirror/mode/octave/index.html
index 79df5811..79df5811 100755..100644
--- a/public/vendor/codemirror/mode/octave/index.html
+++ b/public/vendor/codemirror/mode/octave/index.html
diff --git a/public/vendor/codemirror/mode/octave/octave.js b/public/vendor/codemirror/mode/octave/octave.js
index a7bec030..a7bec030 100755..100644
--- a/public/vendor/codemirror/mode/octave/octave.js
+++ b/public/vendor/codemirror/mode/octave/octave.js
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 @@
+<!doctype html>
+
+<title>CodeMirror: Oz mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="oz.js"></script>
+<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
+<style>
+ .CodeMirror {border: 1px solid #aaa;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Oz</a>
+ </ul>
+</div>
+
+<article>
+<h2>Oz mode</h2>
+<textarea id="code" name="code">
+declare
+fun {Ints N Max}
+ if N == Max then nil
+ else
+ {Delay 1000}
+ N|{Ints N+1 Max}
+ end
+end
+
+fun {Sum S Stream}
+ case Stream of nil then S
+ [] H|T then S|{Sum H+S T} end
+end
+
+local X Y in
+ thread X = {Ints 0 1000} end
+ thread Y = {Sum 0 X} end
+ {Browse Y}
+end
+</textarea>
+<p>MIME type defined: <code>text/x-oz</code>.</p>
+
+<script type="text/javascript">
+var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ mode: "text/x-oz",
+ readOnly: false
+});
+</script>
+</article>
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
index f8a99ad0..f8a99ad0 100755..100644
--- a/public/vendor/codemirror/mode/pascal/index.html
+++ b/public/vendor/codemirror/mode/pascal/index.html
diff --git a/public/vendor/codemirror/mode/pascal/pascal.js b/public/vendor/codemirror/mode/pascal/pascal.js
index 2d0c3d42..2d0c3d42 100755..100644
--- a/public/vendor/codemirror/mode/pascal/pascal.js
+++ b/public/vendor/codemirror/mode/pascal/pascal.js
diff --git a/public/vendor/codemirror/mode/pegjs/index.html b/public/vendor/codemirror/mode/pegjs/index.html
index 0c746048..0c746048 100755..100644
--- a/public/vendor/codemirror/mode/pegjs/index.html
+++ b/public/vendor/codemirror/mode/pegjs/index.html
diff --git a/public/vendor/codemirror/mode/pegjs/pegjs.js b/public/vendor/codemirror/mode/pegjs/pegjs.js
index 306e3768..306e3768 100755..100644
--- a/public/vendor/codemirror/mode/pegjs/pegjs.js
+++ b/public/vendor/codemirror/mode/pegjs/pegjs.js
diff --git a/public/vendor/codemirror/mode/perl/index.html b/public/vendor/codemirror/mode/perl/index.html
index 8c1021c4..8c1021c4 100755..100644
--- a/public/vendor/codemirror/mode/perl/index.html
+++ b/public/vendor/codemirror/mode/perl/index.html
diff --git a/public/vendor/codemirror/mode/perl/perl.js b/public/vendor/codemirror/mode/perl/perl.js
index bef62bc7..bef62bc7 100755..100644
--- a/public/vendor/codemirror/mode/perl/perl.js
+++ b/public/vendor/codemirror/mode/perl/perl.js
diff --git a/public/vendor/codemirror/mode/php/index.html b/public/vendor/codemirror/mode/php/index.html
index adf6b1be..adf6b1be 100755..100644
--- a/public/vendor/codemirror/mode/php/index.html
+++ b/public/vendor/codemirror/mode/php/index.html
diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js
index 0c3f21e5..22494467 100755..100644
--- 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(/<</)) {
- var nowDoc = stream.eat("'");
+ var before;
+ if (before = stream.match(/<<\s*/)) {
+ var quoted = stream.eat(/['"]/);
stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(3 + (nowDoc ? 1 : 0));
- if (nowDoc) stream.eat("'");
+ var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
+ if (quoted) stream.eat(quoted);
if (delim) {
(state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = phpString(delim, nowDoc ? false : true);
+ state.tokenize = phpString(delim, quoted != "'");
return "string";
}
}
@@ -159,6 +160,7 @@
if (!isPHP) {
if (stream.match(/^<\?\w*/)) {
state.curMode = phpMode;
+ if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, ""))
state.curState = state.php;
return "meta";
}
@@ -182,6 +184,7 @@
} else if (isPHP && state.php.tokenize == null && 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
index e2ecefc1..e2ecefc1 100755..100644
--- a/public/vendor/codemirror/mode/php/test.js
+++ b/public/vendor/codemirror/mode/php/test.js
diff --git a/public/vendor/codemirror/mode/pig/index.html b/public/vendor/codemirror/mode/pig/index.html
index 984c9a18..ea77f704 100755..100644
--- a/public/vendor/codemirror/mode/pig/index.html
+++ b/public/vendor/codemirror/mode/pig/index.html
@@ -1,5 +1,4 @@
-<!doctype html>
-
+<!doctype html>
<title>CodeMirror: Pig Latin mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
@@ -51,5 +50,4 @@ STORE c INTO "\path\to\output";
<p><strong>MIME type defined:</strong> <code>text/x-pig</code>
(PIG code)
-</html>
</article>
diff --git a/public/vendor/codemirror/mode/pig/pig.js b/public/vendor/codemirror/mode/pig/pig.js
index 5b567272..5b567272 100755..100644
--- a/public/vendor/codemirror/mode/pig/pig.js
+++ b/public/vendor/codemirror/mode/pig/pig.js
diff --git a/public/vendor/codemirror/mode/properties/index.html b/public/vendor/codemirror/mode/properties/index.html
index f885302d..f885302d 100755..100644
--- a/public/vendor/codemirror/mode/properties/index.html
+++ b/public/vendor/codemirror/mode/properties/index.html
diff --git a/public/vendor/codemirror/mode/properties/properties.js b/public/vendor/codemirror/mode/properties/properties.js
index 9da5baf4..9da5baf4 100755..100644
--- a/public/vendor/codemirror/mode/properties/properties.js
+++ b/public/vendor/codemirror/mode/properties/properties.js
diff --git a/public/vendor/codemirror/mode/puppet/index.html b/public/vendor/codemirror/mode/puppet/index.html
index 5614c369..5614c369 100755..100644
--- a/public/vendor/codemirror/mode/puppet/index.html
+++ b/public/vendor/codemirror/mode/puppet/index.html
diff --git a/public/vendor/codemirror/mode/puppet/puppet.js b/public/vendor/codemirror/mode/puppet/puppet.js
index e7f799f7..e7f799f7 100755..100644
--- a/public/vendor/codemirror/mode/puppet/puppet.js
+++ b/public/vendor/codemirror/mode/puppet/puppet.js
diff --git a/public/vendor/codemirror/mode/python/index.html b/public/vendor/codemirror/mode/python/index.html
index 86eb3d52..86eb3d52 100755..100644
--- a/public/vendor/codemirror/mode/python/index.html
+++ b/public/vendor/codemirror/mode/python/index.html
diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js
index e5a09719..553f2d6f 100755..100644
--- 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
index 72785ba3..72785ba3 100755..100644
--- a/public/vendor/codemirror/mode/q/index.html
+++ b/public/vendor/codemirror/mode/q/index.html
diff --git a/public/vendor/codemirror/mode/q/q.js b/public/vendor/codemirror/mode/q/q.js
index a4af9383..a4af9383 100755..100644
--- a/public/vendor/codemirror/mode/q/q.js
+++ b/public/vendor/codemirror/mode/q/q.js
diff --git a/public/vendor/codemirror/mode/r/index.html b/public/vendor/codemirror/mode/r/index.html
index 6dd96346..6dd96346 100755..100644
--- a/public/vendor/codemirror/mode/r/index.html
+++ b/public/vendor/codemirror/mode/r/index.html
diff --git a/public/vendor/codemirror/mode/r/r.js b/public/vendor/codemirror/mode/r/r.js
index 1ab4a956..1ab4a956 100755..100644
--- a/public/vendor/codemirror/mode/r/r.js
+++ b/public/vendor/codemirror/mode/r/r.js
diff --git a/public/vendor/codemirror/mode/rpm/changes/index.html b/public/vendor/codemirror/mode/rpm/changes/index.html
index 6e5031bd..6e5031bd 100755..100644
--- a/public/vendor/codemirror/mode/rpm/changes/index.html
+++ b/public/vendor/codemirror/mode/rpm/changes/index.html
diff --git a/public/vendor/codemirror/mode/rpm/index.html b/public/vendor/codemirror/mode/rpm/index.html
index 9a34e6df..9a34e6df 100755..100644
--- a/public/vendor/codemirror/mode/rpm/index.html
+++ b/public/vendor/codemirror/mode/rpm/index.html
diff --git a/public/vendor/codemirror/mode/rpm/rpm.js b/public/vendor/codemirror/mode/rpm/rpm.js
index 3bb7cd2f..87cde591 100755..100644
--- 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
index 2902dea2..2902dea2 100755..100644
--- a/public/vendor/codemirror/mode/rst/index.html
+++ b/public/vendor/codemirror/mode/rst/index.html
diff --git a/public/vendor/codemirror/mode/rst/rst.js b/public/vendor/codemirror/mode/rst/rst.js
index bcf110c1..bcf110c1 100755..100644
--- a/public/vendor/codemirror/mode/rst/rst.js
+++ b/public/vendor/codemirror/mode/rst/rst.js
diff --git a/public/vendor/codemirror/mode/ruby/index.html b/public/vendor/codemirror/mode/ruby/index.html
index 97544bab..97544bab 100755..100644
--- a/public/vendor/codemirror/mode/ruby/index.html
+++ b/public/vendor/codemirror/mode/ruby/index.html
diff --git a/public/vendor/codemirror/mode/ruby/ruby.js b/public/vendor/codemirror/mode/ruby/ruby.js
index eab9d9da..10cad8d9 100755..100644
--- 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
index cade864f..cade864f 100755..100644
--- a/public/vendor/codemirror/mode/ruby/test.js
+++ b/public/vendor/codemirror/mode/ruby/test.js
diff --git a/public/vendor/codemirror/mode/rust/index.html b/public/vendor/codemirror/mode/rust/index.html
index 407e84f2..1fe0ad1e 100755..100644
--- a/public/vendor/codemirror/mode/rust/index.html
+++ b/public/vendor/codemirror/mode/rust/index.html
@@ -6,6 +6,7 @@
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/simple.js"></script>
<script src="rust.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
@@ -37,22 +38,25 @@ enum bar {
fn check_crate(x: int) {
let v = 10;
- alt foo {
- 1 to 3 {
- print_foo();
- if x {
- blah() + 10;
+ match foo {
+ 1 ... 3 {
+ print_foo();
+ if x {
+ blah().to_string();
+ }
}
- }
- (x, y) { "bye" }
- _ { "hi" }
+ (x, y) { "bye" }
+ _ { "hi" }
}
}
</textarea></div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
- lineNumbers: true
+ lineNumbers: true,
+ lineWrapping: true,
+ indentUnit: 4,
+ mode: "rust"
});
</script>
diff --git a/public/vendor/codemirror/mode/rust/rust.js b/public/vendor/codemirror/mode/rust/rust.js
index 2bffa9a6..8558b53f 100755..100644
--- 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
index 9f4a7902..9f4a7902 100755..100644
--- a/public/vendor/codemirror/mode/sass/index.html
+++ b/public/vendor/codemirror/mode/sass/index.html
diff --git a/public/vendor/codemirror/mode/sass/sass.js b/public/vendor/codemirror/mode/sass/sass.js
index 6973ece2..6973ece2 100755..100644
--- a/public/vendor/codemirror/mode/sass/sass.js
+++ b/public/vendor/codemirror/mode/sass/sass.js
diff --git a/public/vendor/codemirror/mode/scheme/index.html b/public/vendor/codemirror/mode/scheme/index.html
index 04d5c6a2..04d5c6a2 100755..100644
--- a/public/vendor/codemirror/mode/scheme/index.html
+++ b/public/vendor/codemirror/mode/scheme/index.html
diff --git a/public/vendor/codemirror/mode/scheme/scheme.js b/public/vendor/codemirror/mode/scheme/scheme.js
index 22346459..22346459 100755..100644
--- a/public/vendor/codemirror/mode/scheme/scheme.js
+++ b/public/vendor/codemirror/mode/scheme/scheme.js
diff --git a/public/vendor/codemirror/mode/shell/index.html b/public/vendor/codemirror/mode/shell/index.html
index 0b56300b..0b56300b 100755..100644
--- a/public/vendor/codemirror/mode/shell/index.html
+++ b/public/vendor/codemirror/mode/shell/index.html
diff --git a/public/vendor/codemirror/mode/shell/shell.js b/public/vendor/codemirror/mode/shell/shell.js
index a684e8c2..a684e8c2 100755..100644
--- a/public/vendor/codemirror/mode/shell/shell.js
+++ b/public/vendor/codemirror/mode/shell/shell.js
diff --git a/public/vendor/codemirror/mode/shell/test.js b/public/vendor/codemirror/mode/shell/test.js
index a413b5a4..a413b5a4 100755..100644
--- a/public/vendor/codemirror/mode/shell/test.js
+++ b/public/vendor/codemirror/mode/shell/test.js
diff --git a/public/vendor/codemirror/mode/sieve/index.html b/public/vendor/codemirror/mode/sieve/index.html
index 6f029b62..6f029b62 100755..100644
--- a/public/vendor/codemirror/mode/sieve/index.html
+++ b/public/vendor/codemirror/mode/sieve/index.html
diff --git a/public/vendor/codemirror/mode/sieve/sieve.js b/public/vendor/codemirror/mode/sieve/sieve.js
index f67db2f5..f67db2f5 100755..100644
--- a/public/vendor/codemirror/mode/sieve/sieve.js
+++ b/public/vendor/codemirror/mode/sieve/sieve.js
diff --git a/public/vendor/codemirror/mode/slim/index.html b/public/vendor/codemirror/mode/slim/index.html
index 7fa4e50d..7fa4e50d 100755..100644
--- a/public/vendor/codemirror/mode/slim/index.html
+++ b/public/vendor/codemirror/mode/slim/index.html
diff --git a/public/vendor/codemirror/mode/slim/slim.js b/public/vendor/codemirror/mode/slim/slim.js
index 164464d0..164464d0 100755..100644
--- a/public/vendor/codemirror/mode/slim/slim.js
+++ b/public/vendor/codemirror/mode/slim/slim.js
diff --git a/public/vendor/codemirror/mode/slim/test.js b/public/vendor/codemirror/mode/slim/test.js
index be4ddacb..be4ddacb 100755..100644
--- a/public/vendor/codemirror/mode/slim/test.js
+++ b/public/vendor/codemirror/mode/slim/test.js
diff --git a/public/vendor/codemirror/mode/smalltalk/index.html b/public/vendor/codemirror/mode/smalltalk/index.html
index 2155ebc2..2155ebc2 100755..100644
--- a/public/vendor/codemirror/mode/smalltalk/index.html
+++ b/public/vendor/codemirror/mode/smalltalk/index.html
diff --git a/public/vendor/codemirror/mode/smalltalk/smalltalk.js b/public/vendor/codemirror/mode/smalltalk/smalltalk.js
index bb510ba2..bb510ba2 100755..100644
--- a/public/vendor/codemirror/mode/smalltalk/smalltalk.js
+++ b/public/vendor/codemirror/mode/smalltalk/smalltalk.js
diff --git a/public/vendor/codemirror/mode/smarty/index.html b/public/vendor/codemirror/mode/smarty/index.html
index b19c8f09..b19c8f09 100755..100644
--- a/public/vendor/codemirror/mode/smarty/index.html
+++ b/public/vendor/codemirror/mode/smarty/index.html
diff --git a/public/vendor/codemirror/mode/smarty/smarty.js b/public/vendor/codemirror/mode/smarty/smarty.js
index 6e0fbed4..6e0fbed4 100755..100644
--- a/public/vendor/codemirror/mode/smarty/smarty.js
+++ b/public/vendor/codemirror/mode/smarty/smarty.js
diff --git a/public/vendor/codemirror/mode/solr/index.html b/public/vendor/codemirror/mode/solr/index.html
index 4b18c25b..4b18c25b 100755..100644
--- a/public/vendor/codemirror/mode/solr/index.html
+++ b/public/vendor/codemirror/mode/solr/index.html
diff --git a/public/vendor/codemirror/mode/solr/solr.js b/public/vendor/codemirror/mode/solr/solr.js
index f7f70878..f7f70878 100755..100644
--- a/public/vendor/codemirror/mode/solr/solr.js
+++ b/public/vendor/codemirror/mode/solr/solr.js
diff --git a/public/vendor/codemirror/mode/soy/index.html b/public/vendor/codemirror/mode/soy/index.html
index f0216f09..f0216f09 100755..100644
--- a/public/vendor/codemirror/mode/soy/index.html
+++ b/public/vendor/codemirror/mode/soy/index.html
diff --git a/public/vendor/codemirror/mode/soy/soy.js b/public/vendor/codemirror/mode/soy/soy.js
index 79bfc24d..79bfc24d 100755..100644
--- a/public/vendor/codemirror/mode/soy/soy.js
+++ b/public/vendor/codemirror/mode/soy/soy.js
diff --git a/public/vendor/codemirror/mode/sparql/index.html b/public/vendor/codemirror/mode/sparql/index.html
index 84ef4d36..84ef4d36 100755..100644
--- a/public/vendor/codemirror/mode/sparql/index.html
+++ b/public/vendor/codemirror/mode/sparql/index.html
diff --git a/public/vendor/codemirror/mode/sparql/sparql.js b/public/vendor/codemirror/mode/sparql/sparql.js
index bbf8a76a..0cf40f58 100755..100644
--- 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
index a52f76f0..a52f76f0 100755..100644
--- a/public/vendor/codemirror/mode/spreadsheet/index.html
+++ b/public/vendor/codemirror/mode/spreadsheet/index.html
diff --git a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
index 6fab00fd..6fab00fd 100755..100644
--- a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
+++ b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
diff --git a/public/vendor/codemirror/mode/sql/index.html b/public/vendor/codemirror/mode/sql/index.html
index a0d8d9e1..a0d8d9e1 100755..100644
--- a/public/vendor/codemirror/mode/sql/index.html
+++ b/public/vendor/codemirror/mode/sql/index.html
diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js
index a9082771..86c68f72 100755..100644
--- 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
index 14679da4..14679da4 100755..100644
--- a/public/vendor/codemirror/mode/stex/index.html
+++ b/public/vendor/codemirror/mode/stex/index.html
diff --git a/public/vendor/codemirror/mode/stex/stex.js b/public/vendor/codemirror/mode/stex/stex.js
index 835ed46d..835ed46d 100755..100644
--- a/public/vendor/codemirror/mode/stex/stex.js
+++ b/public/vendor/codemirror/mode/stex/stex.js
diff --git a/public/vendor/codemirror/mode/stex/test.js b/public/vendor/codemirror/mode/stex/test.js
index 22f027ec..22f027ec 100755..100644
--- a/public/vendor/codemirror/mode/stex/test.js
+++ b/public/vendor/codemirror/mode/stex/test.js
diff --git a/public/vendor/codemirror/mode/stylus/index.html b/public/vendor/codemirror/mode/stylus/index.html
index 862c18f2..862c18f2 100755..100644
--- a/public/vendor/codemirror/mode/stylus/index.html
+++ b/public/vendor/codemirror/mode/stylus/index.html
diff --git a/public/vendor/codemirror/mode/stylus/stylus.js b/public/vendor/codemirror/mode/stylus/stylus.js
index fc46a016..662cd03c 100755..100644
--- 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
index 2649dc37..109f3fdb 100755..100644
--- 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
-
+
}
-
+
}
</textarea></form>
diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js
index cf784fef..7a2339fc 100755..100644
--- 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
index ce4ad342..ce4ad342 100755..100644
--- a/public/vendor/codemirror/mode/tcl/index.html
+++ b/public/vendor/codemirror/mode/tcl/index.html
diff --git a/public/vendor/codemirror/mode/tcl/tcl.js b/public/vendor/codemirror/mode/tcl/tcl.js
index 056accb2..056accb2 100755..100644
--- a/public/vendor/codemirror/mode/tcl/tcl.js
+++ b/public/vendor/codemirror/mode/tcl/tcl.js
diff --git a/public/vendor/codemirror/mode/textile/index.html b/public/vendor/codemirror/mode/textile/index.html
index 42b156b1..42b156b1 100755..100644
--- a/public/vendor/codemirror/mode/textile/index.html
+++ b/public/vendor/codemirror/mode/textile/index.html
diff --git a/public/vendor/codemirror/mode/textile/test.js b/public/vendor/codemirror/mode/textile/test.js
index 49cdaf9c..49cdaf9c 100755..100644
--- a/public/vendor/codemirror/mode/textile/test.js
+++ b/public/vendor/codemirror/mode/textile/test.js
diff --git a/public/vendor/codemirror/mode/textile/textile.js b/public/vendor/codemirror/mode/textile/textile.js
index a6f75765..a6f75765 100755..100644
--- a/public/vendor/codemirror/mode/textile/textile.js
+++ b/public/vendor/codemirror/mode/textile/textile.js
diff --git a/public/vendor/codemirror/mode/tiddlywiki/index.html b/public/vendor/codemirror/mode/tiddlywiki/index.html
index 77dd0457..77dd0457 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/index.html
+++ b/public/vendor/codemirror/mode/tiddlywiki/index.html
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
index 9a69b639..9a69b639 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
index 1df01647..1df01647 100755..100644
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
diff --git a/public/vendor/codemirror/mode/tiki/index.html b/public/vendor/codemirror/mode/tiki/index.html
index 091c5fb2..091c5fb2 100755..100644
--- a/public/vendor/codemirror/mode/tiki/index.html
+++ b/public/vendor/codemirror/mode/tiki/index.html
diff --git a/public/vendor/codemirror/mode/tiki/tiki.css b/public/vendor/codemirror/mode/tiki/tiki.css
index 0dbc3ea0..1d8704c7 100755..100644
--- 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
index 5e05b1ff..5e05b1ff 100755..100644
--- a/public/vendor/codemirror/mode/tiki/tiki.js
+++ b/public/vendor/codemirror/mode/tiki/tiki.js
diff --git a/public/vendor/codemirror/mode/toml/index.html b/public/vendor/codemirror/mode/toml/index.html
index 90a2a021..90a2a021 100755..100644
--- a/public/vendor/codemirror/mode/toml/index.html
+++ b/public/vendor/codemirror/mode/toml/index.html
diff --git a/public/vendor/codemirror/mode/toml/toml.js b/public/vendor/codemirror/mode/toml/toml.js
index baeca155..baeca155 100755..100644
--- a/public/vendor/codemirror/mode/toml/toml.js
+++ b/public/vendor/codemirror/mode/toml/toml.js
diff --git a/public/vendor/codemirror/mode/tornado/index.html b/public/vendor/codemirror/mode/tornado/index.html
index 8ee7ef56..8ee7ef56 100755..100644
--- a/public/vendor/codemirror/mode/tornado/index.html
+++ b/public/vendor/codemirror/mode/tornado/index.html
diff --git a/public/vendor/codemirror/mode/tornado/tornado.js b/public/vendor/codemirror/mode/tornado/tornado.js
index dbfbc348..dbfbc348 100755..100644
--- a/public/vendor/codemirror/mode/tornado/tornado.js
+++ b/public/vendor/codemirror/mode/tornado/tornado.js
diff --git a/public/vendor/codemirror/mode/troff/index.html b/public/vendor/codemirror/mode/troff/index.html
index 7c5a54e5..7c5a54e5 100755..100644
--- a/public/vendor/codemirror/mode/troff/index.html
+++ b/public/vendor/codemirror/mode/troff/index.html
diff --git a/public/vendor/codemirror/mode/troff/troff.js b/public/vendor/codemirror/mode/troff/troff.js
index beca778e..beca778e 100755..100644
--- a/public/vendor/codemirror/mode/troff/troff.js
+++ b/public/vendor/codemirror/mode/troff/troff.js
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/index.html b/public/vendor/codemirror/mode/ttcn-cfg/index.html
index 4a4cd457..4a4cd457 100755..100644
--- a/public/vendor/codemirror/mode/ttcn-cfg/index.html
+++ b/public/vendor/codemirror/mode/ttcn-cfg/index.html
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
index e1080511..e1080511 100755..100644
--- a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
+++ b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
diff --git a/public/vendor/codemirror/mode/ttcn/index.html b/public/vendor/codemirror/mode/ttcn/index.html
index f1ef8113..f1ef8113 100755..100644
--- a/public/vendor/codemirror/mode/ttcn/index.html
+++ b/public/vendor/codemirror/mode/ttcn/index.html
diff --git a/public/vendor/codemirror/mode/ttcn/ttcn.js b/public/vendor/codemirror/mode/ttcn/ttcn.js
index 30518517..30518517 100755..100644
--- a/public/vendor/codemirror/mode/ttcn/ttcn.js
+++ b/public/vendor/codemirror/mode/ttcn/ttcn.js
diff --git a/public/vendor/codemirror/mode/turtle/index.html b/public/vendor/codemirror/mode/turtle/index.html
index a4962b61..a4962b61 100755..100644
--- a/public/vendor/codemirror/mode/turtle/index.html
+++ b/public/vendor/codemirror/mode/turtle/index.html
diff --git a/public/vendor/codemirror/mode/turtle/turtle.js b/public/vendor/codemirror/mode/turtle/turtle.js
index 0988f0a4..0988f0a4 100755..100644
--- a/public/vendor/codemirror/mode/turtle/turtle.js
+++ b/public/vendor/codemirror/mode/turtle/turtle.js
diff --git a/public/vendor/codemirror/mode/twig/index.html b/public/vendor/codemirror/mode/twig/index.html
index 02493a5c..02493a5c 100755..100644
--- a/public/vendor/codemirror/mode/twig/index.html
+++ b/public/vendor/codemirror/mode/twig/index.html
diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js
index aa676dc4..aa676dc4 100755..100644
--- a/public/vendor/codemirror/mode/twig/twig.js
+++ b/public/vendor/codemirror/mode/twig/twig.js
diff --git a/public/vendor/codemirror/mode/vb/index.html b/public/vendor/codemirror/mode/vb/index.html
index adcc44fd..adcc44fd 100755..100644
--- a/public/vendor/codemirror/mode/vb/index.html
+++ b/public/vendor/codemirror/mode/vb/index.html
diff --git a/public/vendor/codemirror/mode/vb/vb.js b/public/vendor/codemirror/mode/vb/vb.js
index d78f91f7..d78f91f7 100755..100644
--- a/public/vendor/codemirror/mode/vb/vb.js
+++ b/public/vendor/codemirror/mode/vb/vb.js
diff --git a/public/vendor/codemirror/mode/vbscript/index.html b/public/vendor/codemirror/mode/vbscript/index.html
index ad7532d7..ad7532d7 100755..100644
--- a/public/vendor/codemirror/mode/vbscript/index.html
+++ b/public/vendor/codemirror/mode/vbscript/index.html
diff --git a/public/vendor/codemirror/mode/vbscript/vbscript.js b/public/vendor/codemirror/mode/vbscript/vbscript.js
index b66df223..b66df223 100755..100644
--- a/public/vendor/codemirror/mode/vbscript/vbscript.js
+++ b/public/vendor/codemirror/mode/vbscript/vbscript.js
diff --git a/public/vendor/codemirror/mode/velocity/index.html b/public/vendor/codemirror/mode/velocity/index.html
index 27478786..27478786 100755..100644
--- a/public/vendor/codemirror/mode/velocity/index.html
+++ b/public/vendor/codemirror/mode/velocity/index.html
diff --git a/public/vendor/codemirror/mode/velocity/velocity.js b/public/vendor/codemirror/mode/velocity/velocity.js
index 8fc4f95d..8fc4f95d 100755..100644
--- a/public/vendor/codemirror/mode/velocity/velocity.js
+++ b/public/vendor/codemirror/mode/velocity/velocity.js
diff --git a/public/vendor/codemirror/mode/verilog/index.html b/public/vendor/codemirror/mode/verilog/index.html
index 96b3d647..96b3d647 100755..100644
--- a/public/vendor/codemirror/mode/verilog/index.html
+++ b/public/vendor/codemirror/mode/verilog/index.html
diff --git a/public/vendor/codemirror/mode/verilog/test.js b/public/vendor/codemirror/mode/verilog/test.js
index 9c8c0949..9c8c0949 100755..100644
--- a/public/vendor/codemirror/mode/verilog/test.js
+++ b/public/vendor/codemirror/mode/verilog/test.js
diff --git a/public/vendor/codemirror/mode/verilog/verilog.js b/public/vendor/codemirror/mode/verilog/verilog.js
index 9d2a4cd5..9d2a4cd5 100755..100644
--- a/public/vendor/codemirror/mode/verilog/verilog.js
+++ b/public/vendor/codemirror/mode/verilog/verilog.js
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 @@
+<!doctype html>
+
+<title>CodeMirror: VHDL mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="vhdl.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">VHDL</a>
+ </ul>
+</div>
+
+<article>
+<h2>VHDL mode</h2>
+
+<div><textarea id="code" name="code">
+LIBRARY ieee;
+USE ieee.std_logic_1164.ALL;
+USE ieee.numeric_std.ALL;
+
+ENTITY tb IS
+END tb;
+
+ARCHITECTURE behavior OF tb IS
+ --Inputs
+ signal a : unsigned(2 downto 0) := (others => '0');
+ signal b : unsigned(2 downto 0) := (others => '0');
+ --Outputs
+ signal a_eq_b : std_logic;
+ signal a_le_b : std_logic;
+ signal a_gt_b : std_logic;
+
+ signal i,j : integer;
+
+BEGIN
+
+ -- Instantiate the Unit Under Test (UUT)
+ uut: entity work.comparator PORT MAP (
+ a => a,
+ b => b,
+ a_eq_b => a_eq_b,
+ a_le_b => a_le_b,
+ a_gt_b => a_gt_b
+ );
+
+ -- Stimulus process
+ stim_proc: process
+ begin
+ for i in 0 to 8 loop
+ for j in 0 to 8 loop
+ a <= to_unsigned(i,3); --integer to unsigned type conversion
+ b <= to_unsigned(j,3);
+ wait for 10 ns;
+ end loop;
+ end loop;
+ end process;
+
+END;
+</textarea></div>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true,
+ mode: {
+ name: "vhdl",
+ }
+ });
+</script>
+
+<p>
+Syntax highlighting and indentation for the VHDL language.
+<h2>Configuration options:</h2>
+ <ul>
+ <li><strong>atoms</strong> - List of atom words. Default: "null"</li>
+ <li><strong>hooks</strong> - List of meta hooks. Default: ["`", "$"]</li>
+ <li><strong>multiLineStrings</strong> - Whether multi-line strings are accepted. Default: false</li>
+ </ul>
+</p>
+
+<p><strong>MIME types defined:</strong> <code>text/x-vhdl</code>.</p>
+</article>
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 = /[&|~><!\)\(*#%@+\/=?\:;}{,\.\^\-\[\]]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (hooks[ch]) {
+ var result = hooks[ch](stream, state);
+ if (result !== false) return result;
+ }
+ if (ch == '"') {
+ state.tokenize = tokenString2(ch);
+ return state.tokenize(stream, state);
+ }
+ if (ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ curPunc = ch;
+ return null;
+ }
+ if (/[\d']/.test(ch)) {
+ stream.eatWhile(/[\w\.']/);
+ return "number";
+ }
+ if (ch == "-") {
+ if (stream.eat("-")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur.toLowerCase())) {
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ return "keyword";
+ }
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
+ return "variable";
+ }
+
+ 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 || multiLineStrings))
+ state.tokenize = tokenBase;
+ return "string";
+ };
+ }
+ function tokenString2(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 || multiLineStrings))
+ state.tokenize = tokenBase;
+ return "string-2";
+ };
+ }
+
+ 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: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ 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;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment" || style == "meta") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
+ 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;
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
+ var firstChar = textAfter && textAfter.charAt(0), ctx = state.context, closing = firstChar == ctx.type;
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
+ else return ctx.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricChars: "{}"
+ };
+});
+
+CodeMirror.defineMIME("text/x-vhdl", "vhdl");
+
+});
diff --git a/public/vendor/codemirror/mode/vue/index.html b/public/vendor/codemirror/mode/vue/index.html
new file mode 100644
index 00000000..cccb9764
--- /dev/null
+++ b/public/vendor/codemirror/mode/vue/index.html
@@ -0,0 +1,69 @@
+<!doctype html>
+
+<title>CodeMirror: Vue.js mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/overlay.js"></script>
+<script src="../../addon/mode/simple.js"></script>
+<script src="../../addon/selection/selection-pointer.js"></script>
+<script src="../xml/xml.js"></script>
+<script src="../javascript/javascript.js"></script>
+<script src="../css/css.js"></script>
+<script src="../coffeescript/coffeescript.js"></script>
+<script src="../sass/sass.js"></script>
+<script src="../jade/jade.js"></script>
+
+<script src="../handlebars/handlebars.js"></script>
+<script src="../htmlmixed/htmlmixed.js"></script>
+<script src="vue.js"></script>
+<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">Vue.js mode</a>
+ </ul>
+</div>
+
+<article>
+<h2>Vue.js mode</h2>
+<form><textarea id="code" name="code">
+<template>
+ <div class="sass">Im am a {{mustache-like}} template</div>
+</template>
+
+<script lang="coffee">
+ module.exports =
+ props: ['one', 'two', 'three']
+</script>
+
+<style lang="sass">
+.sass
+ font-size: 18px
+</style>
+
+</textarea></form>
+ <script>
+ // Define an extended mixed-mode that understands vbscript and
+ // leaves mustache/handlebars embedded templates in html mode
+ var mixedMode = {
+ name: "vue"
+ };
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: mixedMode,
+ selectionPointer: true
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-vue</code></p>
+
+ </article>
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
index 7149f06b..7149f06b 100755..100644
--- a/public/vendor/codemirror/mode/xml/index.html
+++ b/public/vendor/codemirror/mode/xml/index.html
diff --git a/public/vendor/codemirror/mode/xml/test.js b/public/vendor/codemirror/mode/xml/test.js
index f48156b5..f48156b5 100755..100644
--- a/public/vendor/codemirror/mode/xml/test.js
+++ b/public/vendor/codemirror/mode/xml/test.js
diff --git a/public/vendor/codemirror/mode/xml/xml.js b/public/vendor/codemirror/mode/xml/xml.js
index 2f3b8f87..014f7d84 100755..100644
--- 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 && /<!\[CDATA\[/.test(textAfter)) return 0;
+ if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
if (tagAfter && tagAfter[1]) { // Closing tag spotted
while (context) {
if (context.tagName == tagAfter[2]) {
context = context.prev;
break;
- } else if (Kludges.implicitlyClosed.hasOwnProperty(context.tagName)) {
+ } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
context = context.prev;
} else {
break;
@@ -354,25 +359,30 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
}
} else if (tagAfter) { // Opening tag spotted
while (context) {
- var grabbers = Kludges.contextGrabbers[context.tagName];
+ var grabbers = config.contextGrabbers[context.tagName];
if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
context = context.prev;
else
break;
}
}
- while (context && !context.startOfLine)
+ while (context && context.prev && !context.startOfLine)
context = context.prev;
if (context) return context.indent + indentUnit;
- else return 0;
+ else return state.baseIndent || 0;
},
electricInput: /<\/[\s\w:]+>$/,
blockCommentStart: "<!--",
blockCommentEnd: "-->",
- 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
index 7ac5aaef..7ac5aaef 100755..100644
--- a/public/vendor/codemirror/mode/xquery/index.html
+++ b/public/vendor/codemirror/mode/xquery/index.html
diff --git a/public/vendor/codemirror/mode/xquery/test.js b/public/vendor/codemirror/mode/xquery/test.js
index 1f148cdb..1f148cdb 100755..100644
--- a/public/vendor/codemirror/mode/xquery/test.js
+++ b/public/vendor/codemirror/mode/xquery/test.js
diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js
index c642ee58..c642ee58 100755..100644
--- a/public/vendor/codemirror/mode/xquery/xquery.js
+++ b/public/vendor/codemirror/mode/xquery/xquery.js
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 @@
+<!doctype html>
+
+<title>CodeMirror: YAML front matter mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/mode/overlay.js"></script>
+<script src="../markdown/markdown.js"></script>
+<script src="../gfm/gfm.js"></script>
+<script src="../yaml/yaml.js"></script>
+<script src="yaml-frontmatter.js"></script>
+<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">YAML-Frontmatter</a>
+ </ul>
+</div>
+
+<article>
+<h2>YAML front matter mode</h2>
+<form><textarea id="code" name="code">
+---
+receipt: Oz-Ware Purchase Invoice
+date: 2007-08-06
+customer:
+ given: Dorothy
+ family: Gale
+
+items:
+ - part_no: A4786
+ descrip: Water Bucket (Filled)
+ price: 1.47
+ quantity: 4
+
+ - part_no: E1628
+ descrip: High Heeled "Ruby" Slippers
+ size: 8
+ price: 100.27
+ quantity: 1
+
+bill-to: &id001
+ street: |
+ 123 Tornado Alley
+ Suite 16
+ city: East Centerville
+ state: KS
+
+ship-to: *id001
+
+specialDelivery: >
+ Follow the Yellow Brick
+ Road to the Emerald City.
+ Pay no attention to the
+ man behind the curtain.
+---
+
+GitHub Flavored Markdown
+========================
+
+Everything from markdown plus GFM features:
+
+## URL autolinking
+
+Underscores_are_allowed_between_words.
+
+## Strikethrough text
+
+GFM adds syntax to strikethrough text, which is missing from standard Markdown.
+
+~~Mistaken text.~~
+~~**works with other fomatting**~~
+
+~~spans across
+lines~~
+
+## Fenced code blocks (and syntax highlighting)
+
+```javascript
+for (var i = 0; i &lt; items.length; i++) {
+ console.log(items[i], i); // log them
+}
+```
+
+## Task Lists
+
+- [ ] Incomplete task list item
+- [x] **Completed** task list item
+
+## A bit of GitHub spice
+
+* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* \#Num: #1
+* User/#Num: mojombo#1
+* User/Project#Num: mojombo/god#1
+
+See http://github.github.com/github-flavored-markdown/.
+</textarea></form>
+
+<p>Defines a mode that parses
+a <a href="http://jekyllrb.com/docs/frontmatter/">YAML frontmatter</a>
+at the start of a file, switching to a base mode at the end of that.
+Takes a mode configuration option <code>base</code> to configure the
+base mode, which defaults to <code>"gfm"</code>.</p>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "yaml-frontmatter"});
+ </script>
+
+ </article>
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
index be9b6323..be9b6323 100755..100644
--- a/public/vendor/codemirror/mode/yaml/index.html
+++ b/public/vendor/codemirror/mode/yaml/index.html
diff --git a/public/vendor/codemirror/mode/yaml/yaml.js b/public/vendor/codemirror/mode/yaml/yaml.js
index b7015e59..b7015e59 100755..100644
--- a/public/vendor/codemirror/mode/yaml/yaml.js
+++ b/public/vendor/codemirror/mode/yaml/yaml.js
diff --git a/public/vendor/codemirror/mode/z80/index.html b/public/vendor/codemirror/mode/z80/index.html
index a41b7473..a41b7473 100755..100644
--- a/public/vendor/codemirror/mode/z80/index.html
+++ b/public/vendor/codemirror/mode/z80/index.html
diff --git a/public/vendor/codemirror/mode/z80/z80.js b/public/vendor/codemirror/mode/z80/z80.js
index aae70216..aae70216 100755..100644
--- a/public/vendor/codemirror/mode/z80/z80.js
+++ b/public/vendor/codemirror/mode/z80/z80.js