swagr 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/swagr +15 -0
- data/examples/examples01/app.rb +6 -2
- data/examples/examples01/coffee/data_port.coffee +2 -0
- data/examples/examples01/static/css/codemirror.css +1247 -0
- data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
- data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
- data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
- data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
- data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
- data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
- data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
- data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
- data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
- data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
- data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
- data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
- data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
- data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
- data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
- data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
- data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
- data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
- data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
- data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
- data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
- data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
- data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
- data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
- data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
- data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
- data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
- data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
- data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
- data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
- data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
- data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
- data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
- data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
- data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
- data/examples/examples01/static/js/d3.v3.min.js +2 -2
- data/examples/examples01/static/test/cm.html +33 -0
- data/examples/examples01/views/about.slim +15 -0
- data/examples/examples01/views/index.slim +1 -1
- data/examples/examples01/views/layout.slim +1 -0
- data/examples/examples01/views/layout_cm.slim +17 -0
- data/examples/examples01/views/navbar.slim +4 -4
- data/lib/swagr/version.rb +1 -1
- data/templates/app.rb +4 -0
- data/templates/static/js/codemirror/keymap/emacs.js +30 -0
- data/templates/static/js/codemirror/keymap/vim.js +2298 -0
- data/templates/static/js/codemirror/lib/codemirror.css +239 -0
- data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
- data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
- data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
- data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
- data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
- data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
- data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
- data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
- data/templates/static/js/codemirror/lib/util/search.js +119 -0
- data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
- data/templates/static/js/codemirror/mode/clike/index.html +103 -0
- data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
- data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
- data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/templates/static/js/codemirror/mode/css/css.js +465 -0
- data/templates/static/js/codemirror/mode/css/index.html +58 -0
- data/templates/static/js/codemirror/mode/css/test.js +501 -0
- data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
- data/templates/static/js/codemirror/mode/diff/index.html +105 -0
- data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
- data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
- data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
- data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
- data/templates/static/js/codemirror/mode/go/go.js +165 -0
- data/templates/static/js/codemirror/mode/go/index.html +74 -0
- data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
- data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
- data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
- data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/templates/static/js/codemirror/mode/http/http.js +98 -0
- data/templates/static/js/codemirror/mode/http/index.html +32 -0
- data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
- data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/templates/static/js/codemirror/mode/less/index.html +741 -0
- data/templates/static/js/codemirror/mode/less/less.js +266 -0
- data/templates/static/js/codemirror/mode/lua/index.html +74 -0
- data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
- data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
- data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
- data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
- data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/templates/static/js/codemirror/mode/perl/index.html +62 -0
- data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
- data/templates/static/js/codemirror/mode/php/index.html +51 -0
- data/templates/static/js/codemirror/mode/php/php.js +129 -0
- data/templates/static/js/codemirror/mode/pig/index.html +42 -0
- data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
- data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
- data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/templates/static/js/codemirror/mode/properties/index.html +41 -0
- data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
- data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/python/index.html +124 -0
- data/templates/static/js/codemirror/mode/python/python.js +340 -0
- data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/r/index.html +74 -0
- data/templates/static/js/codemirror/mode/r/r.js +141 -0
- data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/templates/static/js/codemirror/mode/rst/index.html +526 -0
- data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
- data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
- data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/templates/static/js/codemirror/mode/rust/index.html +48 -0
- data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
- data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
- data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/templates/static/js/codemirror/mode/shell/index.html +51 -0
- data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
- data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
- data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
- data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
- data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/templates/static/js/codemirror/mode/stex/index.html +98 -0
- data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
- data/templates/static/js/codemirror/mode/stex/test.js +343 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/vb/index.html +88 -0
- data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
- data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
- data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
- data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/templates/static/js/codemirror/mode/xml/index.html +45 -0
- data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
- data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
- data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
- data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
- data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/templates/static/js/codemirror/mode/z80/index.html +39 -0
- data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
- data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/templates/static/js/codemirror/theme/ambiance.css +76 -0
- data/templates/static/js/codemirror/theme/blackboard.css +25 -0
- data/templates/static/js/codemirror/theme/cobalt.css +18 -0
- data/templates/static/js/codemirror/theme/eclipse.css +25 -0
- data/templates/static/js/codemirror/theme/elegant.css +10 -0
- data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/templates/static/js/codemirror/theme/monokai.css +28 -0
- data/templates/static/js/codemirror/theme/neat.css +9 -0
- data/templates/static/js/codemirror/theme/night.css +21 -0
- data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
- data/templates/static/js/codemirror/theme/solarized.css +207 -0
- data/templates/static/js/codemirror/theme/twilight.css +26 -0
- data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
- data/templates/static/js/d3.v3.min.js +2 -2
- data/templates/static/test/cm.html +33 -0
- data/templates/views/about.slim +15 -0
- data/templates/views/index.slim +1 -1
- data/templates/views/layout.slim +1 -0
- data/templates/views/navbar.slim +4 -4
- metadata +347 -2
@@ -0,0 +1,41 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: MySQL mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="mysql.js"></script>
|
9
|
+
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
10
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h1>CodeMirror: MySQL mode</h1>
|
14
|
+
<form><textarea id="code" name="code">
|
15
|
+
-- Comment for the code
|
16
|
+
-- MySQL Mode for CodeMirror2 by MySQLTools http://github.com/partydroid/MySQL-Tools
|
17
|
+
SELECT UNIQUE `var1` as `variable`,
|
18
|
+
MAX(`var5`) as `max`,
|
19
|
+
MIN(`var5`) as `min`,
|
20
|
+
STDEV(`var5`) as `dev`
|
21
|
+
FROM `table`
|
22
|
+
|
23
|
+
LEFT JOIN `table2` ON `var2` = `variable`
|
24
|
+
|
25
|
+
ORDER BY `var3` DESC
|
26
|
+
GROUP BY `groupvar`
|
27
|
+
|
28
|
+
LIMIT 0,30;
|
29
|
+
|
30
|
+
</textarea></form>
|
31
|
+
<script>
|
32
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
33
|
+
mode: "text/x-mysql",
|
34
|
+
tabMode: "indent"
|
35
|
+
});
|
36
|
+
</script>
|
37
|
+
|
38
|
+
<p><strong>MIME types defined:</strong> <code>text/x-mysql</code>.</p>
|
39
|
+
|
40
|
+
</body>
|
41
|
+
</html>
|
@@ -0,0 +1,203 @@
|
|
1
|
+
/*
|
2
|
+
* MySQL Mode for CodeMirror 2 by MySQL-Tools
|
3
|
+
* @author James Thorne (partydroid)
|
4
|
+
* @link http://github.com/partydroid/MySQL-Tools
|
5
|
+
* @link http://mysqltools.org
|
6
|
+
* @version 02/Jan/2012
|
7
|
+
*/
|
8
|
+
CodeMirror.defineMode("mysql", function(config) {
|
9
|
+
var indentUnit = config.indentUnit;
|
10
|
+
var curPunc;
|
11
|
+
|
12
|
+
function wordRegexp(words) {
|
13
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
14
|
+
}
|
15
|
+
var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri",
|
16
|
+
"isblank", "isliteral", "union", "a"]);
|
17
|
+
var keywords = wordRegexp([
|
18
|
+
('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'),
|
19
|
+
('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'),
|
20
|
+
('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'),
|
21
|
+
('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'),
|
22
|
+
('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'),
|
23
|
+
('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'),
|
24
|
+
('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'),
|
25
|
+
('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'),
|
26
|
+
('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'),
|
27
|
+
('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'),
|
28
|
+
('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'),
|
29
|
+
('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'),
|
30
|
+
('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'),
|
31
|
+
('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'),
|
32
|
+
('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT')
|
33
|
+
]);
|
34
|
+
var operatorChars = /[*+\-<>=&|]/;
|
35
|
+
|
36
|
+
function tokenBase(stream, state) {
|
37
|
+
var ch = stream.next();
|
38
|
+
curPunc = null;
|
39
|
+
if (ch == "$" || ch == "?") {
|
40
|
+
stream.match(/^[\w\d]*/);
|
41
|
+
return "variable-2";
|
42
|
+
}
|
43
|
+
else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) {
|
44
|
+
stream.match(/^[^\s\u00a0>]*>?/);
|
45
|
+
return "atom";
|
46
|
+
}
|
47
|
+
else if (ch == "\"" || ch == "'") {
|
48
|
+
state.tokenize = tokenLiteral(ch);
|
49
|
+
return state.tokenize(stream, state);
|
50
|
+
}
|
51
|
+
else if (ch == "`") {
|
52
|
+
state.tokenize = tokenOpLiteral(ch);
|
53
|
+
return state.tokenize(stream, state);
|
54
|
+
}
|
55
|
+
else if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
56
|
+
curPunc = ch;
|
57
|
+
return null;
|
58
|
+
}
|
59
|
+
else if (ch == "-" && stream.eat("-")) {
|
60
|
+
stream.skipToEnd();
|
61
|
+
return "comment";
|
62
|
+
}
|
63
|
+
else if (ch == "/" && stream.eat("*")) {
|
64
|
+
state.tokenize = tokenComment;
|
65
|
+
return state.tokenize(stream, state);
|
66
|
+
}
|
67
|
+
else if (operatorChars.test(ch)) {
|
68
|
+
stream.eatWhile(operatorChars);
|
69
|
+
return null;
|
70
|
+
}
|
71
|
+
else if (ch == ":") {
|
72
|
+
stream.eatWhile(/[\w\d\._\-]/);
|
73
|
+
return "atom";
|
74
|
+
}
|
75
|
+
else {
|
76
|
+
stream.eatWhile(/[_\w\d]/);
|
77
|
+
if (stream.eat(":")) {
|
78
|
+
stream.eatWhile(/[\w\d_\-]/);
|
79
|
+
return "atom";
|
80
|
+
}
|
81
|
+
var word = stream.current();
|
82
|
+
if (ops.test(word))
|
83
|
+
return null;
|
84
|
+
else if (keywords.test(word))
|
85
|
+
return "keyword";
|
86
|
+
else
|
87
|
+
return "variable";
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
function tokenLiteral(quote) {
|
92
|
+
return function(stream, state) {
|
93
|
+
var escaped = false, ch;
|
94
|
+
while ((ch = stream.next()) != null) {
|
95
|
+
if (ch == quote && !escaped) {
|
96
|
+
state.tokenize = tokenBase;
|
97
|
+
break;
|
98
|
+
}
|
99
|
+
escaped = !escaped && ch == "\\";
|
100
|
+
}
|
101
|
+
return "string";
|
102
|
+
};
|
103
|
+
}
|
104
|
+
|
105
|
+
function tokenOpLiteral(quote) {
|
106
|
+
return function(stream, state) {
|
107
|
+
var escaped = false, ch;
|
108
|
+
while ((ch = stream.next()) != null) {
|
109
|
+
if (ch == quote && !escaped) {
|
110
|
+
state.tokenize = tokenBase;
|
111
|
+
break;
|
112
|
+
}
|
113
|
+
escaped = !escaped && ch == "\\";
|
114
|
+
}
|
115
|
+
return "variable-2";
|
116
|
+
};
|
117
|
+
}
|
118
|
+
|
119
|
+
function tokenComment(stream, state) {
|
120
|
+
for (;;) {
|
121
|
+
if (stream.skipTo("*")) {
|
122
|
+
stream.next();
|
123
|
+
if (stream.eat("/")) {
|
124
|
+
state.tokenize = tokenBase;
|
125
|
+
break;
|
126
|
+
}
|
127
|
+
} else {
|
128
|
+
stream.skipToEnd();
|
129
|
+
break;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
return "comment";
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
function pushContext(state, type, col) {
|
137
|
+
state.context = {prev: state.context, indent: state.indent, col: col, type: type};
|
138
|
+
}
|
139
|
+
function popContext(state) {
|
140
|
+
state.indent = state.context.indent;
|
141
|
+
state.context = state.context.prev;
|
142
|
+
}
|
143
|
+
|
144
|
+
return {
|
145
|
+
startState: function() {
|
146
|
+
return {tokenize: tokenBase,
|
147
|
+
context: null,
|
148
|
+
indent: 0,
|
149
|
+
col: 0};
|
150
|
+
},
|
151
|
+
|
152
|
+
token: function(stream, state) {
|
153
|
+
if (stream.sol()) {
|
154
|
+
if (state.context && state.context.align == null) state.context.align = false;
|
155
|
+
state.indent = stream.indentation();
|
156
|
+
}
|
157
|
+
if (stream.eatSpace()) return null;
|
158
|
+
var style = state.tokenize(stream, state);
|
159
|
+
|
160
|
+
if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") {
|
161
|
+
state.context.align = true;
|
162
|
+
}
|
163
|
+
|
164
|
+
if (curPunc == "(") pushContext(state, ")", stream.column());
|
165
|
+
else if (curPunc == "[") pushContext(state, "]", stream.column());
|
166
|
+
else if (curPunc == "{") pushContext(state, "}", stream.column());
|
167
|
+
else if (/[\]\}\)]/.test(curPunc)) {
|
168
|
+
while (state.context && state.context.type == "pattern") popContext(state);
|
169
|
+
if (state.context && curPunc == state.context.type) popContext(state);
|
170
|
+
}
|
171
|
+
else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
|
172
|
+
else if (/atom|string|variable/.test(style) && state.context) {
|
173
|
+
if (/[\}\]]/.test(state.context.type))
|
174
|
+
pushContext(state, "pattern", stream.column());
|
175
|
+
else if (state.context.type == "pattern" && !state.context.align) {
|
176
|
+
state.context.align = true;
|
177
|
+
state.context.col = stream.column();
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
return style;
|
182
|
+
},
|
183
|
+
|
184
|
+
indent: function(state, textAfter) {
|
185
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
186
|
+
var context = state.context;
|
187
|
+
if (/[\]\}]/.test(firstChar))
|
188
|
+
while (context && context.type == "pattern") context = context.prev;
|
189
|
+
|
190
|
+
var closing = context && firstChar == context.type;
|
191
|
+
if (!context)
|
192
|
+
return 0;
|
193
|
+
else if (context.type == "pattern")
|
194
|
+
return context.col;
|
195
|
+
else if (context.align)
|
196
|
+
return context.col + (closing ? 0 : 1);
|
197
|
+
else
|
198
|
+
return context.indent + (closing ? 0 : indentUnit);
|
199
|
+
}
|
200
|
+
};
|
201
|
+
});
|
202
|
+
|
203
|
+
CodeMirror.defineMIME("text/x-mysql", "mysql");
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: NTriples mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="ntriples.js"></script>
|
9
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
10
|
+
<style type="text/css">
|
11
|
+
.CodeMirror {
|
12
|
+
border: 1px solid #eee;
|
13
|
+
}
|
14
|
+
</style>
|
15
|
+
</head>
|
16
|
+
<body>
|
17
|
+
<h1>CodeMirror: NTriples mode</h1>
|
18
|
+
<form>
|
19
|
+
<textarea id="ntriples" name="ntriples">
|
20
|
+
<http://Sub1> <http://pred1> <http://obj> .
|
21
|
+
<http://Sub2> <http://pred2#an2> "literal 1" .
|
22
|
+
<http://Sub3#an3> <http://pred3> _:bnode3 .
|
23
|
+
_:bnode4 <http://pred4> "literal 2"@lang .
|
24
|
+
_:bnode5 <http://pred5> "literal 3"^^<http://type> .
|
25
|
+
</textarea>
|
26
|
+
</form>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
|
30
|
+
</script>
|
31
|
+
<p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
|
32
|
+
</body>
|
33
|
+
</html>
|
@@ -0,0 +1,170 @@
|
|
1
|
+
/**********************************************************
|
2
|
+
* This script provides syntax highlighting support for
|
3
|
+
* the Ntriples format.
|
4
|
+
* Ntriples format specification:
|
5
|
+
* http://www.w3.org/TR/rdf-testcases/#ntriples
|
6
|
+
***********************************************************/
|
7
|
+
|
8
|
+
/*
|
9
|
+
The following expression defines the defined ASF grammar transitions.
|
10
|
+
|
11
|
+
pre_subject ->
|
12
|
+
{
|
13
|
+
( writing_subject_uri | writing_bnode_uri )
|
14
|
+
-> pre_predicate
|
15
|
+
-> writing_predicate_uri
|
16
|
+
-> pre_object
|
17
|
+
-> writing_object_uri | writing_object_bnode |
|
18
|
+
(
|
19
|
+
writing_object_literal
|
20
|
+
-> writing_literal_lang | writing_literal_type
|
21
|
+
)
|
22
|
+
-> post_object
|
23
|
+
-> BEGIN
|
24
|
+
} otherwise {
|
25
|
+
-> ERROR
|
26
|
+
}
|
27
|
+
*/
|
28
|
+
CodeMirror.defineMode("ntriples", function() {
|
29
|
+
|
30
|
+
var Location = {
|
31
|
+
PRE_SUBJECT : 0,
|
32
|
+
WRITING_SUB_URI : 1,
|
33
|
+
WRITING_BNODE_URI : 2,
|
34
|
+
PRE_PRED : 3,
|
35
|
+
WRITING_PRED_URI : 4,
|
36
|
+
PRE_OBJ : 5,
|
37
|
+
WRITING_OBJ_URI : 6,
|
38
|
+
WRITING_OBJ_BNODE : 7,
|
39
|
+
WRITING_OBJ_LITERAL : 8,
|
40
|
+
WRITING_LIT_LANG : 9,
|
41
|
+
WRITING_LIT_TYPE : 10,
|
42
|
+
POST_OBJ : 11,
|
43
|
+
ERROR : 12
|
44
|
+
};
|
45
|
+
function transitState(currState, c) {
|
46
|
+
var currLocation = currState.location;
|
47
|
+
var ret;
|
48
|
+
|
49
|
+
// Opening.
|
50
|
+
if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;
|
51
|
+
else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;
|
52
|
+
else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;
|
53
|
+
else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;
|
54
|
+
else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;
|
55
|
+
else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL;
|
56
|
+
|
57
|
+
// Closing.
|
58
|
+
else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;
|
59
|
+
else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;
|
60
|
+
else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;
|
61
|
+
else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;
|
62
|
+
else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;
|
63
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ;
|
64
|
+
else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;
|
65
|
+
else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;
|
66
|
+
|
67
|
+
// Closing typed and language literal.
|
68
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;
|
69
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;
|
70
|
+
|
71
|
+
// Spaces.
|
72
|
+
else if( c == ' ' &&
|
73
|
+
(
|
74
|
+
currLocation == Location.PRE_SUBJECT ||
|
75
|
+
currLocation == Location.PRE_PRED ||
|
76
|
+
currLocation == Location.PRE_OBJ ||
|
77
|
+
currLocation == Location.POST_OBJ
|
78
|
+
)
|
79
|
+
) ret = currLocation;
|
80
|
+
|
81
|
+
// Reset.
|
82
|
+
else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;
|
83
|
+
|
84
|
+
// Error
|
85
|
+
else ret = Location.ERROR;
|
86
|
+
|
87
|
+
currState.location=ret;
|
88
|
+
}
|
89
|
+
|
90
|
+
return {
|
91
|
+
startState: function() {
|
92
|
+
return {
|
93
|
+
location : Location.PRE_SUBJECT,
|
94
|
+
uris : [],
|
95
|
+
anchors : [],
|
96
|
+
bnodes : [],
|
97
|
+
langs : [],
|
98
|
+
types : []
|
99
|
+
};
|
100
|
+
},
|
101
|
+
token: function(stream, state) {
|
102
|
+
var ch = stream.next();
|
103
|
+
if(ch == '<') {
|
104
|
+
transitState(state, ch);
|
105
|
+
var parsedURI = '';
|
106
|
+
stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );
|
107
|
+
state.uris.push(parsedURI);
|
108
|
+
if( stream.match('#', false) ) return 'variable';
|
109
|
+
stream.next();
|
110
|
+
transitState(state, '>');
|
111
|
+
return 'variable';
|
112
|
+
}
|
113
|
+
if(ch == '#') {
|
114
|
+
var parsedAnchor = '';
|
115
|
+
stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});
|
116
|
+
state.anchors.push(parsedAnchor);
|
117
|
+
return 'variable-2';
|
118
|
+
}
|
119
|
+
if(ch == '>') {
|
120
|
+
transitState(state, '>');
|
121
|
+
return 'variable';
|
122
|
+
}
|
123
|
+
if(ch == '_') {
|
124
|
+
transitState(state, ch);
|
125
|
+
var parsedBNode = '';
|
126
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});
|
127
|
+
state.bnodes.push(parsedBNode);
|
128
|
+
stream.next();
|
129
|
+
transitState(state, ' ');
|
130
|
+
return 'builtin';
|
131
|
+
}
|
132
|
+
if(ch == '"') {
|
133
|
+
transitState(state, ch);
|
134
|
+
stream.eatWhile( function(c) { return c != '"'; } );
|
135
|
+
stream.next();
|
136
|
+
if( stream.peek() != '@' && stream.peek() != '^' ) {
|
137
|
+
transitState(state, '"');
|
138
|
+
}
|
139
|
+
return 'string';
|
140
|
+
}
|
141
|
+
if( ch == '@' ) {
|
142
|
+
transitState(state, '@');
|
143
|
+
var parsedLang = '';
|
144
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});
|
145
|
+
state.langs.push(parsedLang);
|
146
|
+
stream.next();
|
147
|
+
transitState(state, ' ');
|
148
|
+
return 'string-2';
|
149
|
+
}
|
150
|
+
if( ch == '^' ) {
|
151
|
+
stream.next();
|
152
|
+
transitState(state, '^');
|
153
|
+
var parsedType = '';
|
154
|
+
stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );
|
155
|
+
state.types.push(parsedType);
|
156
|
+
stream.next();
|
157
|
+
transitState(state, '>');
|
158
|
+
return 'variable';
|
159
|
+
}
|
160
|
+
if( ch == ' ' ) {
|
161
|
+
transitState(state, ch);
|
162
|
+
}
|
163
|
+
if( ch == '.' ) {
|
164
|
+
transitState(state, ch);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
};
|
168
|
+
});
|
169
|
+
|
170
|
+
CodeMirror.defineMIME("text/n-triples", "ntriples");
|