Showing preview only (8,339K chars total). Download the full file or copy to clipboard to get everything.
Repository: google/CodeCity
Branch: master
Commit: fa1bd2734b80
Files: 780
Total size: 7.8 MB
Directory structure:
gitextract_2201ao9s/
├── .clang-format
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bin/
│ ├── dump-core
│ ├── nginx-dev
│ └── startup.command
├── connect/
│ ├── connect.html
│ ├── connectServer
│ ├── log.html
│ └── world.html
├── core/
│ ├── README
│ ├── core_10_base.js
│ ├── core_11_$.utils.js
│ ├── core_12_$.utils.code.js
│ ├── core_13_$.Selector.js
│ ├── core_20_$.utils.html.js
│ ├── core_21_$.jssp.js
│ ├── core_22_$.connection.js
│ ├── core_23_$.servers.http.js
│ ├── core_24_$.hosts.js
│ ├── core_25_$.db.tempId.js
│ ├── core_25_$.userDatabase.js
│ ├── core_26_inline_editor.js
│ ├── core_27_editor.js
│ ├── core_28_$.servers.eval.js
│ ├── core_30_$.utils.command.js
│ ├── core_31_$.utils_world.js
│ ├── core_32_physical.js
│ ├── core_33_world.js
│ ├── core_34_$.servers.login.js
│ ├── core_34_$.servers.telnet.js
│ ├── core_40_$.startRoom.js
│ ├── core_41_deutsche_zimmer.js
│ ├── core_42_plant.js
│ ├── core_43_genetics_lab.js
│ ├── core_44_$.assistant.js
│ ├── core_45_Challenge_Room.js
│ ├── core_46_$.secuityCourse.js
│ ├── core_99_startup.js
│ └── dump_spec.json
├── database/
│ ├── README
│ └── codecity.cfg
├── docs/
│ └── setup.md
├── etc/
│ ├── apache.conf
│ ├── cc-localhost.conf
│ ├── cc-onedomain.conf
│ ├── cc-subdomain.conf
│ ├── codecity-connect.service
│ ├── codecity-login.service
│ ├── codecity-mobwrite.service
│ ├── codecity.service
│ └── gcloud-snapshot
├── login/
│ ├── login.html
│ ├── loginServer
│ └── package.json
├── minimal/
│ ├── core_01_minimal.js
│ ├── minimal.cfg
│ └── readme.txt
├── mobwrite/
│ ├── mobwrite.cfg
│ ├── mobwrite_core.py
│ ├── mobwrite_core_test.py
│ └── mobwrite_server.py
├── server/
│ ├── code.js
│ ├── codecity
│ ├── compile
│ ├── config.txt
│ ├── dump
│ ├── dumper.js
│ ├── externs/
│ │ ├── WeakRef.js
│ │ ├── buffer/
│ │ │ ├── buffer.js
│ │ │ └── package.json
│ │ ├── crypto/
│ │ │ ├── crypto.js
│ │ │ └── package.json
│ │ ├── events/
│ │ │ ├── events.js
│ │ │ └── package.json
│ │ ├── fs/
│ │ │ ├── fs.js
│ │ │ └── package.json
│ │ ├── http/
│ │ │ ├── http.js
│ │ │ └── package.json
│ │ ├── https/
│ │ │ ├── https.js
│ │ │ └── package.json
│ │ ├── net/
│ │ │ ├── net.js
│ │ │ └── package.json
│ │ ├── node.js
│ │ ├── path/
│ │ │ ├── package.json
│ │ │ └── path.js
│ │ ├── stream/
│ │ │ ├── package.json
│ │ │ └── stream.js
│ │ ├── tls/
│ │ │ ├── package.json
│ │ │ └── tls.js
│ │ └── util/
│ │ ├── package.json
│ │ └── util.js
│ ├── interpreter.js
│ ├── iterable_weakmap.js
│ ├── iterable_weakset.js
│ ├── package.json
│ ├── parser.js
│ ├── priorityqueue.js
│ ├── registry.js
│ ├── repl
│ ├── selector.js
│ ├── serialize.js
│ ├── startup/
│ │ ├── cc.js
│ │ ├── es5.js
│ │ ├── es6.js
│ │ ├── es7.js
│ │ ├── es8.js
│ │ └── esx.js
│ └── tests/
│ ├── code_test.js
│ ├── db/
│ │ ├── core_01_$.js
│ │ ├── core_01_$.system.js
│ │ ├── test.cfg
│ │ ├── test_00_start.js
│ │ ├── test_01_es5.js
│ │ ├── test_01_es6.js
│ │ ├── test_01_es7.js
│ │ ├── test_02_errors.js
│ │ ├── test_02_perms.js
│ │ ├── test_09_end.js
│ │ ├── test_10_fibonacci.js
│ │ └── test_20_reboot.js
│ ├── dump_test.js
│ ├── dumper_test.js
│ ├── interpreter_bench.js
│ ├── interpreter_common.js
│ ├── interpreter_test.js
│ ├── interpreter_unit_test.js
│ ├── iterable_weakmap_test.js
│ ├── iterable_weakset_test.js
│ ├── priorityqueue_test.js
│ ├── registry_test.js
│ ├── run
│ ├── run.js
│ ├── selector_test.js
│ ├── serialize_bench.js
│ ├── serialize_test.js
│ ├── testcases.js
│ ├── testing.js
│ └── tinycore/
│ ├── README
│ ├── core_00_es_minimal.js
│ ├── core_10_base.js
│ ├── core_13_$.utils.code.js
│ ├── core_35_$.servers.eval.js
│ ├── dump_spec.json
│ └── tiny.cfg
├── static/
│ ├── 503.html
│ ├── code/
│ │ ├── code.js
│ │ ├── common.js
│ │ ├── diff.css
│ │ ├── diff.js
│ │ ├── editor.css
│ │ ├── editor.js
│ │ ├── explorer.js
│ │ ├── mobwrite/
│ │ │ ├── demo/
│ │ │ │ ├── editor.html
│ │ │ │ ├── form.html
│ │ │ │ ├── mobwrite_form.js
│ │ │ │ └── test.html
│ │ │ ├── mobwrite_cc.js
│ │ │ └── mobwrite_core.js
│ │ ├── objectPanel.js
│ │ ├── style.css
│ │ ├── svg.css
│ │ ├── svg.js
│ │ └── tests/
│ │ ├── test.html
│ │ └── test.js
│ ├── connect/
│ │ ├── common.css
│ │ ├── common.js
│ │ ├── connect.css
│ │ ├── connect.js
│ │ ├── log.css
│ │ ├── log.js
│ │ ├── prettify.css
│ │ ├── prettify.js
│ │ ├── tests/
│ │ │ ├── test.html
│ │ │ └── test.js
│ │ ├── world.css
│ │ └── world.js
│ ├── flamethrower.html
│ ├── login-close.html
│ ├── securitystore/
│ │ ├── style.css
│ │ └── utils.js
│ └── style/
│ ├── jfk.css
│ └── svg.css
└── third_party/
├── CodeMirror/
│ ├── AUTHORS
│ ├── CHANGELOG.md
│ ├── CONTRIBUTING.md
│ ├── LICENSE
│ ├── METADATA
│ ├── README.md
│ ├── addon/
│ │ ├── comment/
│ │ │ ├── comment.js
│ │ │ └── continuecomment.js
│ │ ├── dialog/
│ │ │ ├── dialog.css
│ │ │ └── dialog.js
│ │ ├── display/
│ │ │ ├── autorefresh.js
│ │ │ ├── fullscreen.css
│ │ │ ├── fullscreen.js
│ │ │ ├── panel.js
│ │ │ ├── placeholder.js
│ │ │ └── rulers.js
│ │ ├── edit/
│ │ │ ├── closebrackets.js
│ │ │ ├── closetag.js
│ │ │ ├── continuelist.js
│ │ │ ├── matchbrackets.js
│ │ │ ├── matchtags.js
│ │ │ └── trailingspace.js
│ │ ├── fold/
│ │ │ ├── brace-fold.js
│ │ │ ├── comment-fold.js
│ │ │ ├── foldcode.js
│ │ │ ├── foldgutter.css
│ │ │ ├── foldgutter.js
│ │ │ ├── indent-fold.js
│ │ │ ├── markdown-fold.js
│ │ │ └── xml-fold.js
│ │ ├── hint/
│ │ │ ├── anyword-hint.js
│ │ │ ├── css-hint.js
│ │ │ ├── html-hint.js
│ │ │ ├── javascript-hint.js
│ │ │ ├── show-hint.css
│ │ │ ├── show-hint.js
│ │ │ ├── sql-hint.js
│ │ │ └── xml-hint.js
│ │ ├── lint/
│ │ │ ├── coffeescript-lint.js
│ │ │ ├── css-lint.js
│ │ │ ├── html-lint.js
│ │ │ ├── javascript-lint.js
│ │ │ ├── json-lint.js
│ │ │ ├── lint.css
│ │ │ ├── lint.js
│ │ │ └── yaml-lint.js
│ │ ├── merge/
│ │ │ ├── merge.css
│ │ │ └── merge.js
│ │ ├── mode/
│ │ │ ├── loadmode.js
│ │ │ ├── multiplex.js
│ │ │ ├── multiplex_test.js
│ │ │ ├── overlay.js
│ │ │ └── simple.js
│ │ ├── runmode/
│ │ │ ├── colorize.js
│ │ │ ├── runmode-standalone.js
│ │ │ ├── runmode.js
│ │ │ └── runmode.node.js
│ │ ├── scroll/
│ │ │ ├── annotatescrollbar.js
│ │ │ ├── scrollpastend.js
│ │ │ ├── simplescrollbars.css
│ │ │ └── simplescrollbars.js
│ │ ├── search/
│ │ │ ├── jump-to-line.js
│ │ │ ├── match-highlighter.js
│ │ │ ├── matchesonscrollbar.css
│ │ │ ├── matchesonscrollbar.js
│ │ │ ├── search.js
│ │ │ └── searchcursor.js
│ │ ├── selection/
│ │ │ ├── active-line.js
│ │ │ ├── mark-selection.js
│ │ │ └── selection-pointer.js
│ │ ├── tern/
│ │ │ ├── tern.css
│ │ │ ├── tern.js
│ │ │ └── worker.js
│ │ └── wrap/
│ │ └── hardwrap.js
│ ├── bin/
│ │ ├── authors.sh
│ │ ├── lint
│ │ ├── release
│ │ ├── source-highlight
│ │ └── upload-release.js
│ ├── demo/
│ │ ├── activeline.html
│ │ ├── anywordhint.html
│ │ ├── bidi.html
│ │ ├── btree.html
│ │ ├── buffers.html
│ │ ├── changemode.html
│ │ ├── closebrackets.html
│ │ ├── closetag.html
│ │ ├── complete.html
│ │ ├── emacs.html
│ │ ├── folding.html
│ │ ├── fullscreen.html
│ │ ├── hardwrap.html
│ │ ├── html5complete.html
│ │ ├── indentwrap.html
│ │ ├── lint.html
│ │ ├── loadmode.html
│ │ ├── marker.html
│ │ ├── markselection.html
│ │ ├── matchhighlighter.html
│ │ ├── matchtags.html
│ │ ├── merge.html
│ │ ├── multiplex.html
│ │ ├── mustache.html
│ │ ├── panel.html
│ │ ├── placeholder.html
│ │ ├── preview.html
│ │ ├── requirejs.html
│ │ ├── resize.html
│ │ ├── rulers.html
│ │ ├── runmode.html
│ │ ├── search.html
│ │ ├── simplemode.html
│ │ ├── simplescrollbars.html
│ │ ├── spanaffectswrapping_shim.html
│ │ ├── sublime.html
│ │ ├── tern.html
│ │ ├── theme.html
│ │ ├── trailingspace.html
│ │ ├── variableheight.html
│ │ ├── vim.html
│ │ ├── visibletabs.html
│ │ ├── widget.html
│ │ └── xmlcomplete.html
│ ├── doc/
│ │ ├── activebookmark.js
│ │ ├── docs.css
│ │ ├── internals.html
│ │ ├── manual.html
│ │ ├── realworld.html
│ │ ├── releases.html
│ │ ├── reporting.html
│ │ ├── upgrade_v2.2.html
│ │ ├── upgrade_v3.html
│ │ └── upgrade_v4.html
│ ├── index.html
│ ├── keymap/
│ │ ├── emacs.js
│ │ ├── sublime.js
│ │ └── vim.js
│ ├── lib/
│ │ ├── codemirror.css
│ │ └── codemirror.js
│ ├── mode/
│ │ ├── apl/
│ │ │ ├── apl.js
│ │ │ └── index.html
│ │ ├── asciiarmor/
│ │ │ ├── asciiarmor.js
│ │ │ └── index.html
│ │ ├── asn.1/
│ │ │ ├── asn.1.js
│ │ │ └── index.html
│ │ ├── asterisk/
│ │ │ ├── asterisk.js
│ │ │ └── index.html
│ │ ├── brainfuck/
│ │ │ ├── brainfuck.js
│ │ │ └── index.html
│ │ ├── clike/
│ │ │ ├── clike.js
│ │ │ ├── index.html
│ │ │ ├── scala.html
│ │ │ └── test.js
│ │ ├── clojure/
│ │ │ ├── clojure.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── cmake/
│ │ │ ├── cmake.js
│ │ │ └── index.html
│ │ ├── cobol/
│ │ │ ├── cobol.js
│ │ │ └── index.html
│ │ ├── coffeescript/
│ │ │ ├── coffeescript.js
│ │ │ └── index.html
│ │ ├── commonlisp/
│ │ │ ├── commonlisp.js
│ │ │ └── index.html
│ │ ├── crystal/
│ │ │ ├── crystal.js
│ │ │ └── index.html
│ │ ├── css/
│ │ │ ├── css.js
│ │ │ ├── gss.html
│ │ │ ├── gss_test.js
│ │ │ ├── index.html
│ │ │ ├── less.html
│ │ │ ├── less_test.js
│ │ │ ├── scss.html
│ │ │ ├── scss_test.js
│ │ │ └── test.js
│ │ ├── cypher/
│ │ │ ├── cypher.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── d/
│ │ │ ├── d.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── dart/
│ │ │ ├── dart.js
│ │ │ └── index.html
│ │ ├── diff/
│ │ │ ├── diff.js
│ │ │ └── index.html
│ │ ├── django/
│ │ │ ├── django.js
│ │ │ └── index.html
│ │ ├── dockerfile/
│ │ │ ├── dockerfile.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── dtd/
│ │ │ ├── dtd.js
│ │ │ └── index.html
│ │ ├── dylan/
│ │ │ ├── dylan.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── ebnf/
│ │ │ ├── ebnf.js
│ │ │ └── index.html
│ │ ├── ecl/
│ │ │ ├── ecl.js
│ │ │ └── index.html
│ │ ├── eiffel/
│ │ │ ├── eiffel.js
│ │ │ └── index.html
│ │ ├── elm/
│ │ │ ├── elm.js
│ │ │ └── index.html
│ │ ├── erlang/
│ │ │ ├── erlang.js
│ │ │ └── index.html
│ │ ├── factor/
│ │ │ ├── factor.js
│ │ │ └── index.html
│ │ ├── fcl/
│ │ │ ├── fcl.js
│ │ │ └── index.html
│ │ ├── forth/
│ │ │ ├── forth.js
│ │ │ └── index.html
│ │ ├── fortran/
│ │ │ ├── fortran.js
│ │ │ └── index.html
│ │ ├── gas/
│ │ │ ├── gas.js
│ │ │ └── index.html
│ │ ├── gfm/
│ │ │ ├── gfm.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── gherkin/
│ │ │ ├── gherkin.js
│ │ │ └── index.html
│ │ ├── go/
│ │ │ ├── go.js
│ │ │ └── index.html
│ │ ├── groovy/
│ │ │ ├── groovy.js
│ │ │ └── index.html
│ │ ├── haml/
│ │ │ ├── haml.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── handlebars/
│ │ │ ├── handlebars.js
│ │ │ └── index.html
│ │ ├── haskell/
│ │ │ ├── haskell.js
│ │ │ └── index.html
│ │ ├── haskell-literate/
│ │ │ ├── haskell-literate.js
│ │ │ └── index.html
│ │ ├── haxe/
│ │ │ ├── haxe.js
│ │ │ └── index.html
│ │ ├── htmlembedded/
│ │ │ ├── htmlembedded.js
│ │ │ └── index.html
│ │ ├── htmlmixed/
│ │ │ ├── htmlmixed.js
│ │ │ └── index.html
│ │ ├── http/
│ │ │ ├── http.js
│ │ │ └── index.html
│ │ ├── idl/
│ │ │ ├── idl.js
│ │ │ └── index.html
│ │ ├── index.html
│ │ ├── javascript/
│ │ │ ├── index.html
│ │ │ ├── javascript.js
│ │ │ ├── json-ld.html
│ │ │ ├── test.js
│ │ │ └── typescript.html
│ │ ├── jinja2/
│ │ │ ├── index.html
│ │ │ └── jinja2.js
│ │ ├── jsx/
│ │ │ ├── index.html
│ │ │ ├── jsx.js
│ │ │ └── test.js
│ │ ├── julia/
│ │ │ ├── index.html
│ │ │ └── julia.js
│ │ ├── livescript/
│ │ │ ├── index.html
│ │ │ └── livescript.js
│ │ ├── lua/
│ │ │ ├── index.html
│ │ │ └── lua.js
│ │ ├── markdown/
│ │ │ ├── index.html
│ │ │ ├── markdown.js
│ │ │ └── test.js
│ │ ├── mathematica/
│ │ │ ├── index.html
│ │ │ └── mathematica.js
│ │ ├── mbox/
│ │ │ ├── index.html
│ │ │ └── mbox.js
│ │ ├── meta.js
│ │ ├── mirc/
│ │ │ ├── index.html
│ │ │ └── mirc.js
│ │ ├── mllike/
│ │ │ ├── index.html
│ │ │ └── mllike.js
│ │ ├── modelica/
│ │ │ ├── index.html
│ │ │ └── modelica.js
│ │ ├── mscgen/
│ │ │ ├── index.html
│ │ │ ├── mscgen.js
│ │ │ ├── mscgen_test.js
│ │ │ ├── msgenny_test.js
│ │ │ └── xu_test.js
│ │ ├── mumps/
│ │ │ ├── index.html
│ │ │ └── mumps.js
│ │ ├── nginx/
│ │ │ ├── index.html
│ │ │ └── nginx.js
│ │ ├── nsis/
│ │ │ ├── index.html
│ │ │ └── nsis.js
│ │ ├── ntriples/
│ │ │ ├── index.html
│ │ │ └── ntriples.js
│ │ ├── octave/
│ │ │ ├── index.html
│ │ │ └── octave.js
│ │ ├── oz/
│ │ │ ├── index.html
│ │ │ └── oz.js
│ │ ├── pascal/
│ │ │ ├── index.html
│ │ │ └── pascal.js
│ │ ├── pegjs/
│ │ │ ├── index.html
│ │ │ └── pegjs.js
│ │ ├── perl/
│ │ │ ├── index.html
│ │ │ └── perl.js
│ │ ├── php/
│ │ │ ├── index.html
│ │ │ ├── php.js
│ │ │ └── test.js
│ │ ├── pig/
│ │ │ ├── index.html
│ │ │ └── pig.js
│ │ ├── powershell/
│ │ │ ├── index.html
│ │ │ ├── powershell.js
│ │ │ └── test.js
│ │ ├── properties/
│ │ │ ├── index.html
│ │ │ └── properties.js
│ │ ├── protobuf/
│ │ │ ├── index.html
│ │ │ └── protobuf.js
│ │ ├── pug/
│ │ │ ├── index.html
│ │ │ └── pug.js
│ │ ├── puppet/
│ │ │ ├── index.html
│ │ │ └── puppet.js
│ │ ├── python/
│ │ │ ├── index.html
│ │ │ ├── python.js
│ │ │ └── test.js
│ │ ├── q/
│ │ │ ├── index.html
│ │ │ └── q.js
│ │ ├── r/
│ │ │ ├── index.html
│ │ │ └── r.js
│ │ ├── rpm/
│ │ │ ├── changes/
│ │ │ │ └── index.html
│ │ │ ├── index.html
│ │ │ └── rpm.js
│ │ ├── rst/
│ │ │ ├── index.html
│ │ │ └── rst.js
│ │ ├── ruby/
│ │ │ ├── index.html
│ │ │ ├── ruby.js
│ │ │ └── test.js
│ │ ├── rust/
│ │ │ ├── index.html
│ │ │ ├── rust.js
│ │ │ └── test.js
│ │ ├── sas/
│ │ │ ├── index.html
│ │ │ └── sas.js
│ │ ├── sass/
│ │ │ ├── index.html
│ │ │ ├── sass.js
│ │ │ └── test.js
│ │ ├── scheme/
│ │ │ ├── index.html
│ │ │ └── scheme.js
│ │ ├── shell/
│ │ │ ├── index.html
│ │ │ ├── shell.js
│ │ │ └── test.js
│ │ ├── sieve/
│ │ │ ├── index.html
│ │ │ └── sieve.js
│ │ ├── slim/
│ │ │ ├── index.html
│ │ │ ├── slim.js
│ │ │ └── test.js
│ │ ├── smalltalk/
│ │ │ ├── index.html
│ │ │ └── smalltalk.js
│ │ ├── smarty/
│ │ │ ├── index.html
│ │ │ └── smarty.js
│ │ ├── solr/
│ │ │ ├── index.html
│ │ │ └── solr.js
│ │ ├── soy/
│ │ │ ├── index.html
│ │ │ ├── soy.js
│ │ │ └── test.js
│ │ ├── sparql/
│ │ │ ├── index.html
│ │ │ └── sparql.js
│ │ ├── spreadsheet/
│ │ │ ├── index.html
│ │ │ └── spreadsheet.js
│ │ ├── sql/
│ │ │ ├── index.html
│ │ │ └── sql.js
│ │ ├── stex/
│ │ │ ├── index.html
│ │ │ ├── stex.js
│ │ │ └── test.js
│ │ ├── stylus/
│ │ │ ├── index.html
│ │ │ └── stylus.js
│ │ ├── swift/
│ │ │ ├── index.html
│ │ │ ├── swift.js
│ │ │ └── test.js
│ │ ├── tcl/
│ │ │ ├── index.html
│ │ │ └── tcl.js
│ │ ├── textile/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── textile.js
│ │ ├── tiddlywiki/
│ │ │ ├── index.html
│ │ │ ├── tiddlywiki.css
│ │ │ └── tiddlywiki.js
│ │ ├── tiki/
│ │ │ ├── index.html
│ │ │ ├── tiki.css
│ │ │ └── tiki.js
│ │ ├── toml/
│ │ │ ├── index.html
│ │ │ └── toml.js
│ │ ├── tornado/
│ │ │ ├── index.html
│ │ │ └── tornado.js
│ │ ├── troff/
│ │ │ ├── index.html
│ │ │ └── troff.js
│ │ ├── ttcn/
│ │ │ ├── index.html
│ │ │ └── ttcn.js
│ │ ├── ttcn-cfg/
│ │ │ ├── index.html
│ │ │ └── ttcn-cfg.js
│ │ ├── turtle/
│ │ │ ├── index.html
│ │ │ └── turtle.js
│ │ ├── twig/
│ │ │ ├── index.html
│ │ │ └── twig.js
│ │ ├── vb/
│ │ │ ├── index.html
│ │ │ └── vb.js
│ │ ├── vbscript/
│ │ │ ├── index.html
│ │ │ └── vbscript.js
│ │ ├── velocity/
│ │ │ ├── index.html
│ │ │ └── velocity.js
│ │ ├── verilog/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── verilog.js
│ │ ├── vhdl/
│ │ │ ├── index.html
│ │ │ └── vhdl.js
│ │ ├── vue/
│ │ │ ├── index.html
│ │ │ └── vue.js
│ │ ├── webidl/
│ │ │ ├── index.html
│ │ │ └── webidl.js
│ │ ├── xml/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── xml.js
│ │ ├── xquery/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── xquery.js
│ │ ├── yacas/
│ │ │ ├── index.html
│ │ │ └── yacas.js
│ │ ├── yaml/
│ │ │ ├── index.html
│ │ │ └── yaml.js
│ │ ├── yaml-frontmatter/
│ │ │ ├── index.html
│ │ │ └── yaml-frontmatter.js
│ │ └── z80/
│ │ ├── index.html
│ │ └── z80.js
│ ├── package.json
│ ├── rollup.config.js
│ ├── src/
│ │ ├── codemirror.js
│ │ ├── display/
│ │ │ ├── Display.js
│ │ │ ├── focus.js
│ │ │ ├── gutters.js
│ │ │ ├── highlight_worker.js
│ │ │ ├── line_numbers.js
│ │ │ ├── mode_state.js
│ │ │ ├── operations.js
│ │ │ ├── scroll_events.js
│ │ │ ├── scrollbars.js
│ │ │ ├── scrolling.js
│ │ │ ├── selection.js
│ │ │ ├── update_display.js
│ │ │ ├── update_line.js
│ │ │ ├── update_lines.js
│ │ │ └── view_tracking.js
│ │ ├── edit/
│ │ │ ├── CodeMirror.js
│ │ │ ├── commands.js
│ │ │ ├── deleteNearSelection.js
│ │ │ ├── drop_events.js
│ │ │ ├── fromTextArea.js
│ │ │ ├── global_events.js
│ │ │ ├── key_events.js
│ │ │ ├── legacy.js
│ │ │ ├── main.js
│ │ │ ├── methods.js
│ │ │ ├── mouse_events.js
│ │ │ ├── options.js
│ │ │ └── utils.js
│ │ ├── input/
│ │ │ ├── ContentEditableInput.js
│ │ │ ├── TextareaInput.js
│ │ │ ├── indent.js
│ │ │ ├── input.js
│ │ │ ├── keymap.js
│ │ │ ├── keynames.js
│ │ │ └── movement.js
│ │ ├── line/
│ │ │ ├── highlight.js
│ │ │ ├── line_data.js
│ │ │ ├── pos.js
│ │ │ ├── saw_special_spans.js
│ │ │ ├── spans.js
│ │ │ └── utils_line.js
│ │ ├── measurement/
│ │ │ ├── position_measurement.js
│ │ │ └── widgets.js
│ │ ├── model/
│ │ │ ├── Doc.js
│ │ │ ├── change_measurement.js
│ │ │ ├── changes.js
│ │ │ ├── chunk.js
│ │ │ ├── document_data.js
│ │ │ ├── history.js
│ │ │ ├── line_widget.js
│ │ │ ├── mark_text.js
│ │ │ ├── selection.js
│ │ │ └── selection_updates.js
│ │ ├── modes.js
│ │ └── util/
│ │ ├── StringStream.js
│ │ ├── bidi.js
│ │ ├── browser.js
│ │ ├── dom.js
│ │ ├── event.js
│ │ ├── feature_detection.js
│ │ ├── misc.js
│ │ └── operation_group.js
│ ├── test/
│ │ ├── comment_test.js
│ │ ├── contenteditable_test.js
│ │ ├── doc_test.js
│ │ ├── driver.js
│ │ ├── emacs_test.js
│ │ ├── html-hint-test.js
│ │ ├── index.html
│ │ ├── lint.js
│ │ ├── mode_test.css
│ │ ├── mode_test.js
│ │ ├── multi_test.js
│ │ ├── phantom_driver.js
│ │ ├── run.js
│ │ ├── scroll_test.js
│ │ ├── search_test.js
│ │ ├── sql-hint-test.js
│ │ ├── sublime_test.js
│ │ ├── test.js
│ │ └── vim_test.js
│ └── theme/
│ ├── 3024-day.css
│ ├── 3024-night.css
│ ├── abcdef.css
│ ├── ambiance-mobile.css
│ ├── ambiance.css
│ ├── base16-dark.css
│ ├── base16-light.css
│ ├── bespin.css
│ ├── blackboard.css
│ ├── cobalt.css
│ ├── colorforth.css
│ ├── darcula.css
│ ├── dracula.css
│ ├── duotone-dark.css
│ ├── duotone-light.css
│ ├── eclipse.css
│ ├── elegant.css
│ ├── erlang-dark.css
│ ├── gruvbox-dark.css
│ ├── hopscotch.css
│ ├── icecoder.css
│ ├── idea.css
│ ├── isotope.css
│ ├── lesser-dark.css
│ ├── liquibyte.css
│ ├── lucario.css
│ ├── material.css
│ ├── mbo.css
│ ├── mdn-like.css
│ ├── midnight.css
│ ├── monokai.css
│ ├── neat.css
│ ├── neo.css
│ ├── night.css
│ ├── oceanic-next.css
│ ├── panda-syntax.css
│ ├── paraiso-dark.css
│ ├── paraiso-light.css
│ ├── pastel-on-dark.css
│ ├── railscasts.css
│ ├── rubyblue.css
│ ├── seti.css
│ ├── shadowfox.css
│ ├── solarized.css
│ ├── ssms.css
│ ├── the-matrix.css
│ ├── tomorrow-night-bright.css
│ ├── tomorrow-night-eighties.css
│ ├── ttcn.css
│ ├── twilight.css
│ ├── vibrant-ink.css
│ ├── xq-dark.css
│ ├── xq-light.css
│ ├── yeti.css
│ └── zenburn.css
├── DMP/
│ ├── AUTHORS
│ ├── LICENSE
│ ├── METADATA
│ ├── diff_match_patch.py
│ └── diff_match_patch_uncompressed.js
├── JSHint/
│ ├── LICENSE
│ ├── README.md
│ └── jshint.js
└── SVG-Edit/
├── AUTHORS
├── LICENSE
├── METADATA
├── README.md
└── editor/
├── browser.js
├── canvg/
│ ├── canvg.js
│ └── rgbcolor.js
├── coords.js
├── draw.js
├── external/
│ └── dynamic-import-polyfill/
│ └── importModule.js
├── history.js
├── historyrecording.js
├── jquery-svg.js
├── layer.js
├── math.js
├── path.js
├── pathseg.js
├── recalculate.js
├── sanitize.js
├── select.js
├── svgcanvas.js
├── svgedit.js
├── svgtransformlist.js
├── svgutils.js
└── units.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
Language: JavaScript
BasedOnStyle: Google
ColumnLimit: 80
================================================
FILE: .gitignore
================================================
.DS_Store
nohup.out
*~
login/loginServer.cfg
login/node_modules
connect/connectServer.cfg
connect/node_modules
server/node_modules
var/
*.city
*.city.partial
*.pyc
================================================
FILE: CONTRIBUTING.md
================================================
# How to Contribute
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
## Community Guidelines
This project follows [Google's Open Source Community
Guidelines](https://opensource.google.com/conduct/).
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2011
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
================================================
FILE: README.md
================================================
# Code City
Google's Code City is a social programming environment designed mainly for
education. It offers a comic book inspired virtual world where programmers can
write code collaboratively.
A list of running Code City instances may be found at https://codecity.world/
================================================
FILE: bin/dump-core
================================================
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Create configuration file for and then start nginx, for use as a
# local development server. nginx is configured to run in the
# foreground, and to store all runtime data in <repository root>/var,
# rather than in /var/ or /usr/local/var/ as it might normally.
set -e
# Get top level directory of the CodeCity git repository. It's the
# parent directory of the directory containing this script.
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)"
cd "${repo}"
mkdir -p var/dump
# Make way for dump. Ignore errors.
rm var/dump/*.js || true
rm core/core_[1-8]*.js || true
rm database/core_*.js || true
rm database/db_*.js || true
# Get last .city file.
city=$( (cd database && ls -1 *.city |sort |tail -1) )
# Run dump.
server/dump "database/${city}" core/dump_spec.json core
# Link core file into database, except core_99_startup.js
(cd database && ln -s ../core/core_[0-8]*.js .)
================================================
FILE: bin/nginx-dev
================================================
#!/bin/bash
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Create configuration files for and then start nginx, for use as a
# local development server. nginx is configured to run in the
# foreground, and to store all runtime data in <repository root>/var,
# rather than in /var/ or /usr/local/var/ as it might normally.
#
# This is done by generating var/nginx-dev.conf, which will include
# var/cc-localhost.conf, which is copied (with edits) from
# etc/cc-localhost.conf, then starting nginx specifying
# var/nginx-dev.conf as the config file to use.
set -e
# Get top level directory of the CodeCity git repository. It's the
# parent directory of the directory containing this script.
readonly repo="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)"
# Create var directory if required
if [[ ! -d "${repo}/var" ]] ; then
if [[ -x "${repo}/var" ]] ; then
echo "${repo}/var already exists and is not a directory" 1>&2
exit 1
fi
mkdir "${repo}/var"
fi
# Find location where the nginx installation keeps its config files.
# We only want the mime.types file.
dirs=(/usr/local/etc /etc/opt /etc)
if type brew >/dev/null 2>&1 ; then # Homebrew in path?
dirs=("$(brew --prefix)/etc" "${dirs[@]}")
fi
for dir in "${dirs[@]}"; do
if [[ -d "${dir}" && -f "${dir}/nginx/mime.types" ]] ; then
readonly mimetypes="${dir}/nginx/mime.types"
break;
fi
done
if [[ -z "${mimetypes}" ]] ; then
echo "$0: can't find mime.types file." 1>&2
exit 1;
fi
cat >"$repo/var/nginx-dev.conf" <<EOF
# Auto-generated by bin/nginx-dev. Do not edit.
daemon off;
worker_processes 1;
# Set pidfile and logfile paths to be in $repo/var:
pid $repo/var/nginx.pid;
error_log $repo/var/error.log;
events {
}
http {
access_log off;
include ${mimetypes};
default_type application/octet-stream;
# Set temp paths to be in $repo/var:
client_body_temp_path $repo/var/client_temp;
fastcgi_temp_path $repo/var/fastcgi_temp;
proxy_temp_path $repo/var/proxy_temp;
scgi_temp_path $repo/var/scgi_temp;
uwsgi_temp_path $repo/var/uwsgi_temp;
include ${repo}/var/cc-localhost.conf;
}
EOF
readonly repo_escaped=${repo//\//\\/}
sed -e "s/REPOSITORY/${repo_escaped}/g" ${repo}/etc/cc-localhost.conf \
> ${repo}/var/cc-localhost.conf
nginx -c "$repo/var/nginx-dev.conf"
================================================
FILE: bin/startup.command
================================================
#!/usr/bin/osascript
# Script to open four terminal windows that execute all the Code City servers
# with one double-click. For OSX.
tell application "Finder"
set basePath to (POSIX path of (container of (container of (path to me)) as alias))
end tell
tell app "Terminal"
do script "cd " & basePath & "/login
./loginServer"
do script "cd " & basePath & "/connect
./connectServer"
do script "cd " & basePath & "/mobwrite
python2 mobwrite_server.py"
do script "cd " & basePath & "/server
./codecity " & basePath & "/database/codecity.cfg"
end tell
================================================
FILE: connect/connect.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Code City</title>
<link href="https://fonts.googleapis.com/css?family=Patrick+Hand" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<link href="<<<STATIC_URL>>>style/jfk.css" rel="stylesheet">
<link href="<<<STATIC_URL>>>connect/connect.css" rel="stylesheet">
<link href="<<<STATIC_URL>>>favicon.ico" rel="shortcut icon">
<script> // Data injected by connect server.
var SESSION_ID = '<<<SESSION_ID>>>';
</script>
<script src="<<<STATIC_URL>>>connect/connect.js"></script>
</head>
<body>
<div id="optionsDiv">
<div class="jfk-button" role="button" id="worldButton">World</div><div
class="jfk-button" role="button" id="logButton">Log</div><div
class="jfk-button" role="button" id="pauseButton">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="icon">
<g id="pauseIcon">
<rect x="1" y="0" height="8" width="2" />
<rect x="5" y="0" height="8" width="2" />
</g>
<g id="playIcon" style="display: none">
<path d="M1,0 L7.5,4 1,8 Z" />
</g>
</svg>
Pause scroll</div><div
class="jfk-button" role="button" id="clearButton">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="icon">
<path d="M1,0 L8,7 7,8 0,1 Z" />
<path d="M7,0 L0,7 1,8 8,1 Z" />
</svg>
Clear buffer</div>
</div>
<iframe src="world" id="worldFrame"></iframe>
<iframe src="log" id="logFrame"></iframe>
<table id="mainTable">
<tbody>
<tr>
<td id="displayCell">
Loading...
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<textarea id="commandTextarea" placeholder="> Type commands here, such as: say Hello"></textarea>
</td>
</tr>
</tfoot>
</table>
</body>
</html>
================================================
FILE: connect/connectServer
================================================
#!/usr/bin/env node
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Node.js server that provides connection services to Code City.
* @author fraser@google.com (Neil Fraser)
*/
'use strict';
var crypto = require('crypto');
var fs = require('fs');
var http = require('http');
var net = require('net');
// Configuration constants.
const configFileName = 'connectServer.cfg';
// Global variables.
var CFG = null;
var queueList = Object.create(null);
const DEFAULT_CFG = {
// Internal port for this HTTP server. Nginx hides this from users.
httpPort: 7782,
// URL of login page (absolute or relative).
loginUrl: 'https://login.example.codecity.world/',
// URL of static folder (absolute or relative).
staticUrl: 'https://static.example.codecity.world/',
// Host of Code City.
remoteHost: 'localhost',
// Port of Code City.
remotePort: 7777,
// Age in seconds of abandoned queues to be closed.
connectionTimeout: 300
};
/**
* Class for one user's connection to Code City.
* Establishes a connection and buffers the text coming from Code City.
* @param {string} id ID of this queue.
* @constructor
*/
var Queue = function (id) {
// Save 'this' for closures below.
var thisQueue = this;
/**
* ID of this queue in queueList.
*/
this.id = id;
/**
* Time that this queue was pinged by a user. Abandoned queues are deleted.
*/
this.lastPingTime = Date.now();
/**
* The index number of the most recent memo added to the memo buffer.
*/
this.memoNum = 0;
/**
* Buffer of incomplete data from Code City.
* If undefined, drop all input until next linefeed.
*/
this.lineBuffer = '';
/**
* Maximum allowed length (in bytes) of a single memo.
*/
this.maxLineSize = 10 * 1024 * 1024;
/**
* Buffer of memos from Code City to the user.
*/
this.memoBuffer = [];
/**
* The index number of the most recent command received from the user.
*/
this.commandNum = 0;
/**
* Persistent TCP connection to Code City.
*/
this.client = new net.Socket();
this.client.on('close', this.destroy.bind(this, 'Code City closed session'));
this.client.on('error', function(error) {
console.log('TCP error for session ' + id, error);
});
this.client.on('data', function(data) {
function drop(overflow) {
console.log('Session ' + id + ' drops ' + overflow.length +
' bytes of data.');
return '{"type":"narrate","text":"[OVERFLOW: ' + overflow.length +
' bytes lost.]"}\n';
}
var text = data.toString();
if (!text) {
return;
}
if (thisQueue.lineBuffer) {
text = thisQueue.lineBuffer + text;
}
// Split into lines, while preserving the linebreaks.
var lines = text.split(/^/m);
if (thisQueue.lineBuffer === undefined) {
// Throw away continued oversized line.
var incompleteLine = lines.shift();
lines.unshift(drop(incompleteLine));
if (incompleteLine.endsWith('\n')) {
// Found the end of the oversized line. Reset the buffer.
thisQueue.lineBuffer = '';
}
}
for (var i = 0; i < lines.length; i++) {
if (lines[i].endsWith('\n')) {
if (lines[i].length > thisQueue.maxLineSize) {
// Line is complete, but oversized. Drop.
lines[i] = drop(lines[i]);
}
thisQueue.memoBuffer.push(lines[i]);
thisQueue.memoNum++;
} else {
// Incomplete line.
if (lines[i].length > thisQueue.maxLineSize) {
// Discard, and throw away everything till next linebreak.
thisQueue.memoBuffer.push(drop(lines[i]));
thisQueue.memoNum++;
thisQueue.lineBuffer = undefined;
} else {
// Save this line to the buffer so it may be completed next time.
thisQueue.lineBuffer = lines[i];
}
}
}
});
this.client.connect(CFG.remotePort, CFG.remoteHost);
};
/**
* Close this queue and deregister it.
* @param {string} msg Console message to print (with ID appended).
*/
Queue.prototype.destroy = function(msg) {
if (queueList[this.id]) {
delete queueList[this.id];
}
this.client.end();
console.log(msg + ' ' + this.id);
};
/**
* Load a file from disk, add substitutions, and serve to the web.
* @param {!Object} response HTTP server response object.
* @param {string} filename Name of template file on disk.
* @param {!Object} subs Hash of replacement strings.
*/
function serveFile(response, filename, subs) {
fs.readFile(filename, 'utf8', function(err, data) {
if (err) {
response.statusCode = 500;
console.log(err);
response.end('Unable to load file: ' + filename + '\n' + err);
}
// Inject substitutions.
for (var name in subs) {
data = data.replace(new RegExp(name, 'g'), subs[name]);
}
// Serve page to user.
response.statusCode = 200;
response.setHeader('Content-Type', 'text/html');
response.end(data);
});
}
/**
* Handles HTTP requests from web server.
* @param {!Object} request HTTP server request object
* @param {!Object} response HTTP server response object.
*/
function handleRequest(request, response) {
if (request.connection.remoteAddress !== '127.0.0.1') {
// This check is redundant, the server is only accessible to
// localhost connections.
console.log('Rejecting connection from ' + request.connection.remoteAddress);
response.end('Connection rejected.');
return;
}
var path = request.url.split('?')[0]; // Strip off any parameters.
if (request.method === 'GET' && path.endsWith('/log')) {
serveFile(response, 'log.html', {'<<<STATIC_URL>>>': CFG.staticUrl});
return;
}
if (request.method === 'GET' && path.endsWith('/world')) {
serveFile(response, 'world.html', {'<<<STATIC_URL>>>': CFG.staticUrl});
return;
}
if (request.method === 'GET' && path.endsWith('/')) {
var cookieList = {};
var rhc = request.headers.cookie;
rhc && rhc.split(';').forEach(function(cookie) {
var parts = cookie.split('=');
cookieList[parts.shift().trim()] = decodeURI(parts.join('='));
});
// Validate the ID to ensure there was no tampering.
var m = cookieList.ID && cookieList.ID.match(/^[0-9a-f]+$/);
if (!m) {
console.log('Missing login cookie. Redirecting.');
response.writeHead(302, { // Temporary redirect.
'Location': CFG.loginUrl
});
response.end('Login required. Redirecting.');
return;
}
var seed = (Date.now() * Math.random()).toString() + cookieList.ID;
// This ID gets transmitted a *lot* so keep it short.
var sessionId = crypto.createHash('sha3-224').update(seed).digest('base64');
if (Object.keys(queueList).length > 1000) {
response.statusCode = 429;
response.end('Too many queues open at once.');
console.log('Too many queues open at once.');
return;
}
var queue = new Queue(sessionId);
queueList[sessionId] = queue;
// Start a connection.
queue.client.write('identify as ' + cookieList.ID + '\n');
var subs = {
'<<<SESSION_ID>>>': sessionId,
'<<<STATIC_URL>>>': CFG.staticUrl
};
serveFile(response, 'connect.html', subs);
console.log('Hello xxxx' + cookieList.ID.substring(cookieList.ID.length - 4) +
', starting session ' + sessionId);
return;
}
if (request.method === 'POST' && path.endsWith('/ping')) {
var requestBody = '';
request.on('data', function(data) {
requestBody += data;
if (requestBody.length > 1000000) { // Megabyte of commands?
console.error('Oversized JSON: ' + requestBody.length / 1024 + 'kb');
response.statusCode = 413;
response.end('Request Entity Too Large');
}
});
request.on('end', function() {
// No ID cookie, the user has logged out.
if (!/(^|;)\s*ID=\w/.test(request.headers.cookie)) {
console.error('Not logged in');
response.statusCode = 410;
response.end('Not logged in');
return;
}
try {
var receivedJson = JSON.parse(requestBody);
if (!receivedJson['q']) {
throw Error('No queue');
}
} catch (e) {
console.error('Illegal JSON');
response.statusCode = 412;
response.end('Illegal JSON');
return;
}
ping(receivedJson, response);
});
return;
}
response.statusCode = 404;
response.end('Unknown connectServer URL: ' + request.url);
}
function ping(receivedJson, response) {
var q = receivedJson['q'];
var ackMemoNum = receivedJson['ackMemoNum'];
var cmdNum = receivedJson['cmdNum'];
var cmds = receivedJson['cmds'];
var logout = receivedJson['logout'];
var queue = queueList[q];
if (!queue) {
console.log('Unknown session ' + q);
response.statusCode = 410;
response.end('Your session has timed out');
return;
}
queue.lastPingTime = Date.now();
if (typeof ackMemoNum === 'number') {
if (ackMemoNum > queue.memoNum) {
var msg = 'Client ' + q + ' ackMemoNum ' + ackMemoNum +
', but queue.memoNum is only ' + queue.memoNum;
console.error(msg);
response.statusCode = 412;
response.end(msg);
return;
}
// Client acknowledges receipt of memos.
// Remove them from the output list.
queue.memoBuffer.splice(0,
queue.memoBuffer.length + ackMemoNum - queue.memoNum);
}
var delay = 0;
if (typeof cmdNum === 'number') {
// Client sent commands. Increase server's index for acknowledgment.
var currentIndex = cmdNum - cmds.length + 1;
for (var i = 0; i < cmds.length; i++) {
if (currentIndex > queue.commandNum) {
queue.commandNum = currentIndex;
// Send commands to Code City.
queue.client.write(cmds[i]);
delay += 200;
}
currentIndex++;
}
var ackCmdNextPing = true;
} else {
var ackCmdNextPing = false;
}
if (logout) {
pong(queue, response, ackCmdNextPing);
queue.destroy('Client disconnected');
} else {
// Wait a fifth of a second for each command,
// but don't wait for more than a second.
var delay = Math.min(delay, 1000);
var replyFunc = pong.bind(null, queue, response, ackCmdNextPing);
setTimeout(replyFunc, delay);
}
}
function pong(queue, response, ackCmdNextPing) {
var sendingJson = {};
if (ackCmdNextPing) {
sendingJson['ackCmdNum'] = queue.commandNum;
}
if (queue.memoBuffer.length) {
sendingJson['memoNum'] = queue.memoNum;
sendingJson['memos'] = queue.memoBuffer;
}
response.statusCode = 200;
response.setHeader('Content-Type', 'application/json');
response.end(JSON.stringify(sendingJson));
}
/**
* Read the JSON configuration file and return it. If none is
* present, write a stub and throw an error.
*/
function readConfigFile(filename) {
let data;
try {
data = fs.readFileSync(filename, 'utf8');
} catch (err) {
console.log(`Configuration file ${filename} not found. ` +
'Creating new file.');
data = JSON.stringify(DEFAULT_CFG, null, 2) + '\n';
fs.writeFileSync(filename, data, 'utf8');
}
CFG = JSON.parse(data);
if (!CFG.loginUrl || CFG.loginUrl === DEFAULT_CFG.loginUrl) {
throw Error(
`Configuration file ${filename} not configured. ` +
'Please edit this file.');
}
if (!CFG.loginUrl.endsWith('/')) CFG.loginUrl += '/';
if (!CFG.staticUrl.endsWith('/')) CFG.staticUrl += '/';
}
/**
* Close and destroy any abandoned queues. Called every minute.
*/
function cleanup() {
var bestBefore = Date.now() - CFG.connectionTimeout * 1000;
for (var id in queueList) {
var queue = queueList[id];
if (queue.lastPingTime < bestBefore) {
queue.destroy('Timeout of session');
}
}
}
/**
* Start up the HTTP server.
*/
function startup() {
readConfigFile(configFileName);
var server = http.createServer(handleRequest);
server.listen(CFG.httpPort, 'localhost', function(){
console.log('Connection server listening on port ' + CFG.httpPort);
});
setInterval(cleanup, 60 * 1000);
}
startup();
================================================
FILE: connect/log.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Code City: Log frame</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">
<link rel="stylesheet" href="<<<STATIC_URL>>>style/jfk.css">
<link rel="stylesheet" href="<<<STATIC_URL>>>connect/common.css">
<link rel="stylesheet" href="<<<STATIC_URL>>>connect/log.css">
<script> // Data injected by connect server.
var STATIC_URL = '<<<STATIC_URL>>>';
</script>
<script src="<<<STATIC_URL>>>connect/common.js"></script>
<script src="<<<STATIC_URL>>>connect/log.js"></script>
</head>
<body>
<div style="display: none">
<!-- Extracted client templates -->
<span id="connectedTemplate">Connected.</span>
<span id="disconnectedTemplate">Disconnected.</span>
<span id="reconnectTemplate">Reconnect?</span>
<span id="roomObjectTemplate">You see %1 here.</span>
<span id="roomObjectsTemplate">You see %1 here.</span>
<span id="roomUserTemplate">%1 is here.</span>
<span id="roomUsersTemplate">%1 are here.</span>
<span id="unknownTemplate">Someone</span>
<span id="sayTemplate">%1 says, "%2"</span>
<span id="saySelfTemplate">You say, "%1"</span>
<span id="askTemplate">%1 asks, "%2"</span>
<span id="askSelfTemplate">You ask, "%1"</span>
<span id="exclaimTemplate">%1 exclaims, "%2"</span>
<span id="exclaimSelfTemplate">You exclaim, "%1"</span>
<span id="thinkTemplate">%1 thinks, "%2"</span>
<span id="thinkSelfTemplate">You think, "%1"</span>
<span id="andTemplate">and</span>
</div>
<div id="scrollDiv"></div>
</body>
</html>
================================================
FILE: connect/world.html
================================================
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Code City: World frame</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Patrick+Hand">
<link rel="stylesheet" href="<<<STATIC_URL>>>style/jfk.css">
<link rel="stylesheet" href="<<<STATIC_URL>>>style/svg.css">
<link rel="stylesheet" href="<<<STATIC_URL>>>connect/common.css">
<link rel="stylesheet" href="<<<STATIC_URL>>>connect/world.css">
<script> // Data injected by connect server.
var STATIC_URL = '<<<STATIC_URL>>>';
</script>
<script src="<<<STATIC_URL>>>connect/common.js"></script>
<script src="<<<STATIC_URL>>>connect/world.js"></script>
</head>
<body>
<div style="display: none">
<!-- Extracted client templates -->
<span id="connectedTemplate">Connected.</span>
<span id="disconnectedTemplate">Disconnected.</span>
<span id="reconnectTemplate">Reconnect?</span>
<span id="closeIframeTemplate">Close iframe</span>
<span id="relaunchIframeTemplate">↻ Relaunch iframe</span>
</div>
<div id="scrollDiv">
<div id="panoramaDiv"></div>
<div id="iframeStorage"></div>
</div>
</body>
</html>
================================================
FILE: core/README
================================================
This database contains the latest release of the official Code City
Core. Normally, when creating a new instance, the database should be
initialised by reading all these files in, in order, into the new
server. This will normally be accomplished by symlinking them into
the /database/ directory, making sure that no .city files are present
in that directory, then starting the server using
database/codecity.cfg.
The following naming convention has been established to keep things
organised:
core_0?_*.js - ES5.1 (and later) polyfills / JS base language stuff.
core_1?_*.js - Base structure & utilities ($, $.utils, etc.)
core_2?_*.js - Web servers, editors, etc.
core_3?_*.js - Physical world infrastructure, telnet server, etc.
core_4?_*.js - Start room, demos, etc.
test_??_*.js - Any tests to be run against the database.
================================================
FILE: core/core_10_base.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Database core for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
var perms = new 'perms';
var setPerms = new 'setPerms';
var $ = function $(selector) {
return new $.Selector(selector).toValue(/*save:*/ true);
};
$.root = new 'CC.root';
$.root.name = 'root';
$.root.toString = function toString() {
return 'root';
};
$.physicals = (new 'Object.create')(null);
$.physicals.Maximilian = {};
$.physicals.Neil = {};
$.system = {};
$.system.log = new 'CC.log';
$.system.checkpoint = new 'CC.checkpoint';
$.system.shutdown = new 'CC.shutdown';
$.system.connectionListen = new 'CC.connectionListen';
$.system.connectionUnlisten = new 'CC.connectionUnlisten';
$.system.connectionWrite = new 'CC.connectionWrite';
$.system.connectionClose = new 'CC.connectionClose';
$.system.xhr = new 'CC.xhr';
$.system.onStartup = function onStartup() {
/* Do things needed at database start, when starting from a .js dump
* rather than from a .city snapshot (which preserves threads,
* listening sockets, etc.)
*/
// Listen on various sockets.
try {$.system.connectionListen(7776, $.servers.login.connection, 100);} catch(e) {}
try {$.system.connectionListen(7777, $.servers.telnet.connection, 100);} catch(e) {}
try {$.system.connectionListen(7780, $.servers.http.connection, 100);} catch(e) {}
try {$.system.connectionListen(9999, $.servers.eval.connection);} catch(e) {}
$.system.log('Startup: listeners started.');
// Restart timers and clear auto-expring caches.
$.clock.validate();
$.db.tempId.cleanNow();
suspend();
$.system.log('Startup: timers restarted and caches cleared.');
// Rebuild Selector reverse-lookup database, which is not presently
// preserved in the dump as it is a WeakMap.
$.Selector.db.populate();
$.system.log('Startup: Selector reverse-lookup DB rebuilt.');
};
Object.setOwnerOf($.system.onStartup, $.physicals.Neil);
Object.setOwnerOf($.system.onStartup.prototype, $.physicals.Maximilian);
var user = function user() {
/* The global user() is intended to be used to find the current
* user object from deeply-nested functions (to which it is
* impractical to thread cmd.user, for whatever reason).
*
* Previously user was a global variable set to the current user
* object by $.servers.telnet.connection.onReceiveLine, but this
* can cause problems when one command's execution suspends and
* another user's command runs in mean time.
*
* It is preferable to avoid using this function; instead, use
* cmd.user or this where possible.
*/
$.system.log('Auditing user() usage:\n' + (new Error()).stack);
return Object.getOwnerOf(Thread.current());
};
$.utils = {};
$.utils.validate = {};
$.servers = {};
================================================
FILE: core/core_11_$.utils.js
================================================
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Basic utilities for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.utils.validate.ownArray = function ownArray(object, key) {
// Ensure that object[key] is an array not shared with any other
// object or property, not inherited from a prototype, etc.
// If it is, relaced it with a new, unshared array with the same
// contents (if possible).
if (!object.hasOwnProperty(key) || !Array.isArray(object[key]) ||
object[key].forObj !== object || object[key].forKey !== key) {
try {
object[key] = Array.from(object[key]);
} catch (e) {
object[key] = [];
}
Object.defineProperties(object[key], {forObj: {value: object},
forKey: {value: key}});
}
};
Object.setOwnerOf($.utils.validate.ownArray, $.physicals.Maximilian);
$.utils.validate.functionPrototypes = function functionPrototypes() {
/* Find (and fix) functions that have f.prototype.constructor !== f.
*/
var u = user();
u.narrate('Looking for functions with mismatched .prototype.constructor...');
$.utils.object.spider($, function findProtosHelper(object, path) {
// Skip $.archive entirely.
if (object === $.archive) return true;
if (typeof object !== 'function') return false;
var selector = $.Selector.for(object) || new $.Selector(['$'].concat(path));
if (!object.prototype) {
if (!String(object).includes('[native code]')) {
u.narrate(String(selector) + ' has no .prototype');
}
} else if (!object.prototype.constructor) {
u.narrate(String(selector) + ' has no .prototype.constructor');
} else if (object.prototype.constructor !== object) {
u.narrate(String(selector) + ' has mismatched .prototype.constructor');
var protoProps = Object.getOwnPropertyNames(object.prototype);
var pcSelector = $.Selector.for(object.prototype.constructor);
// Does it look like a plain old boring auto-created .prototype object?
var pd = Object.getOwnPropertyDescriptor(object.prototype, 'constructor');
if (Object.getPrototypeOf(object.prototype) === Object.prototype &&
protoProps.length === 1 && protoProps[0] === 'constructor' &&
pd.writable === true && pd.enumerable === false && pd.configurable === true ) {
if (String(pcSelector) === String(selector) + '.prototype.constructor') {
u.narrate('----Fixable?: yes!');
object.prototype.constructor = object;
} else {
u.narrate('----Fixable?: yes🤞 (is ' + String(pcSelector) + ')');
// Make new .prototype object, since current one is likely shared.
var newProto = {constructor: object};
Object.setOwnerOf(newProto, Object.getOwnerOf(object));
Object.defineProperty(newProto, 'constructor', {enumerable: false});
object.prototype = newProto;
}
} else {
u.narrate('----Fixable?: NO: has properties other than .constructor' +
(pcSelector ? ' (is ' + String(pcSelector) + ')' : ''));
}
}
return false;
});
u.narrate('Done.');
};
Object.setOwnerOf($.utils.validate.functionPrototypes, $.physicals.Maximilian);
Object.setOwnerOf($.utils.validate.functionPrototypes.prototype, $.physicals.Maximilian);
$.utils.isObject = function isObject(v) {
/* Returns true iff v is an object (of any class, including Array
* and Function). */
return (typeof v === 'object' && v !== null) || typeof v === 'function';
};
Object.setOwnerOf($.utils.isObject, $.physicals.Maximilian);
$.utils.imageMatch = {};
$.utils.imageMatch.recog = function recog(svgText) {
svgText = '<svg transform="scale(4)">' + svgText + '</svg>';
var json = $.system.xhr('https://neil.fraser.name/scripts/imageMatch.py' +
'?svg=' + encodeURIComponent(svgText));
return JSON.parse(json);
};
Object.setOwnerOf($.utils.imageMatch.recog, $.physicals.Neil);
Object.setOwnerOf($.utils.imageMatch.recog.prototype, $.physicals.Neil);
$.utils.regexp = {};
Object.setOwnerOf($.utils.regexp, $.physicals.Neil);
$.utils.regexp.escape = function escape(str) {
// Escape a string so that it may be used as a literal in a regular expression.
// Example: $.utils.regexp.escape('[...]') -> "\\[\\.\\.\\.\\]"
// Usecase: new RegExp($.utils.regexp.escape('[...]')).test('Alpha [...] Beta')
//
// Source: https://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
};
Object.setOwnerOf($.utils.regexp.escape, $.physicals.Neil);
Object.setOwnerOf($.utils.regexp.escape.prototype, $.physicals.Neil);
$.utils.array = {};
$.utils.array.filterUntilFound = function filterUntilFound(array, filter1 /*, filter2, filter3... */) {
// Apply Array.prototype.filter.call(array, filterN) for each filter
// in turn until one returns a non-empty result. Return that
// result, or an empty array if there are no more filters.
filters = Array.from(arguments).slice(1);
while (filters.length > 0) {
var filter = filters.shift();
var result = array.filter(filter);
if (result.length > 0) return result;
}
return [];
};
Object.setOwnerOf($.utils.array.filterUntilFound, $.physicals.Maximilian);
$.utils.object = {};
Object.setOwnerOf($.utils.object, $.physicals.Maximilian);
$.utils.object.spider = function spider(start, callback) {
/* Spider the objects accessible transitively via the properties of
* object.
*
* Arguments:
* start: object: Starting point for traversal of the object graph.
* callback: function(object, Array<string): boolean:
* Callback called once for each object found during traversal.
* It is passed the current object and an array of the names
* of properties from start to get to it. If it returns true,
* properties of the current object are not traversed.
*/
var thread = Thread.current();
thread.setTimeLimit(Math.min(thread.getTimeLimit() || Infinity, 100));
var seen = new WeakMap();
var path = [];
doSpider(start);
function doSpider(object) {
if (!$.utils.isObject(object)) return;
// Have we seen it before?
if (seen.has(object)) return;
seen.set(object, true);
if (callback(object, path)) return;
var keys = Object.getOwnPropertyNames(object);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
try {
path.push(key);
while (true) {
try {
doSpider(object[key]);
break;
} catch (e) {
suspend(1);
if (!(e instanceof RangeError) || e.message !== 'Thread ran too long') throw e;
}
}
} finally {
path.pop();
}
}
}
};
Object.setOwnerOf($.utils.object.spider, $.physicals.Maximilian);
Object.setOwnerOf($.utils.object.spider.prototype, $.physicals.Maximilian);
$.utils.object.transplantProperties = function transplantProperties(source, destination) {
/* Copy own properties (whether enumerable or not) from source to
* destination, but do not overwrite existing own properties(*) on
* destination. Called from $.hosts.code['/editorXhr'].handleMetadata
* to preserve properties when replacing function objects.
*
* (*) The exception to the no-overwrite rule is that if destination
* is a function and source.prototype is an object then
* destination.function will be overwritten by source.prototype;
* moreover, if a property source.prototype.constructor exists and is
* writable it will be redefined to set its value to destination.
* This ensures that destination.prototype.constructor === destination.
*
* Arguments:
* - source: object - the object to copy properties from.
* - destination: object - the object to copy properties to.
*/
if (!$.utils.isObject(source) || !$.utils.isObject(destination)) {
throw new TypeError('source and destination must be objects');
}
if (destination === source) return; // Nothing to do!
var keys = Object.getOwnPropertyNames(source);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var pd = Object.getOwnPropertyDescriptor(source, key);
if (typeof destination === 'function' &&
key === 'prototype' && $.utils.isObject(pd.value)) {
// Fix destination.constructor.prototype to be destination, if
// .constructor writable.
var cpd = Object.getOwnPropertyDescriptor(pd.value, 'constructor');
if (cpd.writable) {
cpd.value = destination;
Object.defineProperty(pd.value, 'constructor', cpd);
}
} else {
// Do not overwrite any other existing properties on destination.
if (Object.prototype.hasOwnProperty.call(destination, key)) continue;
}
try {
Object.defineProperty(destination, key, pd);
} catch (e) {
// Ignore failed attempt to copy properties.
}
}
};
Object.setOwnerOf($.utils.object.transplantProperties, $.physicals.Maximilian);
$.utils.object.getValue = function getValue(object, prop) {
/* Get the value from an object's property.
* If the value is a function, call it and return the result.
* Used (for example) to get a description. Simple objects would have a
* string in their description property. Compiles objects would have a
* function in their description property that returns a string.
*/
var value = object[prop];
if (typeof value === 'function') {
value = value.call(object);
}
return value;
};
Object.setOwnerOf($.utils.object.getValue, $.physicals.Maximilian);
Object.setOwnerOf($.utils.object.getValue.prototype, $.physicals.Neil);
$.utils.object.getPropertyLocation = function $_utils_object_getPropertyLocation(obj, propName) {
// Returns the object that defines the given propName.
// Might be object, or one of its prototypes, or null.
while (obj && !Object.prototype.hasOwnProperty.call(obj, propName)) {
obj = Object.getPrototypeOf(obj);
}
return obj;
};
Object.setOwnerOf($.utils.object.getPropertyLocation, $.physicals.Neil);
Object.setOwnerOf($.utils.object.getPropertyLocation.prototype, $.physicals.Neil);
$.utils.string = {};
$.utils.string.capitalize = function capitalize(str) {
/* 'foo' -> 'Foo'
* Assumes incoming text is already lowercase.
*/
return str.charAt(0).toUpperCase() + str.substring(1);
};
Object.setOwnerOf($.utils.string.capitalize, $.physicals.Neil);
$.utils.string.randomCharacter = function randomCharacter(chars) {
return chars.charAt(Math.random() * chars.length);
};
$.utils.string.VOWELS = 'aeiouy';
$.utils.string.CONSONANTS = 'bcdfghjklmnpqrstvwxz';
$.utils.string.ALPHABET = 'abcdefghijklmnopqrstuvwxyz';
$.utils.string.hash = new 'CC.hash';
$.utils.string.translate = function translate(text, language) {
/* Try to translate text into the specified language using an
* external translation server.
*
* Arguments:
* text: string: the text to be translated.
* language: string: a two-character ISO 639-1 language code.
*
* Returns: the translated text.
*/
var url = 'https://translate-service.scratch.mit.edu' +
'/translate?language=' + encodeURIComponent(language) +
'&text=' + encodeURIComponent(text);
var json = $.system.xhr(url);
return JSON.parse(json).result;
};
Object.setOwnerOf($.utils.string.translate, $.physicals.Maximilian);
Object.setOwnerOf($.utils.string.translate.prototype, $.physicals.Maximilian);
$.utils.string.generateRandom = function generateRandom(length, soup) {
/* Return a string of the specified length consisting of characters from the
* given soup, or $.utils.string.generateRandom.DEFAULT_SOUP if none
* specified.
*
* E.g.: generateRandom(4, 'abc') might return 'cbca'.
*
* Arguments:
* - length: number - length of string to generate.
* - soup: string - alphabet to select characters randomly from.
*/
soup = soup || $.utils.string.generateRandom.DEFAULT_SOUP;
var out = [];
for (var i = 0; i < length; i++) {
out[i] = this.randomCharacter(soup);
}
return out.join('');
};
Object.setOwnerOf($.utils.string.generateRandom, $.physicals.Maximilian);
Object.setOwnerOf($.utils.string.generateRandom.prototype, $.physicals.Neil);
$.utils.string.generateRandom.DEFAULT_SOUP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$.utils.string.prefixLines = function prefixLines(text, prefix) {
// Prepend a common prefix onto each line of code.
// Intended for indenting code or adding '//' comment markers.
return prefix + text.replace(/(?!\n$)\n/g, '\n' + prefix);
};
Object.setOwnerOf($.utils.string.prefixLines, $.physicals.Neil);
Object.setOwnerOf($.utils.string.prefixLines.prototype, $.physicals.Neil);
================================================
FILE: core/core_12_$.utils.code.js
================================================
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Code utilities for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.utils.code = {};
$.utils.code.rewriteForEval = function rewriteForEval(src, forceExpression) {
/* Eval treats {} as an empty block (return value undefined).
* Eval treats {'a': 1} as a syntax error.
* Eval treats {a: 1} as block with a labeled statement (return value 1).
* Detect these cases and enclose in parenthesis.
* But don't mess with: {var x = 1; x + x;}
* This is consistent with the console on Chrome and Node.
* If 'forceExpression' is true, then throw a SyntaxError if the src is
* more than one expression (e.g. '1; 2;').
*/
var ast = null;
if (!forceExpression) {
// Try to parse src as a program.
try {
ast = $.utils.code.parse(src);
} catch (e) {
// ast remains null.
}
}
if (ast) {
if (ast.type === 'Program' && ast.body.length === 1 &&
ast.body[0].type === 'BlockStatement') {
if (ast.body[0].body.length === 0) {
// This is an empty object: {}
return '({})';
}
if (ast.body[0].body.length === 1 &&
ast.body[0].body[0].type === 'LabeledStatement' &&
ast.body[0].body[0].body.type === 'ExpressionStatement') {
// This is an unquoted object literal: {a: 1}
// There might be a comment, so add a linebreak.
return '(' + src + '\n)';
}
}
return src;
}
// Try parsing src as an expression.
// This may throw.
ast = $.utils.code.parseExpressionAt(src, 0);
var remainder = src.substring(ast.end).trim();
if (remainder !== '') {
// Remainder might legally include trailing comments or semicolons.
// Remainder might illegally include more statements.
var remainderAst = null;
try {
remainderAst = $.utils.code.parse(remainder);
} catch (e) {
// remainderAst remains null.
}
if (!remainderAst) {
throw new SyntaxError('Syntax error beyond expression');
}
if (remainderAst.type !== 'Program') {
throw new SyntaxError('Unexpected code beyond expression'); // Module?
}
// Trim off any unnecessary trailing semicolons.
while (remainderAst.body[0] &&
remainderAst.body[0].type === 'EmptyStatement') {
remainderAst.body.shift();
}
if (remainderAst.body.length !== 0) {
throw new SyntaxError('Only one expression expected');
}
}
src = src.substring(0, ast.end);
if (ast.type === 'ObjectExpression' || ast.type === 'FunctionExpression') {
// {a: 1} and function () {} both need to be wrapped in parens to avoid
// being syntax errors.
src = '(' + src + ')';
}
return src;
};
Object.setOwnerOf($.utils.code.rewriteForEval, $.physicals.Maximilian);
$.utils.code.rewriteForEval.unittest = function() {
var cases = {
// Input: [Expression, Statement(s)]
'1 + 2': ['1 + 2', '1 + 2'],
'2 + 3 // Comment': ['2 + 3', '2 + 3 // Comment'],
'3 + 4;': ['3 + 4', '3 + 4;'],
'4 + 5; 6 + 7': [SyntaxError, '4 + 5; 6 + 7'],
'{}': ['({})', '({})'],
'{} // Comment': ['({})', '({})'],
'{};': ['({})', '{};'],
'{}; {}': [SyntaxError, '{}; {}'],
'{"a": 1}': ['({"a": 1})', '({"a": 1})'],
'{"a": 2} // Comment': ['({"a": 2})', '({"a": 2})'],
'{"a": 3};': ['({"a": 3})', '({"a": 3})'],
'{"a": 4}; {"a": 4}': [SyntaxError, SyntaxError],
'{b: 1}': ['({b: 1})', '({b: 1}\n)'],
'{b: 2} // Comment': ['({b: 2})', '({b: 2} // Comment\n)'],
'{b: 3};': ['({b: 3})', '{b: 3};'],
'{b: 4}; {b: 4}': [SyntaxError, '{b: 4}; {b: 4}'],
'function () {}': ['(function () {})', '(function () {})'],
'function () {} // Comment': ['(function () {})', '(function () {})'],
'function () {};': ['(function () {})', '(function () {})'],
'function () {}; function () {}': [SyntaxError, SyntaxError],
'{} + []': ['{} + []', '{} + []']
};
var actual;
for (var key in cases) {
if (!cases.hasOwnProperty(key)) continue;
// Test eval as an expression.
try {
actual = $.utils.code.rewriteForEval(key, true);
} catch (e) {
actual = SyntaxError;
}
if (actual !== cases[key][0]) {
throw new Error('Eval Expression\n' +
'Expected: ' + cases[key][0] + ' Actual: ' + actual);
}
// Test eval as a statement.
try {
actual = $.utils.code.rewriteForEval(key, false);
} catch (e) {
actual = SyntaxError;
}
if (actual !== cases[key][1]) {
throw new Error('Eval Statement\n' +
'Expected: ' + cases[key][1] + ' Actual: ' + actual);
}
}
};
$.utils.code.eval = function $_utils_code_eval(src, evalFunc) {
// Eval src and attempt to print the resulting value readably.
//
// Evaluation is done by calling evalFunc (passing src) if supplied,
// or by calling the eval built-in function (under a different name,
// so it operates in the global scope). Unhandled exceptions are
// caught and converted to a string.
//
// Caller may wish to transform input with
// $.utils.code.rewriteForEval before passing it to this function.
evalFunc = evalFunc || eval;
var out;
try {
out = evalFunc(src);
} catch (e) {
// Exception thrown. Use built-in ToString via + to avoid calling
// String, least it call a .toString method that itself throws.
// TODO(cpcallen): find an alternative way of doing this safely
// once the interpreter calls String for all string conversions.
if (e instanceof Error) {
out = 'Unhandled error: ' + e.name;
if (e.message) out += ': ' + e.message;
if (e.stack) out += '\n' + e.stack;
return out;
} else {
return 'Unhandled exception: ' + e;
}
}
// Suspend if needed.
try {(function(){})();} catch (e) {suspend();}
// Attempt to print a source-legal representation.
return $.utils.code.expressionFor(out, {
depth: 2,
abbreviateMethods: true,
proto: 'note',
owner: 'ignore'
});
};
Object.setOwnerOf($.utils.code.eval, $.physicals.Maximilian);
$.utils.code.regexps = {};
$.utils.code.regexps.README = '$.utils.code.regexps contains some RegExps useful for parsing or otherwise analysing code.\n\nSee ._generate() for how they are constructed and what they will match.\n';
$.utils.code.regexps._generate = function _generate() {
/* Generate some RegExps that match various bits of JavaScript syntax.
* The intention is that these regular expressions conform to the
* lexical grammar given ES5.1 Appendix A.1
* (https://262.ecma-international.org/5.1/#sec-A.1), in some cases
* updated to include changes in the current version of the spec
* (https://tc39.es/ecma262/#sec-lexical-grammar).
*
* TODO: add tests for generated RegExps.
*/
// Globally matches escape sequences found in string and regexp
// literals, like '\n' or '\x20' or '\u1234'. (This is basically
// the spec EscapeSequence but including the backslash prefix.)
this.escapes = /\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2})/g;
// Globally matches a single-quoted string literal, like "'this one'"
// and "'it\\'s'".
this.singleQuotedString =
new RegExp("'(?:[^'\\\\\\r\\n\\u2028\\u2029]|" +
this.escapes.source + ")*'", 'g');
// Globally matches a double-quoted string literal, like '"this one"'
// and '"it\'s"'.
this.doubleQuotedString =
new RegExp('"(?:[^"\\\\\\r\\n\\u2028\\u2029]|' +
this.escapes.source + ')*"', 'g');
// Globally matches a StringLiteral, like "'this one' and '"that one"'
// as well as "the 'string literal' substring of this longer string" too.
this.string = new RegExp('(?:' + this.singleQuotedString.source + '|' +
this.doubleQuotedString.source + ')', 'g');
// Globally matches a valid JavaScript IdentifierName. Note that
// this is conservative, because ANY Unicode letter can appear
// in an identifier - but the full regexp is absurdly complicated.
this.identifierName = /[A-Za-z_$][A-Za-z0-9_$]*/g;
// Matches a valid ES2020 ReservedWord.
var reserved = /await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|new|null|return|super|switch|this|throw|true|try|typeof|var|void|while|with|yield/;
// Matches ES5.1 FutureReservedWords not included in reserved.
var reservedES5 = /implements|interface|let|package|protected|public|static/;
// Globally matches a valid JavaScript ReservedWord.
this.reservedWord =
new RegExp('(?:' + reserved.source + '|' + reservedES5.source + ')', 'g');
////////////////////////////////////////////////////////////////////
// Exact forms of the above. These do not get the global flag.
var keys = ['identifierName', 'reservedWord', 'string'];
for (var key, i = 0; (key = keys[i]); i++) {
this[key + 'Exact'] = new RegExp('^' + this[key].source + '$');
}
};
Object.setOwnerOf($.utils.code.regexps._generate.prototype, $.physicals.Maximilian);
$.utils.code.regexps.escapes = /\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2})/g;
$.utils.code.regexps.singleQuotedString = /'(?:[^'\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*'/g;
$.utils.code.regexps.doubleQuotedString = /"(?:[^"\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*"/g;
$.utils.code.regexps.string = /(?:'(?:[^'\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*'|"(?:[^"\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*")/g;
$.utils.code.regexps.identifierName = /[A-Za-z_$][A-Za-z0-9_$]*/g;
$.utils.code.regexps.reservedWord = /(?:await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|new|null|return|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|implements|interface|let|package|protected|public|static)/g;
$.utils.code.regexps.identifierNameExact = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
$.utils.code.regexps.reservedWordExact = /^(?:await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|if|import|in|instanceof|new|null|return|super|switch|this|throw|true|try|typeof|var|void|while|with|yield|implements|interface|let|package|protected|public|static)$/;
$.utils.code.regexps.stringExact = /^(?:'(?:[^'\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*'|"(?:[^"\\\r\n\u2028\u2029]|\\(?:["'\\\/0bfnrtv]|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{2}))*")$/;
$.utils.code.parseString = function parseString(s) {
/* Convert a string representation of a string literal to a string.
* Basically does eval(s), but safely and only if s is a string
* literal.
*/
if (!this.regexps.stringExact.test(s)) {
throw new TypeError(this.quote(s) + ' is not a string literal');
}
return s.slice(1, -1).replace(this.regexps.escapes, function(esc) {
switch (esc[1]) {
case "'":
case '"':
case '/':
case '\\':
return esc[1];
case '0':
return '\0';
case 'b':
return '\b';
case 'f':
return '\f';
case 'n':
return '\n';
case 'r':
return '\r';
case 't':
return '\t';
case 'v':
return '\v';
case 'u':
case 'x':
return String.fromCharCode(parseInt(esc.slice(2), 16));
default:
// RegExp in call to replace has accepted something we
// don't know how to decode.
throw new Error('unknown escape sequence "' + esc + '"??');
}
});
};
Object.setOwnerOf($.utils.code.parseString, $.physicals.Maximilian);
$.utils.code.quote = function quote(str) {
// Convert a string into a string literal. We use single or double
// quotes depending on which occurs less frequently in the string to
// be escaped (prefering single quotes if it's a tie). Strictly
// speaking we only need to escape backslash, \r, \n, \u2028 (line
// separator), \u2029 (paragraph separator) and whichever quote
// character we're using, but for output readability we escape all the
// control characters.
//
// TODO(cpcallen): Consider using optimised algorithm from Node.js's
// util.format (see strEscape function in
// https://github.com/nodejs/node/blob/master/lib/util.js).
// @param {string} str The string to convert.
// @return {string} The value s as a eval-able string literal.
if (this.count(str, "'") > this.count(str, '"')) { // More 's. Use "s.
return '"' + str.replace(this.quote.doubleRE, this.quote.replace) + '"';
} else { // Equal or more "s. Use 's.
return "'" + str.replace(this.quote.singleRE, this.quote.replace) + "'";
}
};
$.utils.code.quote.singleRE = /[\x00-\x1f\\\u2028\u2029']/g;
$.utils.code.quote.doubleRE = /[\x00-\x1f\\\u2028\u2029"]/g;
$.utils.code.quote.replace = function replace(c) {
// Replace special characters with their quoted replacements.
// Intended to be used as the second argument to
// String.prototype.replace.
return $.utils.code.quote.replacements[c];
};
$.utils.code.quote.replacements = {};
$.utils.code.quote.replacements['\0'] = '\\0';
$.utils.code.quote.replacements['\x01'] = '\\x01';
$.utils.code.quote.replacements['\x02'] = '\\x02';
$.utils.code.quote.replacements['\x03'] = '\\x03';
$.utils.code.quote.replacements['\x04'] = '\\x04';
$.utils.code.quote.replacements['\x05'] = '\\x05';
$.utils.code.quote.replacements['\x06'] = '\\x06';
$.utils.code.quote.replacements['\x07'] = '\\x07';
$.utils.code.quote.replacements['\b'] = '\\b';
$.utils.code.quote.replacements['\t'] = '\\t';
$.utils.code.quote.replacements['\n'] = '\\n';
$.utils.code.quote.replacements['\v'] = '\\v';
$.utils.code.quote.replacements['\f'] = '\\f';
$.utils.code.quote.replacements['\r'] = '\\r';
$.utils.code.quote.replacements['\x0e'] = '\\x0e';
$.utils.code.quote.replacements['\x0f'] = '\\x0f';
$.utils.code.quote.replacements['"'] = '\\"';
$.utils.code.quote.replacements["'"] = "\\'";
$.utils.code.quote.replacements['\\'] = '\\\\';
$.utils.code.quote.replacements['\u2028'] = '\\u2028';
$.utils.code.quote.replacements['\u2029'] = '\\u2029';
$.utils.code.count = function count(str, searchString) {
// Count non-overlapping occurrences of searchString in str.
return str.split(searchString).length;
};
$.utils.code.isIdentifier = function isIdentifier(id) {
/* Arguments:
* - id: any - any JavaScript value.
*
* Returns: boolean - true iff id is a string representing valid
* Identifier, which is any bare word that can be used
* as a variable name (i.e., excluding reserved words).
*/
return $.utils.code.isIdentifierName(id) &&
!$.utils.code.regexps.reservedWordExact.test(id);
};
Object.setOwnerOf($.utils.code.isIdentifier, $.physicals.Maximilian);
$.utils.code.getGlobal = function getGlobal() {
// Return a pseudo global object.
var global = Object.create(null);
global.$ = $;
global.Array = Array;
global.Boolean = Boolean;
global.clearTimeout = clearTimeout;
global.Date = Date;
global.decodeURI = decodeURI;
global.decodeURIComponent = decodeURIComponent;
global.encodeURI = encodeURI;
global.encodeURIComponent = encodeURIComponent;
global.Error = Error;
global.escape = escape;
global.eval = eval;
global.EvalError = EvalError;
global.Function = Function;
global.isFinite = isFinite;
global.isNaN = isNaN;
global.JSON = JSON;
global.Math = Math;
global.Number = Number;
global.Object = Object;
global.parseFloat = parseFloat;
global.parseInt = parseInt;
global.perms = perms;
global.RangeError = RangeError;
global.ReferenceError = ReferenceError;
global.RegExp = RegExp;
global.setPerms = setPerms;
global.setTimeout = setTimeout;
global.String = String;
global.suspend = suspend;
global.SyntaxError = SyntaxError;
global.Thread = Thread;
global.TypeError = TypeError;
global.unescape = unescape;
global.URIError = URIError;
global.user = user;
global.WeakMap = WeakMap;
return global;
};
Object.setOwnerOf($.utils.code.getGlobal, $.physicals.Maximilian);
$.utils.code.parse = new 'CC.acorn.parse';
$.utils.code.parseExpressionAt = new 'CC.acorn.parseExpressionAt';
$.utils.code.isIdentifierName = function isIdentifierName(id) {
/* Arguments:
* - id: any - any JavaScript value.
*
* Returns: boolean - true iff id is a string representing valid
* IdentifierName, which is anything bare word that can appear
* after the '.' in a MemberExpresion.
*/
return typeof id === 'string' &&
$.utils.code.regexps.identifierNameExact.test(id);
};
Object.setOwnerOf($.utils.code.isIdentifierName, $.physicals.Maximilian);
Object.setOwnerOf($.utils.code.isIdentifierName.prototype, $.physicals.Maximilian);
$.utils.code.expressionFor = function expressionFor(value, options) {
/* Given an arbitrary value, return a string containing a JavaScript
* expression for it.
*
* The intention is that expressionFor(value) should return a string
* such that eval(expressionFor(value)) will be (in order of preference):
*
* - Identical to value (as determined by Object.is), or
* - An equivalent copy of value to a specified depth, or
* - Be unparsable or contain comments explaining in what way the
* result of eval will differ from original value.
*
* Arguments:
* - value: any - any JavaScript value.
* - options?: Object - optional options object. See implementation.
*
* Returns: string - an expression for value.
*
* TODO: there should be flags controlling what to do when it is not
* possible to construct an expression that will eval to an exact copy
* of value. The options should include returning valid code containing
* comments, returning unparsable code, or throwing an an error.
*/
var opts = {
depth: 10, // How deeply shall we traverse the object tree?
arrayLimit: 100, // Max number of array elements to include.
propertyLimit: 100, // Max number of properties to include.
abbreviateFunctions: false, // Elide all function bodies?
abbreviateMethods: false, // Elide method function bodies?
proto: 'set', // 'set', 'note' or (any other value) ignore prototype.
owner: 'note', // 'set', 'note' or (any other value) ignore owner.
lineLength: 80, // Line length limit, for formatting purposes.
indent: 2, // Indent for nested expressions.
seen_: [], // TODO: use Set instead of Array.
};
// Like Object.assign(opts, options) but copies inherited properties too.
for (var k in options) opts[k] = options[k];
// Helper to handle failures where expressionFor cannot or does not yet
// return an experssion that will eval to an identical copy of value.
// Typical usage: return fail('reason for failure');
function fail(message) {
// TODO: have flag to make it:
// throw new ReferenceError(message);
return $.utils.code.blockComment(message);
}
// Helper for properties in array and object literals.
function expressionForProperty(key) {
var descriptor = Object.getOwnPropertyDescriptor(value, key);
var propertyValue = descriptor.value;
if (selector) {
opts.selector = new $.Selector(selector.concat(key));
}
opts.abbreviateFunctions = opts.abbreviateMethods;
return expressionFor(propertyValue, opts);
}
var type = typeof value;
if (value === undefined || value === null ||
type === 'number' || type === 'boolean') {
if (Object.is(value, -0)) return '-0';
return String(value);
} else if (type === 'string') {
return $.utils.code.quote(value);
} else if (type !== 'function' && type !== 'object') {
throw new TypeError("unknown type '" + type + "'");
}
// value is an object of some kind (including function). Work out a selector.
var selector = $.Selector.for(value);
if (opts.selector) {
var suggestedSelectorValue = opts.selector.toValue(/*save:*/true);
if (!selector && suggestedSelectorValue === value) {
selector = opts.selector;
}
}
// Deal with already-seen objects (and nesting limit depth limit).
if (opts.seen_.includes(value)) {
return fail('cyclic or shared substructure' +
(selector ? ': ' + selector.toString() : 'with no known selector'));
} else if (opts.depth < 1) {
if (!selector) return fail(type + ' with no known selector');
return selector.toExpr();
}
// Prepare for recursive calls.
opts.seen_.push(value);
opts.depth--;
opts.lineLength -= opts.indent;
// Get the object's [[Class]] - Object, Array, Date, RegExp, Error, etc.
// Since 'class' isn't a legal variable name, re-use 'type'.
type = Object.prototype.toString.call(value).slice(8, -1);
var proto = Object.getPrototypeOf(value); // Actual prototype of value.
var expectedProto; // Expected prototype of object of same [[Class]] as value.
var prefix = '', expr = '', suffix = ''; // Concatenate to get final expression.
var entries; // Array of initialisers for object or array literal.
var notes = []; // Array of notes to postpend as comment.
// Make a note about the object's selector unless it is the expected
// one. Decide this before recursive calls mess with opts.selector.
var selectorNote = selector ? selector.toString() : '';
if (opts.selector && selectorNote === opts.selector.toString()) {
selectorNote = '';
}
if (type === 'Array') {
if (!Array.isArray(value)) throw TypeError('non-array array??');
expectedProto = Array.prototype;
prefix = '[';
suffix = ']';
entries = [];
for (var i = 0; i < value.length; i++) {
suspend();
if (i >= opts.arrayLimit) {
entries[i] = $.utils.code.blockComment('and ' + (value.length - opts.arrayLimit) + ' more');
break;
} else if (!Object.hasOwnProperty.call(value, i)) {
entries[i] = '';
continue;
}
entries[i] = expressionForProperty(String(i));
}
} else if (type === 'Date') {
expr = 'new Date(\'' + value.toJSON() + '\')';
expectedProto = Date.prototype;
} else if (type === 'Error') {
expectedProto = proto;
switch (proto) {
case EvalError.prototype: prefix = 'EvalError'; break;
case RangeError.prototype: prefix = 'RangeError'; break;
case ReferenceError.prototype: prefix = 'ReferenceError'; break;
case SyntaxError.prototype: expr = 'SyntaxError'; break;
case TypeError.prototype: expr = 'TypeError'; break;
case URIError.prototype: expr = 'URIError'; break;
case PermissionError.prototype: expr = 'PermissionError'; break;
default:
expr = 'Error';
expectedProto = Error.prototype;
}
if (typeof value.message === 'string') {
expr += '(' + $.utils.code.quote(value.message) + ')';
} else {
expr += '()';
}
} else if (type === 'Function') {
expectedProto = Function.prototype;
expr = Function.prototype.toString.call(value);
if (opts.abbreviateFunctions) {
expr = fail(expr.replace(/\{[^]*$/, '{ ... }'));
}
} else if (type === 'Object') {
expectedProto = Object.prototype;
prefix = '{';
suffix = '}';
entries = [];
var keys = Object.getOwnPropertyNames(value);
for (var i = 0; i < keys.length; i++) {
suspend();
if (i >= opts.propertyLimit) {
entries[i] = '/* and ' + (keys.length - opts.propertyLimit) + ' more */';
break;
}
var key = keys[i];
// BUG(#469): property keys that are NumericLiterals (like 3.2e4
// or 0xf00) can also appear unquoted!
entries[i] =
($.utils.code.isIdentifierName(key) ? key : $.utils.code.quote(key)) +
': ' + expressionForProperty(key);
}
} else if (type === 'RegExp') {
expr = RegExp.prototype.toString.call(value);
expectedProto = RegExp.prototype;
} else if (type === 'Thread') {
if (selector) return selector.toExpr();
expr = 'new Thread(' + fail('unable to reconstruct thread state') + ')';
expectedProto = Thread.prototype;
} else if (type === 'WeakMap') {
expectedProto = WeakMap.prototype;
expr = 'new WeakMap()';
} else {
throw new TypeError('unknown internal type ' + type);
}
// TODO: Prepend/append call to Object.defineProperties for remaining
// properties & property attributes.
// Pre/append prototype information if it is not as expected.
if (proto !== expectedProto) {
var protoString = expressionFor(proto, {depth: 0});
if (opts.proto === 'set') {
prefix = 'Object.setPrototypeOf(' + prefix;
suffix += ', ' + protoString + ')';
} else if (opts.proto === 'note') {
notes.push('[[Proto]]: ' + protoString);
}
}
// Prepend/append owner information.
var ownerString = expressionFor(Object.getOwnerOf(value), {depth: 0});
if (opts.owner === 'set') {
// BUG: Object.setOwnerOf(obj, owner) does not return obj (yet).
throw new Error("can't set owner in an expression yet");
// prefix = 'Object.setOwnerOf(' + prefix;
// suffix += ', ' + ownerString + ')';
} else if (opts.owner === 'note') {
notes.push('[[Owner]]: ' + ownerString);
}
// Prepend/append notes.
if (selectorNote) {
prefix = $.utils.code.blockComment(selectorNote) + ' ' + prefix;
}
if (notes.length) {
suffix += ' ' + $.utils.code.blockComment(notes.join(', '));
}
// Join entries choosing a suitable layout depending on available space.
if (entries && entries.length) {
// Try single-line output.
// BUG: this omits required trailing comma when there are undefined
// trailing aray elements (e.g., [1, 2, 3,,].
expr = entries.join(', ');
var result = prefix + expr + suffix;
if (result.length <= opts.lineLength && !result.includes('\n')) {
return result;
}
// Generate multi-line output.
var padding = ' '.repeat(opts.indent);
expr = '\n' + $.utils.string.prefixLines(entries.join(',\n'), padding) + ',\n';
}
return prefix + expr + suffix;
};
Object.setOwnerOf($.utils.code.expressionFor, $.physicals.Maximilian);
Object.setOwnerOf($.utils.code.expressionFor.prototype, $.physicals.Maximilian);
$.utils.code.blockComment = function blockComment(text) {
/* Format text as a block comment. Any occurences of the closing
* block comment delimiter in text will have a space inerted in them.
* If text is undefined, an empty string will be returned instead.
*
* Arguments:
* - text: string | undefined - the contents of the comment.
* Returns: string - the block comment.
*/
return text ? '/* ' + text.replace(/\*\//g, '* /') + ' */' : '';
};
Object.setOwnerOf($.utils.code.blockComment, $.physicals.Maximilian);
Object.setOwnerOf($.utils.code.blockComment.prototype, $.physicals.Maximilian);
================================================
FILE: core/core_13_$.Selector.js
================================================
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Selector implementation for Code City core.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.Selector = function Selector(s) {
/* A Selector is a representation of a selector string in the form
* of an array (of Selector.Parts) which happens to have
* Selector.prototype (with various useful convenience methods) in
* its prototype chain.
*/
var parts;
if (typeof s === 'string') {
// Parse selector text (but check in cache first).
var cached = Selector.cache_[s];
// Copy and set owner?
if (cached) return cached;
parts = Selector.parse(s);
} else if (Array.isArray(s)) {
parts = [];
// Validate & copy parts list.
if (s.length < 1) throw new RangeError('Zero-length parts list??');
if (!$.utils.code.isIdentifier(s[0])) {
throw new TypeError('parts array must begin with an identifier');
}
parts[0] = s[0];
for (var i = 1; i < s.length; i++) {
if (typeof s[i] === 'string' || s[i] === Selector.PROTOTYPE || s[i] === Selector.OWNER) {
parts[i] = s[i];
} else if (s[i] instanceof Selector.SpecialPart) {
throw new TypeError('Invalid SpecialPart in parts array');
} else if (typeof s[i] === 'object' && s[i].type) {
// Handle normalisation of parts lists that have been roundtripped via JSON.
switch(s[i].type) {
case 'proto':
parts[i] = Selector.PROTOTYPE;
break;
case 'owner':
parts[i] = Selector.OWNER;
break;
default:
throw new TypeError('Unknown SpecialPart type ' + s[i].type);
}
} else {
throw new TypeError('Invalid part in parts array');
}
}
} else {
throw new TypeError('Not a selector or parts array');
}
Object.setPrototypeOf(parts, Selector.prototype);
Object.freeze(parts);
// Copy and set owner?
Selector.cache_[parts.toString()] = parts; // Save.
return parts;
};
Object.setOwnerOf($.Selector, $.physicals.Maximilian);
Object.setPrototypeOf($.Selector.prototype, Array.prototype);
$.Selector.prototype.isOwner = function isOwner() {
/* Returns true iff the selector represents an object owner binding.
*/
return this.length > 1 && this[this.length - 1] === this.constructor.OWNER;
};
Object.setOwnerOf($.Selector.prototype.isOwner, $.physicals.Maximilian);
$.Selector.prototype.isProp = function isProp() {
/* Returns true iff the selector represents an object property binding.
*/
return this.length > 1 && typeof this[this.length - 1] === 'string';
};
Object.setOwnerOf($.Selector.prototype.isProp, $.physicals.Maximilian);
$.Selector.prototype.isProto = function isProto() {
/* Returns true iff the selector represents an object prototype binding.
*/
return this.length > 1 && this[this.length - 1] === this.constructor.PROTOTYPE;
};
Object.setOwnerOf($.Selector.prototype.isProto, $.physicals.Maximilian);
$.Selector.prototype.isVar = function isVar() {
/* Returns true iff the selector represents a top-level variable binding.
*/
return this.length === 1 && typeof this[0] === 'string';
};
Object.setOwnerOf($.Selector.prototype.isVar, $.physicals.Maximilian);
$.Selector.prototype.toExpr = function toExpr() {
/* Return the selector as an evaluable expression yeilding the selected value.
*/
return this.toString(function(part, out) {
if (part === $.Selector.PROTOTYPE) {
out.unshift('Object.getPrototypeOf(');
out.push(')');
} else if (part === $.Selector.OWNER) {
out.unshift('Object.getOwnerOf(');
out.push(')');
} else {
throw new TypeError('Invalid part in parts array');
}
});
};
Object.setOwnerOf($.Selector.prototype.toExpr, $.physicals.Maximilian);
$.Selector.prototype.toSetExpr = function toSetExpr(valueExpr) {
/* Return an expression setting the selected value to the value of the
* supplied expression.
*
* The parameter valueExpr should be a string containing a JS expression that
* evaluates to the new value to be assigned to the selected location. It
* must not contain any non-parenthesized operators with lower precedence
* than '=' - specifically, the yield and comma operators.
*/
var lastPart = this[this.length - 1];
if (!(lastPart instanceof this.constructor.SpecialPart)) {
return this.toExpr() + ' = ' + valueExpr;
}
var objExpr = new this.constructor(this.slice(0, -1)).toExpr();
if (lastPart === this.constructor.PROTOTYPE) {
return 'Object.setPrototypeOf(' + objExpr + ', ' + valueExpr + ')';
} else if (lastPart === this.constructor.OWNER) {
return 'Object.setOwnerOf(' + objExpr + ', ' + valueExpr + ')';
} else {
throw new TypeError('Invalid part in parts array');
}
};
Object.setOwnerOf($.Selector.prototype.toSetExpr, $.physicals.Maximilian);
$.Selector.prototype.toString = function toString(specialHandler) {
/* Return the canonical selector string for this Selector.
*
* The specialHandler optional parameter, if supplied, should be callback
* which accepts a Selector.SpecialPart instance and an Array of strings, and
* pushes a string representation of the SpecialPart onto the array. (See
* Selector.prototype.toExpr for an example of how to use this.)
*/
var out = [this[0]];
for (var i = 1; i < this.length; i++) {
var part = this[i];
if (part instanceof this.constructor.SpecialPart) {
if (specialHandler) {
specialHandler(part, out);
} else {
out.push(String(part));
}
} else if ($.utils.code.isIdentifierName(part)) {
out.push('.', part);
} else if (String(Number(part)) === part) {
// String represents a number with same string representation.
out.push('[', part, ']');
} else {
out.push('[', $.utils.code.quote(part), ']');
}
}
return out.join('');
};
Object.setOwnerOf($.Selector.prototype.toString, $.physicals.Maximilian);
$.Selector.prototype.toValue = function toValue(save, global) {
/* Return value corresponding to this Selector, or throw EvalError if that is
* not possible. This function basically does
*
* return eval(this.toExpr())
*
* ...only slightly more safely.
*
* Added bonus features:
* - If this selector evaluates to an object and save is true, the selector
* will be added to the the reverse-lookup database.
* - If global is specified, global variables will be evaluated by looking
* them up as properties on that object.
*/
if (this.length === 0) throw RangeError('Invalid Selector');
var varname = this[0];
if (!$.utils.code.isIdentifier(varname)) {
throw TypeError('invalid variable identifier');
}
var v;
if (global) {
v = global[varname];
} else {
try {
var globalEval = eval;
v = globalEval(varname);
} catch (e) {
v = undefined;
}
}
for (var i = 1; i < this.length; i++) {
if (!$.utils.isObject(v)) {
var s = new this.constructor(this.slice(0, i));
throw TypeError(String(s) + ' is not an object');
}
var part = this[i];
if (typeof part === 'string') {
v = v[part];
} else if (part === this.constructor.PROTOTYPE) {
v = Object.getPrototypeOf(v);
} else if (part === this.constructor.OWNER) {
v = Object.getOwnerOf(v);
} else {
throw new Error('Not implemented');
}
}
if (save) {
this.constructor.db.set(v, this);
}
return v;
};
Object.setOwnerOf($.Selector.prototype.toValue, $.physicals.Maximilian);
$.Selector.prototype.badness = function badness() {
/* Returns a "badness" score, inversely proportional to how
* desirable a particular selector is amongst other selectors
* referring to the same object. In general, longer selectors are
* more bad, but selectors containing special parts are especially
* bad.
*/
var penalties = 0;
for (var i = 0; i < this.length; i++) {
var part = this[i];
if (part instanceof this.constructor.SpecialPart) {
penalties += 100;
} else if ($.utils.code.isIdentifierName(part)) {
penalties += 10; // We like identifiers.
} else if (String(Number(part)) === part) {
penalties += 25; // Numbers are OK.
} else {
penalties += 50; // Quoted strings are undesirable.
}
}
if (this[0] === '$') penalties += 50; // Prefer builtins.
return penalties + String(this).length;
};
Object.setOwnerOf($.Selector.prototype.badness, $.physicals.Maximilian);
$.Selector.SpecialPart = function SpecialPart(type) {
// A SpecialPart is a class for all "special" selector parts (ones
// which do not represent named variables / properties).
this.type = type;
Object.freeze(this);
};
$.Selector.SpecialPart.prototype.toString = function toString() {
return '{' + this.type + '}';
};
Object.setOwnerOf($.Selector.SpecialPart.prototype.toString, $.physicals.Maximilian);
$.Selector.PROTOTYPE = (new 'Object.create')($.Selector.SpecialPart.prototype);
$.Selector.PROTOTYPE.type = 'proto';
Object.defineProperty($.Selector.PROTOTYPE, 'type', {writable: false, configurable: false});
Object.preventExtensions($.Selector.PROTOTYPE);
$.Selector.OWNER = (new 'Object.create')($.Selector.SpecialPart.prototype);
$.Selector.OWNER.type = 'owner';
Object.defineProperty($.Selector.OWNER, 'type', {writable: false, configurable: false});
Object.preventExtensions($.Selector.OWNER);
$.Selector.parse = function parse(selector) {
// Parse a selector into an array of Parts.
var tokens = this.parse.tokenize(selector);
var parts = [];
var State = {
START: 0, GOOD: 1, DOT: 2, BRACKET: 3, BRACKET_DONE: 4,
BRACE: 5, BRACE_DONE: 6
};
var state = State.START;
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (token.type === 'whitespace') continue;
switch (state) {
case State.START:
if (token.type !== 'id') {
throw new SyntaxError('Selector must start with an identifier');
}
parts.push(token.raw);
state = State.GOOD;
break;
case State.GOOD:
if (token.type === '.') {
state = State.DOT;
} else if (token.type === '[') {
state = State.BRACKET;
} else if (token.type === '{') {
state = State.BRACE;
} else if (token.type === '^') {
// State remains unchanged.
parts.push(this.PROTOTYPE);
} else {
throw new SyntaxError('Invalid token ' + $.utils.code.quote(token.raw) + ' in selector');
}
break;
case State.DOT:
if (token.type !== 'id') {
throw new SyntaxError('"." must be followed by identifier in selector');
}
parts.push(token.raw);
state = State.GOOD;
break;
case State.BRACKET:
if (token.type === 'number') {
parts.push(String(token.raw));
} else if (token.type === 'str') {
parts.push(String(token.value));
} else {
throw new SyntaxError('"[" must be followed by numeric or string literal in selector');
}
state = State.BRACKET_DONE;
break;
case State.BRACKET_DONE:
if (token.type !== ']') {
throw new SyntaxError('Invalid token ' + $.utils.code.quote(token.raw) + ' after subscript');
}
state = State.GOOD;
break;
case State.BRACE:
if (token.type === 'id' && token.raw === 'proto') {
parts.push(this.PROTOTYPE);
} else if (token.type === 'id' && token.raw === 'owner') {
parts.push(this.OWNER);
} else {
throw new SyntaxError('"{" must be followed by "proto" or "owner"');
}
state = State.BRACE_DONE;
break;
case State.BRACE_DONE:
if (token.type !== '}') {
throw new SyntaxError('Invalid token ' + $.utils.code.quote(token.raw) + ' after special');
}
state = State.GOOD;
break;
default:
throw new Error('Invalid State in parse??');
}
}
if (state !== State.GOOD) {
throw new SyntaxError('Incomplete selector ' + selector);
}
return parts;
};
Object.setOwnerOf($.Selector.parse, $.physicals.Maximilian);
$.Selector.parse.tokenize = function tokenize(selector) {
// Tokenizes a selector string. Throws a SyntaxError if any text is
// found which does not form a valid token.
var REs = {
whitespace: /^\s+/g,
'.': /^\./g,
id: new RegExp('^' + $.utils.code.regexps.identifierName.source, 'g'),
number: /^\d+/g,
'[': /^\[/g,
']': /^\]/g,
'{': /^\{/g,
'}': /^\}/g,
'^': /^\^/g,
str: new RegExp('^' + $.utils.code.regexps.string.source, 'g'),
};
var tokens = [];
NEXT_TOKEN: for (var index = 0; index < selector.length; ) {
for (var tokenType in REs) {
if (!REs.hasOwnProperty(tokenType)) continue;
var re = REs[tokenType];
re.lastIndex = 0;
var m = re.exec(selector.slice(index));
if (!m) continue; // No match. Try next regexp.
tokens.push({
type: tokenType,
raw: m[0],
valid: true,
index: index,
});
index += re.lastIndex;
continue NEXT_TOKEN;
}
// No token matched.
throw new SyntaxError('invalid selector ' + selector);
}
// Postprocess token list to get values.
for(var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (token.type === 'number') {
token.value = Number(token.raw);
} else if (token.type === 'str') {
token.value = $.utils.code.parseString(token.raw);
}
}
return tokens;
};
Object.setOwnerOf($.Selector.parse.tokenize, $.physicals.Maximilian);
$.Selector.for = function Selector_for(object) {
/* Return a Selector for object, or undefined if none known.
*/
return this.db.get(object);
};
Object.setOwnerOf($.Selector.for, $.physicals.Maximilian);
$.Selector.db = {};
$.Selector.db.map_ = new WeakMap();
$.Selector.db.set = function set(object, selector) {
if (!$.utils.isObject(object)) return; // Ignore non-object values.
if (!(selector instanceof $.Selector)) {
throw new TypeError('Second argument must be a Selector');
}
var selectorString = selector.toString();
var known = this.map_.get(object) || [];
// See if this selector is already known.
if (known.includes(selectorString)) return; // Already known. Ignore.
// Add new entry.
known.push(selectorString);
// Sort by badness, trim to length and save.
$.Selector.sortByBadness(known);
this.map_.set(object, known.slice(0, this.diversityLimit));
};
Object.setOwnerOf($.Selector.db.set, $.physicals.Maximilian);
$.Selector.db.README = 'Selector.db is database mapping objects to Selectors.\n\nThis info is stored in Selector.db.map_, which is a WeakMap mapping objects to entries.\n\nEach entry is an object whose keys are selector strings and values are the corresponding Selectors (i.e., parts lists).';
$.Selector.db.diversityLimit = 5;
$.Selector.db.get = function get(object) {
if (!$.utils.isObject(object)) return undefined;
var known = this.map_.get(object);
while (known && known.length) {
var selector = new $.Selector(known[0]);
var value = null;
try {
value = selector.toValue();
} catch (e) {}
if (value === object) {
return selector;
} else {
known.shift(); // Remove 0th item.
}
}
return undefined; // Ran out of known, valid selectors.
};
Object.setOwnerOf($.Selector.db.get, $.physicals.Maximilian);
$.Selector.db.populate = function populate() {
/* Spider the object graph, starting from the global scope, to
* (re)build the reverse-lookup database.
*
* We apply a version of Dijkstra's algorithm, specifically a BFS
* over valid Selectors, where we reenqueue children of previously-
* -visited objects if we find a better Selector for the parent
* object.
*/
// Prevent this function from running more than once at a time.
if (populate.thread_) throw new Error('already running');
try {
populate.thread_ = Thread.current();
var queue = Object.getOwnPropertyNames($.utils.code.getGlobal()).map(
function (ss) {return new $.Selector(ss);});
var seen = new WeakMap();
for (var i = 0; i < queue.length; i++) {
suspend();
var s = queue[i];
var v = s.toValue(/*save:*/true);
if (!$.utils.isObject(v)) continue; // Skip primitives completely.
var best = $.Selector.for(v);
if (seen.has(v) && s !== best) continue;
seen.set(v, true);
var parts = [$.Selector.PROTOTYPE, $.Selector.OWNER].concat(Object.getOwnPropertyNames(v));
for (var j = 0; j < parts.length; j++) {
var part = parts[j];
if (part === 'cache_') continue; // Skip .cache_ properties.
queue.push(new $.Selector(s.concat(part)));
}
}
} finally {
populate.thread_ = null;
}
};
Object.setOwnerOf($.Selector.db.populate, $.physicals.Maximilian);
Object.setOwnerOf($.Selector.db.populate.prototype, $.physicals.Maximilian);
$.Selector.db.populate.thread_ = null;
$.Selector.sortByBadness = function sortByBadness(selectors) {
// Sort an array (or arraylike), which may contain Selectors,
// (valid) selector strings, or a mix of the two, according to their
// score, as returned by Selector.prototype.badness(), with the the
// lowest-badness ones sorted first.
if (!$.utils.isObject(selectors) || typeof selectors.length != 'number') {
throw new TypeError('argument must be an arraylike');
}
// Begin by populating a badness cache, for quick lookups.
var cache = sortByBadness.cache_;
for (var i = 0; i < selectors.length; i++) {
var s, ss = selectors[i];
if (typeof ss === 'string') {
s = new $.Selector(ss);
} else if (ss instanceof $.Selector) {
s = ss;
ss = ss.toString();
}
if (ss in cache) continue;
cache[ss] = s.badness();
}
// Do sort. Optimised for sorting selector strings, since
// that's what's needed by $.Selector.db.put.
Array.prototype.sort.call(selectors, function compare(a, b) {
if (typeof a !== 'string') a = String(a);
if (typeof b !== 'string') b = String(b);
return cache[a] - cache[b];
});
return selectors;
};
Object.setOwnerOf($.Selector.sortByBadness, $.physicals.Maximilian);
$.utils.Binding = function Binding(object, part) {
/* A binding is essentially just an (object, part) tuple, where part
* is a string or a Selector.SpecialPart.
*
* If object is null, part must be a string conforming to the
* syntax of an identifier; in this case the binding represents
* a variable in the global scope.
*/
if (object === null) {
if (!$.utils.code.isIdentifier(part)) {
throw TypeError('Invalid variable name');
}
} else if (!$.utils.isObject(object)) {
throw TypeError('Invalid object');
} else if (typeof part !== 'string' &&
part !== $.Selector.PROTOTYPE &&
part !== $.Selector.OWNER) {
throw TypeError('Invalid part');
}
this.object = object;
this.part = part;
};
Object.setOwnerOf($.utils.Binding, $.physicals.Maximilian);
$.utils.Binding.prototype.set = function set(value) {
/* Set the value of the binding. Throws TypeError if unable.
*/
if (this.object === null) {
if (!Object.prototype.hasOwnProperty.call($.utils.code.getGlobal(), this.part)) {
throw new TypeError("Can't create new global variable");
}
// Use a temporary property and an eval in the global scope (eval
// by any other name, literally) to set the global variable
// "safely". The temporary property is placed on $ rather than
// using $.db.tempId to avoid the possibility of the eval
// somehow being subverted to access a different value than
// expected due to one of the intervening objects being
// compromised (by a getter, say).
var tmpId;
do {
tmpId = 'tmp' + Math.floor(Math.random() * 0xFFFFFFFF);
} while (tmpId in $);
var evalGlobal = eval;
try {
$[tmpId] = value;
evalGlobal(this.part + ' = $.' + tmpId);
} finally {
delete $[tmpId];
}
} else if(this.part === $.Selector.PROTOTYPE) {
Object.setPrototypeOf(this.object, value);
} else if(this.part === $.Selector.OWNER) {
Object.setOwnerOf(this.object, value);
} else {
// BUG: doesn't handle non-writable properties.
this.object[this.part] = value;
}
};
Object.setOwnerOf($.utils.Binding.prototype.set, $.physicals.Maximilian);
$.utils.Binding.prototype.get = function get(inherited) {
/* Return the current value of the binding, or undefined if the
* binding does not exist.
*
* If inherited is true and the binding is a property binding that
* does not exist on the object, any inherited value will be returned
* instead.
*/
var part = this.part;
if (this.object === null) {
if (!$.utils.code.isIdentifier(part)) {
throw new TypeError('invalid variable identifier');
}
var evalGlobal = eval;
return evalGlobal(part);
} else if(part === $.Selector.PROTOTYPE) {
return Object.getPrototypeOf(this.object);
} else if(part === $.Selector.OWNER) {
return Object.getOwnerOf(this.object);
}
if (inherited || Object.prototype.hasOwnProperty.call(this.object, part)) {
return this.object[part];
} else {
return undefined;
}
};
Object.setOwnerOf($.utils.Binding.prototype.get, $.physicals.Maximilian);
$.utils.Binding.prototype.isOwner = function isOwner() {
/* Returns true iff the binding is an bject owner binding.
*/
return this.part === $.Selector.OWNER;
};
Object.setOwnerOf($.utils.Binding.prototype.isOwner, $.physicals.Maximilian);
$.utils.Binding.prototype.isProp = function isProp() {
/* Returns true iff the binding is an object property binding.
*/
return this.object !== null && typeof this.part === 'string';
};
Object.setOwnerOf($.utils.Binding.prototype.isProp, $.physicals.Maximilian);
$.utils.Binding.prototype.isProto = function isProto() {
/* Returns true iff the binding is an object prototype binding.
*/
return this.part === $.Selector.PROTOTYPE;
};
Object.setOwnerOf($.utils.Binding.prototype.isProto, $.physicals.Maximilian);
$.utils.Binding.prototype.isVar = function isVar() {
/* Returns true iff the binding is a top-level variable binding.
*/
return this.object === null;
};
Object.setOwnerOf($.utils.Binding.prototype.isVar, $.physicals.Maximilian);
$.utils.Binding.prototype.exists = function exists() {
/* Returns true iff the binding exists.
*/
var part = this.part;
if (this.object === null) {
if (!$.utils.code.isIdentifier(part)) {
throw new TypeError('invalid variable identifier');
}
var evalGlobal = eval;
try {
globalEval(varName);
return true;
} catch (e) {
return false;
}
} else if(part === $.Selector.PROTOTYPE ||
part === $.Selector.OWNER) {
return true;
}
return Object.prototype.hasOwnProperty.call(this.object, part);
};
Object.setOwnerOf($.utils.Binding.prototype.exists, $.physicals.Maximilian);
Object.setOwnerOf($.utils.Binding.prototype.exists.prototype, $.physicals.Maximilian);
$.utils.Binding.from = function from(selector) {
/* Create and return a Binding for the given selector - that is,
* such that Binding.from(s).get() === s.toValue().
*/
var part = selector[selector.length - 1];
if (selector.isVar()) {
// Global variable; no parent object.
return new this(null, part);
}
var parent = new $.Selector(selector);
parent.pop();
var object = parent.toValue();
if (!$.utils.isObject(object)) {
throw new TypeError(String(parent) + ' is not an object');
}
return new this(object, part);
};
Object.setOwnerOf($.utils.Binding.from, $.physicals.Maximilian);
$.Selector.cache_ = (new 'Object.create')(null);
$.Selector.sortByBadness.cache_ = (new 'Object.create')(null);
================================================
FILE: core/core_20_$.utils.html.js
================================================
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview HTML utilities for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.utils.html = {};
$.utils.html.escape = function escape(text) {
// Escape text so that it is safe to print as HTML.
return String(text).replace(/&/g, '&').replace(/"/g, '"')
.replace(/</g, '<').replace(/>/g, '>');
};
Object.setOwnerOf($.utils.html.escape, $.physicals.Maximilian);
$.utils.html.preserveWhitespace = function preserveWhitespace(text) {
// Escape text so that it is safe and preserves whitespace formatting as HTML.
// Runs of three spaces (' ') need to be escaped twice ('_ ', '__ ').
return $.utils.html.escape(text)
.replace(/\t/g, '\u00A0 \u00A0 ')
.replace(/ /g, '\u00A0 ').replace(/ /g, '\u00A0 ') // Escape twice.
.replace(/^ /gm, '\u00A0')
.replace(/\n/g, '<br>');
};
Object.setOwnerOf($.utils.html.preserveWhitespace, $.physicals.Maximilian);
================================================
FILE: core/core_21_$.jssp.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview JavaScript Server Pages for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.jssp = {};
Object.setOwnerOf($.jssp, $.physicals.Neil);
$.jssp.OutputBuffer = function OutputBuffer() {
/* An OutputBuffer is a mock $.servers.http.Response, used wheen we
* want a Jssp to produce a string rather than write to an HTTP
* client.
*/
this.buffer_ = '';
};
Object.setOwnerOf($.jssp.OutputBuffer, $.physicals.Maximilian);
$.jssp.OutputBuffer.prototype.write = function write(text) {
this.buffer_ += String(text);
};
Object.setOwnerOf($.jssp.OutputBuffer.prototype.write, $.physicals.Neil);
$.jssp.OutputBuffer.prototype.toString = function toString() {
return this.buffer_;
};
Object.setOwnerOf($.jssp.OutputBuffer.prototype.toString, $.physicals.Neil);
$.jssp.OutputBuffer.prototype.writeEscaped = function writeEscaped(text) {
// Same as .write, but HTML-escape the text first.
this.write($.utils.html.escape(text));
};
Object.setOwnerOf($.jssp.OutputBuffer.prototype.writeEscaped, $.physicals.Neil);
Object.setOwnerOf($.jssp.OutputBuffer.prototype.writeEscaped.prototype, $.physicals.Neil);
$.jssp.eval = function $_jssp_eval(obj, prop, opt_request, opt_response) {
/* Compile and run a JavaScript Server Page.
*
* The specified property on the given object will, if it is a string,
* be compiled to a function and then called.
*
* TODO: cache the compiled JSSP. Separate copy per owner?
*
* Arguments:
* - obj: Object - an object containing a property which is a JSSP source
* string, and which will be used as the value of 'this' when the
* the resulting function is called.
* - prop: string - name of the property on obj that contains the JSSP source.
* - opt_request: any - a value to be passed as the first argument to the
* compiled function. Most typically an instnace of $.servers.http.Request
* or some kind of options object.
* - opt_response: {write: function(string)} | undefined - an object to
* accumulate generated output. Most typically an instance of
* $.servers.http.Response. If omitted, a $.jssp.OutputBuffer will be
* supplied, and the accumulated output returned by eval as a string.
*
* Returns: any - if opt_response was omitted, this will be the generated
* string; otherwise, it will be the actual return value of the compiled
* function (typically undefined).
*/
if (!$.utils.isObject(obj)) {
throw new TypeError('first argument must be an object');
} else if (!(prop in obj)) {
throw new RangeError('"' + prop + '" not on object.');
}
var source = obj[prop];
if (typeof source !== 'string') {
throw TypeError('source property "' + prop + '" must be a string');
}
// Switch to the JSSP owner's permissions. The owner of the JSSP might
// not be the object's owner if the property is inherited.
var locationObj = $.utils.object.getPropertyLocation(obj, prop);
setPerms(Object.getOwnerOf(locationObj));
var request = opt_request;
var response = opt_response || new $.jssp.OutputBuffer();
// Compile source into a function.
var code = this.compile_(source);
code = '\n' +
'var this_ = this;\n' +
'function include(prop) {return $.jssp.eval(this_, prop, request, response);}\n' +
code;
var func;
try {
func = new Function('request, response', code);
} catch (e) {
suspend();
$.system.log('JSSP compilation error. ' + String(e) +
'. Code was:\n' + code.split('\n')
.map(function (line, lineNumber) {
return String(lineNumber) + ': ' + line;})
.join('\n'));
throw e;
}
// Create a .name for this function.
var selector = $.Selector.for(locationObj);
if (selector) {
selector = new $.Selector(selector.concat(prop));
Object.defineProperty(func, 'name', {value: selector.toString(), configurable: true});
}
var result = func.call(obj, request, response);
return opt_response ? result : response.toString();
};
Object.setOwnerOf($.jssp.eval, $.physicals.Maximilian);
Object.setOwnerOf($.jssp.eval.prototype, $.physicals.Neil);
$.jssp.compile_ = function compile_(src) {
/* Compile JavaScript Server Page srouce and return the translated source
* if successful. It is left to the caller to pass the resulting source
* code to the Function constructor.
*
* Arguments:
* - src: string - the JSSP source code.
* Returns: string - the JavaScript generated from src.
*/
if (typeof src !== 'string') {
throw new TypeError('src must be a string');
}
var tokens = src.trim().split(/(<%(?:--|:|=)?|(?:--)?%>)/);
var code = [
'// DO NOT EDIT THIS CODE: AUTOMATICALLY GENERATED BY JSSP ' +
compile_.lastModifiedTime + '.',
];
var STATES = {
LITERAL: 0,
STATEMENT: 1,
EXPRESSION: 2,
EXPRESSION_ESCAPED: 3,
COMMENT: 4
};
var state = STATES.LITERAL;
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (!token) {
continue; // Empty string caused by splitting adjacent tags.
}
switch (state) {
case STATES.LITERAL:
if (token === '<%') {
state = STATES.STATEMENT;
} else if (token === '<%=') {
state = STATES.EXPRESSION;
} else if (token === '<%:') {
state = STATES.EXPRESSION_ESCAPED;
} else if (token === '<%--') {
state = STATES.COMMENT;
} else {
code.push('response.write(' + JSON.stringify(token) + ');');
}
break;
case STATES.STATEMENT:
if (token === '%>') {
state = STATES.LITERAL;
} else {
code.push(token);
}
break;
case STATES.EXPRESSION:
case STATES.EXPRESSION_ESCAPED:
if (token === '%>') {
state = STATES.LITERAL;
} else {
token = token.trim();
if (token) {
code.push();
if (state === STATES.EXPRESSION_ESCAPED) {
code.push('response.writeEscaped(' + token + ');');
} else {
code.push('response.write(' + token + ');');
}
}
}
break;
case STATES.COMMENT:
if (token === '--%>') {
state = STATES.LITERAL;
}
break;
}
}
if (state !== STATES.LITERAL) {
throw new SyntaxError('unclosed JSSP tag');
}
return code.join('\n') + '\n';
};
Object.setOwnerOf($.jssp.compile_, $.physicals.Neil);
Object.setOwnerOf($.jssp.compile_.prototype, $.physicals.Maximilian);
================================================
FILE: core/core_22_$.connection.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Connection object for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.connection = {};
$.connection.onConnect = function onConnect() {
this.connectTime = Date.now();
this.user = null;
this.buffer = '';
this.connected = true;
};
Object.setOwnerOf($.connection.onConnect, $.physicals.Maximilian);
Object.setOwnerOf($.connection.onConnect.prototype, $.physicals.Maximilian);
$.connection.onReceive = function onReceive(text) {
this.buffer += text.replace(/\r/g, '');
var lf;
while ((lf = this.buffer.indexOf('\n')) !== -1) {
var line = this.buffer.substring(0, lf);
this.buffer = this.buffer.substring(lf + 1);
this.onReceiveLine(line);
}
};
Object.setOwnerOf($.connection.onReceive, $.physicals.Maximilian);
$.connection.onReceiveLine = function onReceiveLine(text) {
// Override this on child classes.
};
Object.setOwnerOf($.connection.onReceiveLine, $.physicals.Maximilian);
$.connection.onEnd = function onEnd() {
this.connected = false;
this.disconnectTime = Date.now();
this.close();
};
Object.setOwnerOf($.connection.onEnd, $.physicals.Maximilian);
$.connection.write = function write(text) {
$.system.connectionWrite(this, text);
};
Object.setOwnerOf($.connection.write, $.physicals.Maximilian);
$.connection.close = function close() {
$.system.connectionClose(this);
};
Object.setOwnerOf($.connection.close, $.physicals.Maximilian);
$.connection.onError = function onError(error) {
// TODO: add check for error that occurs when relistening
// fails when restarting server from checkpoint.
if (error.message === 'write after end' ||
error.message === 'This socket has been ended by the other party') {
this.connected = false;
}
};
Object.setOwnerOf($.connection.onError, $.physicals.Maximilian);
================================================
FILE: core/core_23_$.servers.http.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Webserver for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.utils.url = {};
Object.setOwnerOf($.utils.url, $.physicals.Maximilian);
$.utils.url.regexps = {};
$.utils.url.regexps.README = '$.utils.url.regexps contains some RegExps useful for parsing or otherwise analysing URLs.\n\nSee ._generate() for how they are constructed and what they will match.';
$.utils.url.regexps._generate = function _generate() {
/* Generate some RegExps that match various parts of URLs. The
* intention is that these regular expressions conform to the
* grammar given in RFC 3986, "Uniform Resource Identifier (URI):
* Generic Syntax" (https://tools.ietf.org/html/rfc3986).
*
* TODO: add tests for generated RegExps.
*/
////////////////////////////////////////////////////////////////////
// IPv4 Addresses.
// Based on https://stackoverflow.com/a/14453696/4969945
// Matches an octet, optionally with leading zeros.
var octet = '(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})';
// Matches an octet without no leading zeros.
var octetStrict = '(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])';
// Globally matches IPv4 addresses, optionally with leading zeros.
this.ipv4Address = new RegExp(octet + '(?:\\.' + octet + '){3}', 'g');
// Globally matches IPv4 addresses with no leading zeros.
this.ipv4AddressStrict =
new RegExp(octetStrict + '(?:\\.' + octetStrict + '){3}', 'g');
////////////////////////////////////////////////////////////////////
// IPv6 Addresses.
// Based on https://stackoverflow.com/a/17871737/4969945 but modified
// to reduce ambiguity match more greedily when unanchored.
// Matches a 32-bit hex value as it can appear in an IPv6 address.
var word = '[0-9a-fA-F]{1,4}';
// Matches an IPv4 address as it can appear in an IPv6 address.
var ipv4 = this.ipv4AddressStrict.source;
// Globally matches a valid IPv6 address.
this.ipv6Address = new RegExp(
'(?:' +
'[fF][eE]80:(?::' + word + '){0,4}%[0-9a-zA-Z]+|' + // fe80::7:8%eth0 fe80::7:8%1 (link-local IPv6 addresses with zone index)
'(?:' + word + ':){1,4}:' + ipv4 + '|' + // 2001:db8:3:4::192.0.2.33 64:ff9b::192.0.2.33 (IPv4-Embedded IPv6 Address)
'(?:' + word + ':){7}' + word + '|' + // 1:2:3:4:5:6:7:8
'(?:' + word + ':){6}(?::' + word + '){1,1}|' + // 1:2:3:4:5:6::8 ... 1:2:3:4:5:6::8
'(?:' + word + ':){5}(?::' + word + '){1,2}|' + // 1:2:3:4:5::8 ... 1:2:3:4:5::7:8
'(?:' + word + ':){4}(?::' + word + '){1,3}|' + // 1:2:3:4::8 ... 1:2:3:4::6:7:8
'(?:' + word + ':){3}(?::' + word + '){1,4}|' + // 1:2:3::8 ... 1:2:3::5:6:7:8
'(?:' + word + ':){2}(?::' + word + '){1,5}|' + // 1:2::8 ... 1:2::4:5:6:7:8
'(?:' + word + ':){1}(?::' + word + '){1,6}|' + // 1::8 ... 1::3:4:5:6:7:8
'(?:' + word + ':){1,7}:|' + // 1:: ... 1:2:3:4:5:6:7::
'::(?:[fF]{4}(?::0{1,4})?:)?' + ipv4 + '|' + // ::255.255.255.255 ::ffff:255.255.255.255 ::ffff:0:255.255.255.255 (IPv4-mapped IPv6 addresses and IPv4-translated addresses)
':(?::' + word + '){1,7}|' + // ::8 ... ::2:3:4:5:6:7:8
'::' + // ::
')', 'g');
////////////////////////////////////////////////////////////////////
// DNS Domain Names.
// Matches a label (per RFC 952, updated by RFC 1123 to allow a
// it to begin with a digit), limited to 63 charcters (per RFC 1035).
var label = '[a-zA-Z0-9][a-zA-Z0-9-]{0,62}';
// Globally matches a legal (but not necessary valid!) DNS name.
// See also https://stackoverflow.com/q/106179/4969945 .
// BUG: does not limit length of name to ca. 253 characters (see
// https://devblogs.microsoft.com/oldnewthing/20120412-00/?p=7873
// for gory details).
this.dnsAddress = new RegExp(label + '(?:\\.' + label + ')*', 'g');
////////////////////////////////////////////////////////////////////
// Authority section
// Globally matches a valid IP address (v4 or v6).
this.ipAddress = new RegExp(
this.ipv4Address.source + '|\\[' + this.ipv6Address.source + '\\]', 'g');
// Globally matches a valid URL authority section (e.g. domain name
// and port); this is (not coincidentally) also the same as a valid
// HTTP Host: header value.
//
// The RegExp includes capture groups for an IP address [1] *or* a
// DNS address [2], and (optionally) a port number [3].
this.authority = new RegExp(
'(?:(' + this.ipAddress.source + ')|' +
'(' + this.dnsAddress.source + '))' +
'(?::([0-9]+))?', 'g'); // Optional port number.
////////////////////////////////////////////////////////////////////
// Exact forms of the above. These do not get the global flag.
var keys = ['ipv4Address', 'ipv4AddressStrict', 'ipv6Address',
'dnsAddress', 'ipAddress', 'authority'];
for (var key, i = 0; (key = keys[i]); i++) {
this[key + 'Exact'] = new RegExp('^' + this[key].source + '$');
}
};
Object.setOwnerOf($.utils.url.regexps._generate.prototype, $.physicals.Maximilian);
$.utils.url.regexps.ipv4Address = /(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}/g;
$.utils.url.regexps.ipv4AddressStrict = /(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}/g;
$.utils.url.regexps.ipv6Address = /(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)/g;
$.utils.url.regexps.dnsAddress = /[a-zA-Z0-9][a-zA-Z0-9-]{0,62}(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,62})*/g;
$.utils.url.regexps.ipAddress = /(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}|\[(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)\]/g;
$.utils.url.regexps.authority = /(?:((?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}|\[(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)\])|([a-zA-Z0-9][a-zA-Z0-9-]{0,62}(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,62})*))(?::([0-9]+))?/g;
$.utils.url.regexps.ipv4AddressExact = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}$/;
$.utils.url.regexps.ipv4AddressStrictExact = /^(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}$/;
$.utils.url.regexps.ipv6AddressExact = /^(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)$/;
$.utils.url.regexps.dnsAddressExact = /^[a-zA-Z0-9][a-zA-Z0-9-]{0,62}(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,62})*$/;
$.utils.url.regexps.ipAddressExact = /^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}|\[(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)\]$/;
$.utils.url.regexps.authorityExact = /^(?:((?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})){3}|\[(?:[fF][eE]80:(?::[0-9a-fA-F]{1,4}){0,4}%[0-9a-zA-Z]+|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){6}(?::[0-9a-fA-F]{1,4}){1,1}|(?:[0-9a-fA-F]{1,4}:){5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){2}(?::[0-9a-fA-F]{1,4}){1,5}|(?:[0-9a-fA-F]{1,4}:){1}(?::[0-9a-fA-F]{1,4}){1,6}|(?:[0-9a-fA-F]{1,4}:){1,7}:|::(?:[fF]{4}(?::0{1,4})?:)?(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])(?:\.(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9])?[0-9])){3}|:(?::[0-9a-fA-F]{1,4}){1,7}|::)\])|([a-zA-Z0-9][a-zA-Z0-9-]{0,62}(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,62})*))(?::([0-9]+))?$/;
$.servers.http = {};
$.servers.http.STATUS_CODES = (new 'Object.create')(null);
$.servers.http.STATUS_CODES[100] = 'Continue';
$.servers.http.STATUS_CODES[101] = 'Switching Protocols';
$.servers.http.STATUS_CODES[102] = 'Processing';
$.servers.http.STATUS_CODES[200] = 'OK';
$.servers.http.STATUS_CODES[201] = 'Created';
$.servers.http.STATUS_CODES[202] = 'Accepted';
$.servers.http.STATUS_CODES[203] = 'Non-Authoritative Information';
$.servers.http.STATUS_CODES[204] = 'No Content';
$.servers.http.STATUS_CODES[205] = 'Reset Content';
$.servers.http.STATUS_CODES[206] = 'Partial Content';
$.servers.http.STATUS_CODES[207] = 'Multi-Status';
$.servers.http.STATUS_CODES[208] = 'Already Reported';
$.servers.http.STATUS_CODES[226] = 'IM Used';
$.servers.http.STATUS_CODES[300] = 'Multiple Choices';
$.servers.http.STATUS_CODES[301] = 'Moved Permanently';
$.servers.http.STATUS_CODES[302] = 'Found';
$.servers.http.STATUS_CODES[303] = 'See Other';
$.servers.http.STATUS_CODES[304] = 'Not Modified';
$.servers.http.STATUS_CODES[305] = 'Use Proxy';
$.servers.http.STATUS_CODES[306] = 'Switch Proxy';
$.servers.http.STATUS_CODES[307] = 'Temporary Redirect';
$.servers.http.STATUS_CODES[308] = 'Permanent Redirect';
$.servers.http.STATUS_CODES[400] = 'Bad Request';
$.servers.http.STATUS_CODES[401] = 'Unauthorized';
$.servers.http.STATUS_CODES[402] = 'Payment Required';
$.servers.http.STATUS_CODES[403] = 'Forbidden';
$.servers.http.STATUS_CODES[404] = 'Not Found';
$.servers.http.STATUS_CODES[405] = 'Method Not Allowed';
$.servers.http.STATUS_CODES[406] = 'Not Acceptable';
$.servers.http.STATUS_CODES[407] = 'Proxy Authentication Required';
$.servers.http.STATUS_CODES[408] = 'Request Timeout';
$.servers.http.STATUS_CODES[409] = 'Conflict';
$.servers.http.STATUS_CODES[410] = 'Gone';
$.servers.http.STATUS_CODES[411] = 'Length Required';
$.servers.http.STATUS_CODES[412] = 'Precondition Failed';
$.servers.http.STATUS_CODES[413] = 'Payload Too Large';
$.servers.http.STATUS_CODES[414] = 'URI Too Long';
$.servers.http.STATUS_CODES[415] = 'Unsupported Media Type';
$.servers.http.STATUS_CODES[416] = 'Range Not Satisfiable';
$.servers.http.STATUS_CODES[417] = 'Expectation Failed';
$.servers.http.STATUS_CODES[418] = "I'm a teapot";
$.servers.http.STATUS_CODES[421] = 'Misdirected Request';
$.servers.http.STATUS_CODES[422] = 'Unprocessable Entity';
$.servers.http.STATUS_CODES[423] = 'Locked';
$.servers.http.STATUS_CODES[424] = 'Failed Dependency';
$.servers.http.STATUS_CODES[426] = 'Upgrade Required';
$.servers.http.STATUS_CODES[428] = 'Precondition Required';
$.servers.http.STATUS_CODES[429] = 'Too Many Requests';
$.servers.http.STATUS_CODES[431] = 'Request Header Fields Too Large';
$.servers.http.STATUS_CODES[451] = 'Unavailable For Legal Reasons';
$.servers.http.STATUS_CODES[500] = 'Internal Server Error';
$.servers.http.STATUS_CODES[501] = 'Not Implemented';
$.servers.http.STATUS_CODES[502] = 'Bad Gateway';
$.servers.http.STATUS_CODES[503] = 'Service Unavailable';
$.servers.http.STATUS_CODES[504] = 'Gateway Timeout';
$.servers.http.STATUS_CODES[505] = 'HTTP Version Not Supported';
$.servers.http.STATUS_CODES[506] = 'Variant Also Negotiates';
$.servers.http.STATUS_CODES[507] = 'Insufficient Storage';
$.servers.http.STATUS_CODES[508] = 'Loop Detected';
$.servers.http.STATUS_CODES[510] = 'Not Extended';
$.servers.http.STATUS_CODES[511] = 'Network Authentication Required';
$.servers.http.connection = (new 'Object.create')($.connection);
$.servers.http.connection.onConnect = function onConnect() {
$.connection.onConnect.apply(this, arguments);
this.timeout = setTimeout(this.close.bind(this), 60 * 1000);
this.request = new $.servers.http.Request();
this.response = new $.servers.http.Response(this);
};
Object.setOwnerOf($.servers.http.connection.onConnect, $.physicals.Maximilian);
$.servers.http.connection.onReceive = function onReceive(data) {
this.buffer += data;
var lf;
// Start in line-delimited mode, parsing HTTP headers.
while ((lf = this.buffer.indexOf('\n')) !== -1) {
try {
this.onReceiveChunk(this.buffer.substring(0, lf + 1));
} finally {
this.buffer = this.buffer.substring(lf + 1);
}
}
if (this.request.state_ === 'body') {
// Waiting for POST data, not line-delimited.
this.onReceiveChunk(this.buffer);
this.buffer = '';
}
};
Object.setOwnerOf($.servers.http.connection.onReceive, $.physicals.Neil);
$.servers.http.connection.onReceiveChunk = function onReceiveChunk(chunk) {
if (this.request.parse(chunk)) {
$.servers.http.onRequest(this);
}
// Otherwise wait for more lines to arrive.
};
Object.setOwnerOf($.servers.http.connection.onReceiveChunk, $.physicals.Maximilian);
$.servers.http.connection.onEnd = function onEnd() {
clearTimeout(this.timeout);
$.connection.onEnd.apply(this, arguments);
};
Object.setOwnerOf($.servers.http.connection.onEnd, $.physicals.Neil);
$.servers.http.Request = function Request() {
this.headers = Object.create(null);
this.headers.cookie = Object.create(null);
this.parameters = Object.create(null);
// One of 'invalid', 'request', 'headers', 'body', 'done'.
this.state_ = 'request';
};
Object.setOwnerOf($.servers.http.Request, $.physicals.Maximilian);
$.servers.http.Request.prototype.parse = function parse(line) {
// Returns true if parsing is complete, false if more lines are needed.
if (this.state_ === 'request') {
// Match "GET /images/logo.png HTTP/1.1"
line = line.trim();
var m = line.match(/^(GET|POST) +(\S+)/);
if (!m) {
$.system.log('Unrecognized WWW request line:', line);
this.state_ = 'invalid';
return true;
}
this.method = m[1];
this.url = m[2];
this.parseUrl_(this.url);
this.state_ = 'headers';
return false;
}
if (this.state_ === 'headers') {
line = line.trim();
if (!line) { // Done parsing headers.
if (this.method === 'POST') {
this.state_ = 'body';
this.data = '';
return false;
} else {
this.parseParameters_(this.query);
this.state_ = 'done';
this.data = undefined;
return true;
}
}
var m = line.match(/^([-\w]+): +(.+)$/);
if (!m) {
$.system.log('Unrecognized WWW header line:', line);
return false;
}
var name = m[1].toLowerCase();
var value = m[2];
var existing = this.headers[name];
if (name === 'cookie') {
// Cookies are processed and presented as: request.headers.cookie.foo
var cookies = value.split(/\s*;\s*/);
for (var i = 0; i < cookies.length; i++) {
var eqIndex = cookies[i].indexOf('=');
if (eqIndex !== -1) {
var cookieName = cookies[i].substring(0, eqIndex);
var cookieValue = cookies[i].substring(eqIndex + 1);
if (cookieName === 'ID') {
// Special-case the 'ID' cookie for user login.
// Do not expose this ID string to anyone.
this.user = $.userDatabase.get(cookieValue);
} else {
// Regular cookie.
existing[cookieName] = cookieValue;
}
}
}
value = existing;
} else if (name in this.headers) {
if ($.servers.http.IncomingMessage.discardDuplicates.includes(name)) {
// Discard this duplicate.
value = existing;
} else {
// Append this header onto previously defined header.
value = existing + ', ' + value;
}
}
this.headers[name] = value;
return false;
}
if (this.state_ === 'body') {
// POST data.
this.data += line;
if (this.data.length >= this.headers['content-length']) {
this.parseParameters_(this.data);
this.state_ = 'done';
return true;
}
return false;
}
// Invalid state? Extra lines? Ignore.
return true;
};
Object.setOwnerOf($.servers.http.Request.prototype.parse, $.physicals.Neil);
$.servers.http.Request.prototype.parseUrl_ = function parseUrl_(url) {
/* Parse a URL and set this.path and this.query as appropriate:
*
* E.g. given url = '/bar/baz?data', set:
* - this.path = '/bar/baz'
* - this.query = 'data'
*
* Arguments:
* - url: string - the URL to parse.
*
* TODO(cpcallen): add check for leading "/"?
*/
var qIndex = url.indexOf('?');
if (qIndex === -1) {
this.path = url;
} else {
this.path = url.substring(0, qIndex);
this.query = url.substring(qIndex + 1);
}
};
Object.setOwnerOf($.servers.http.Request.prototype.parseUrl_, $.physicals.Maximilian);
$.servers.http.Request.prototype.parseParameters_ = function parseParameters_(data) {
if (!data) {
return;
}
var vars = data.split('&');
var name, value;
for (var i = 0; i < vars.length; i++) {
var eqIndex = vars[i].indexOf('=');
if (eqIndex === -1) {
name = vars[i];
value = true;
} else {
name = vars[i].substring(0, eqIndex);
value = vars[i].substring(eqIndex + 1);
value = decodeURIComponent(value.replace(/\+/g, ' '));
}
if (name in this.parameters) {
// ?foo=1&foo=2&foo=3
var array = this.parameters[name];
if (!Array.isArray(array)) {
array = [array];
}
array.push(value);
value = array;
}
this.parameters[name] = value;
}
};
Object.setOwnerOf($.servers.http.Request.prototype.parseParameters_, $.physicals.Neil);
$.servers.http.Request.prototype.fromSameOrigin = function fromSameOrigin() {
/* Determines if the previous page and the requested page are from the same
* origin. Normally this means that they are from the same subdomain.
* However, if pathToSubdomain is enabled then the first directory name
* is used for comparison.
*
* Return: boolean | undefined - true if from the same origin, false if
* from different origins, and undefined if missing headers prevent a
* firm conclusion one way or the other.
*
* Callers should choose whether to fail-safe or fail-deadly when the
* user's proxy strips the referer header, resulting in undefined.
*
* BUG: if referer was for subdomain routed via a root Host with
* .pathToSubdomain enabled, but .origin is for the root domain,
* fromSameOrigin will return true. This is not intended and possibly
* insecure - but probably mostly harmless: if .pathToSubdomain is
* enabled subdomains are not really secure against each other anyway.
*/
var referer = this.headers.referer; // https://foo.example.codecity.world/bar
if (!referer || !this.info) {
// Missing headers. Not enough information to know.
return undefined;
}
var origin = this.info.origin; // foo.example.codecity.world
var regexp = new RegExp('^https?://' + $.utils.regexp.escape(origin) + '/');
return regexp.test(referer);
};
Object.setOwnerOf($.servers.http.Request.prototype.fromSameOrigin, $.physicals.Maximilian);
$.servers.http.Request.prototype.hostUrl = function hostUrl(varArgs) {
/* Return the base URL for the host that handled this Request, or
* a subdomain (omitting scheme). This is derived from .headers.host,
* but with some extra magic:
*
* - Absent any argument, it will be the URL which routes to the root
* Host object serving this Request - e.g., //example.codecity.world/
* The "root" host is ordinarily just first of $.servers.http.hosts[]
* to accept the request (as opposed to one of its .subdomains).
* - If an argument is supplied, the returned URL will instead be for
* the named subdomain.
* - Multiple arguments can be supplied if there are nested subdomains.
*
* E.g.:
* request.hostUrl() => '//example.codecity.world/'
* request.hostUrl('code') => '//code.example.codecity.world/'
* request.hostUrl('foo', 'bar') => '//foo.bar.example.codecity.world/'
*
* If .pathToSubdomain is enabled on one or more Host object(s):
* request.hostUrl('code') => '//example.codecity.world/code/'
* request.hostUrl('foo', 'bar') => '//example.codecity.world/foo/bar/'
* or: '//bar.example.codecity.world/foo/'
*
* Barring bugs, the returned URL should always end with a '/'.
*
* See also $.servers.http.Host.prototype.url for cases where you need
* to generate a host URL without an incoming Request to use as reference.
*
* Arguments:
* - subdomain: string - a string denoting a subdomain of interest.
* Multiple arguments are allowed. RangeError is thrown if no such
* subdomain exists.
* Returns: string - the URL for the desired domain/subdomain.
*/
// No routing information is available? Fallback to $hosts.root.url().
if (!this.info) {
var rootHost = $.hosts.root;
return rootHost.url.apply(rootHost, arguments);
}
// Walk the tree of Hosts rooted at the root Host via which this
// Request was served.
var host = this.info.rootHost;
var authority = this.info.rootAuthority;
// Did nginx request pathToSubdomain, because it knows that it is not
// configured for real wildcard subdomains? (N.B.: header uses the
// RFC 8941 convention of "?1" for true, "?0" for false.)
var pathToSubdomainHeader =
(this.headers['codecity-pathtosubdomain'] === '?1');
for (var subdomain, i = 0; (subdomain = arguments[i]); i++) {
authority = host.urlForSubdomain(authority, subdomain, pathToSubdomainHeader);
host = host.subdomains[subdomain];
}
return '//' + authority + '/';
};
Object.setOwnerOf($.servers.http.Request.prototype.hostUrl, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Request.prototype.hostUrl.prototype, $.physicals.Maximilian);
$.servers.http.Request.discardDuplicates = [];
$.servers.http.Request.discardDuplicates[0] = 'authorization';
$.servers.http.Request.discardDuplicates[1] = 'content-length';
$.servers.http.Request.discardDuplicates[2] = 'content-type';
$.servers.http.Request.discardDuplicates[3] = 'from';
$.servers.http.Request.discardDuplicates[4] = 'host';
$.servers.http.Request.discardDuplicates[5] = 'if-modified-since';
$.servers.http.Request.discardDuplicates[6] = 'if-unmodified-since';
$.servers.http.Request.discardDuplicates[7] = 'max-forwards';
$.servers.http.Request.discardDuplicates[8] = 'proxy-authorization';
$.servers.http.Request.discardDuplicates[9] = 'referer';
$.servers.http.Request.discardDuplicates[10] = 'user-agent';
$.servers.http.Response = function Response(connection) {
this.headersSent = false;
this.statusCode = 200;
this.headers_ = Object.create(Response.defaultHeaders);
this.cookies = [];
this.setHeader('content-type', 'text/html; charset=utf-8');
this.connection_ = connection;
};
Object.setOwnerOf($.servers.http.Response, $.physicals.Maximilian);
$.servers.http.Response.prototype.setHeader = function setHeader(name, value) {
if (this.headersSent) {
throw new Error('header already sent');
}
value = String(value).trim();
if (value.includes('\n') || value.includes('\r')) {
throw new RangeError('invalid header value');
}
// Normalize all header names as lowercase.
name = String(name).toLowerCase(name);
if (name === 'set-cookie') {
if (/^\s*ID\s*=/.test(value)) {
throw new PermissionError('not allowed to set ID cookie');
}
this.cookies.push(value);
} else {
var existing = Object.getOwnPropertyDescriptor(this.headers_, name);
if (existing) { // Header already set for this Response specifically.
if ($.servers.http.Response.discardDuplicates.includes(name)) {
// Overwrite existing value.
} else {
// Append this header onto previously defined header.
value = existing.value + ', ' + value;
}
}
this.headers_[name] = value;
}
};
Object.setOwnerOf($.servers.http.Response.prototype.setHeader, $.physicals.Maximilian);
$.servers.http.Response.prototype.writeHead = function writeHead() {
if (this.headersSent) {
throw new Error('Header already sent.');
}
this.headersSent = true;
var statusMessage = $.servers.http.STATUS_CODES[this.statusCode] || 'Unknown';
this.connection_.write('HTTP/1.0 ' + this.statusCode + ' ' + statusMessage +
'\r\n');
for (var name in this.headers_) {
// Print all header names as Title-Case.
var title = name.replace(/\w+/g, $.utils.string.capitalize);
this.connection_.write(title + ': ' + this.headers_[name] + '\r\n');
}
for (var i = 0; i < this.cookies.length; i++) {
// Print all cookies.
this.connection_.write('Set-Cookie: ' + this.cookies[i] + '\r\n');
}
this.connection_.write('\r\n');
};
Object.setOwnerOf($.servers.http.Response.prototype.writeHead, $.physicals.Maximilian);
$.servers.http.Response.prototype.setStatus = function setStatus(statusCode) {
/* Set the status code for this Response.
* Must be called before .writeHead().
*
* - statusCode: number - the HTTP status code to return.
*/
if (!(statusCode in $.servers.http.STATUS_CODES)) {
throw new RangeError('invalid HTTP status code ' + statusCode);
}
if (this.headersSent) {
throw new Error('header already sent.');
}
this.statusCode = statusCode;
};
Object.setOwnerOf($.servers.http.Response.prototype.setStatus, $.physicals.Maximilian);
$.servers.http.Response.prototype.write = function write(text) {
text = String(text);
if (text !== '') {
if (!this.headersSent) {
this.writeHead();
}
this.connection_.write(text);
}
};
Object.setOwnerOf($.servers.http.Response.prototype.write, $.physicals.Neil);
$.servers.http.Response.prototype.clearIdCookie = function clearIdCookie() {
// TODO: Security check goes here. Should be only callable by logout.
if (this.headersSent) {
throw new Error('Header already sent');
}
var request = this.connection_.request;
// Guess cookie domain.
var rootHost =
(request.info && request.info.rootAuthority) || // Request rootAuthority.
request.headers.host || // Actual Host: header value for the request.
$.hosts.root.hostname; // Configuerd hostname
var domain = rootHost ? ' Domain=' + rootHost.replace(/:\d+$/, '') : ''; // Remove port number.
var value = 'ID=; HttpOnly;' + domain + '; Path=/; Max-Age=0;';
this.cookies.push(value);
};
Object.setOwnerOf($.servers.http.Response.prototype.clearIdCookie, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Response.prototype.clearIdCookie.prototype, $.physicals.Neil);
$.servers.http.Response.prototype.sendRedirect = function sendRedirect(url, statusCode) {
/* Write a redirect as the response.
*
* Must be called before writeHeader has been called.
*
* Arguments:
* - url: string - the destination URL for the redirect.
* - statusCode?: number - optional HTTP status code (default: 303 See Other).
*/
if (!statusCode) statusCode = 303;
this.setStatus(statusCode);
this.setHeader('Location', url);
this.writeHead();
};
Object.setOwnerOf($.servers.http.Response.prototype.sendRedirect, $.physicals.Neil);
Object.setOwnerOf($.servers.http.Response.prototype.sendRedirect.prototype, $.physicals.Maximilian);
$.servers.http.Response.prototype.sendError = function sendError(statusCode, message) {
/* Send an error status and page as the response.
*
* Must be called before writeHeader has been called. Writes a complete HTML
* document to the connection, but doesn't close the connection.
*
* Arguments:
* - statusCode: number - an HTTP status code.
* - message?: string | Error - optional status message or Error instance.
*/
this.setStatus(statusCode);
if (message instanceof Error) {
this.errorMessage_ = $.utils.html.escape(String(message)) +
'<pre>' + $.utils.html.escape(message.stack) + '</pre>';
} else if (message !== undefined) {
this.errorMessage_ = $.utils.html.escape(message);
} else {
this.errorMessage_ = '';
}
$.jssp.eval(this, 'sendErrorJssp', this.connection_.request, this);
};
Object.setOwnerOf($.servers.http.Response.prototype.sendError, $.physicals.Neil);
Object.setOwnerOf($.servers.http.Response.prototype.sendError.prototype, $.physicals.Maximilian);
$.servers.http.Response.prototype.sendErrorJssp = '<% try {var staticUrl = request.hostUrl(\'static\');} catch(e) {staticUrl = \'\';} %>\n<html>\n<head>\n <title><%= response.statusCode %> - Code City</title>\n <style>\n body {\n font-family: "Roboto Mono", monospace;\n text-align: center;\n }\n h1 {\n font-size: 40pt;\n font-weight: 100;\n }\n h1>img {\n vertical-align: text-bottom;\n }\n pre {\n margin: 2em;\n }\n </style>\n <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">\n <link href="<%=staticUrl%>favicon.ico" rel="shortcut icon">\n</head>\n<body>\n <h1>\n <img src="<%=staticUrl%>logo-error.svg" alt="">\n <%= response.statusCode %> <%= $.servers.http.STATUS_CODES[response.statusCode] %>\n </h1>\n <pre>Host: <%: request.headers.host %>\n<%= request.method %> <%: request.url %></pre>\n <%= response.errorMessage_ %>\n</body>\n</html>';
$.servers.http.Response.prototype.writeEscaped = $.jssp.OutputBuffer.prototype.writeEscaped;
$.servers.http.Response.discardDuplicates = [];
$.servers.http.Response.discardDuplicates[0] = 'age';
$.servers.http.Response.discardDuplicates[1] = 'content-length';
$.servers.http.Response.discardDuplicates[2] = 'content-type';
$.servers.http.Response.discardDuplicates[3] = 'etag';
$.servers.http.Response.discardDuplicates[4] = 'expires';
$.servers.http.Response.discardDuplicates[5] = 'last-modified';
$.servers.http.Response.discardDuplicates[6] = 'location';
$.servers.http.Response.discardDuplicates[7] = 'retry-after';
$.servers.http.Response.defaultHeaders = (new 'Object.create')(null);
$.servers.http.Response.defaultHeaders['cache-control'] = 'no-store';
$.servers.http.Response.defaultHeaders.server = 'CodeCity/0.0 ($.servers.http)';
$.servers.http.Host = function Host() {
/* A Host object represents a domain or subdomain served by the
* web server. It is expected that most Host instances will be
* the values of properties of $.hosts.
*
* Methods on Host.prototype (see individual methodd documentation
* for details):
*
* - .addSubdomain() - add a new subdomain to .subdomains.
* - .handle() - try to have this host handle an incoming request.
* - .url() - return the URL for this host.
* - .urlForSubdomain() - a helper method for .url().
*
* Instance properties of Host objects (by default these all
* inherit their default values from Host.prototype):
*
* - access: string - Access control switch. It has the following
* possible values:
*
* - 'public': The host will by default serve pages to any client
* unless the handler object has .wwwAccess === 'private', in
* which case it will only be served to logged-in users.
* Unauthenticated clients will get 403 forbidden and be
* directed to login.
*
* - 'private': The host will by default only serve pages to
* logged-in users unless the hander object has .wwwAccess ===
* 'public'.
*
* - 'hidden': The host will only serve pages to logged-in users;
* any unauthenticated client will be declined (by .handle
* returning false) which will normally result in them recieving
* a 400 Unknown Host error.
*
* - hostname: string | undefined - the canonical hostname for
* this Host object. Should include the port number, if non-default.
*
* If .hostRegExp (see below) is undefined, .hostname will be used to
* decide which Requests to handle:
*
* - This host object will serve requests whose Host: header exactly
* matches .hostname itself.
* - It will pass requests whose Host: header ends with .hostname to
* the corresponding subdomain, if it exists.
*
* E.g., if .hostname = 'bar.baz', this host will serve requests for
* bar.baz and will pass requests for foo.bar.baz to .subdomains.foo
* but will reject requests for bar.baz:8080.
*
* If both .hostname and .hostRegExp are undefined, all requests will
* be served by this host or automagically passed along to a suitable
* subdomain.
*
* - hostRegExp: RegExp | undefined - a RegExp matching Host: header
* values this host should respond to. If undefined (the default),
* this .hostname (see above) will be used instead.
*
* Note that when the Host is deciding whether to serve a Request
* itself, this regexp will be treated as if it begins with /^/,
* while when the Host is trying to determine if it should be passed
* off to a subdomain it will treat it as if it begins with /(?<=\.)/
* (despite ES5.1 not supporting such look-behind assertions).
*
* This means that .hostRegExp = /bar.baz$/ will cause this Host object
* to serve 'bar.baz' and try to pass 'foo.bar.baz' to .subdomains.foo,
* but will always reject 'foobar.baz'. Anchoring with /^/ will
* prevent subdomain matching, so don't do that if you don't mean to!
*
* It's recommended that .hostRegExp be anchored with /$/, but note
* that if you want to serve pages on a non-standard ports you must
* match the port as well - e.g.: /example\.codecity\.\w+(?::\d+)$/
* will match example.codecity.<any TLD> with or without a port number.
*
* - pathToSubdomain: boolean | undefined - enable (or disable) mapping
* the first element (directory) of request paths to a subdomain.
*
* If set to undefined, the CodeCity-pathToSubdomain header will be
* used to determine decide whether to do this mapping on a
* per-request basis (but normally this header will be configured
* staticaly in the nginx reverse-proxy configuration).
*
* The CodeCity-pathToSubdomain header will be interpreted according
* to the RFC 8941 Structure Field Values convention, with '?1'
* meaning true and '?0' meaning false. Any other value will be
* treated as false.
*
* - subdomains: Object<string, Host> | null - a null-prototype
* object mapping subdomain names to their respective Host objects,
* or just null if there are no subdomains. Use .addSubdomain to
* add entries to this mapping. (Default: null.)
*/
};
Object.setOwnerOf($.servers.http.Host, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.handle = function handle(request, response, info) {
/* Attempt to handle an http(s) request. First tries to see if the
* request can be served by the Host object of a direct subdomain
* of this Host, then tries to handle itself, then, if
* this.pseudoSubdomains is enabled, attempts to route the request
* to a subdomain Host based on the first component of the path.
*
* Arguments:
* - request: $.servers.http.Request - the incoming request to handle.
* - response: $.servers.http.Response - the response to write to.
* - info: Object | undefined - some information used by recursive calls to
* this function.
* Returns: boolean - true iff request was for this host.
*/
if (!info) {
// Extact detailed routing info from request.
var hostHeader = request.headers.host;
info = {
origin: hostHeader, // For Request.prototype.fromSameOrigin.
path: request.path,
rootHost: this,
};
// The authorityExact RegExp gives submatches [ipAddress, dnsAddress,
// port]. Only one of the addresses capture groups will match.
var m = $.utils.url.regexps.authorityExact.exec(hostHeader);
if (!m) { // Invalid Host header.
response.sendError(400, 'Invalid Host header.');
return true; // We don't want it, but no one else should either.
} else if (m[1]) { // It's an IP address. No (real) subdomains possible.
info.rootAuthority = info.authority = hostHeader;
} else if (this.hostRegExp || this.hostname) {
var hostRegExp = this.hostRegExp ? this.hostRegExp :
new RegExp($.utils.regexp.escape(this.hostname) + '$')
// We have a .hostname or .hostRegExp, and can work out if there is a
// subdomain prefixed to request.headers.host from that.
m = hostRegExp.exec(hostHeader);
if (!m) return false; // Did not match. Not for us.
// Apply a check equivalent to a /(?<=^|\.)/ look-behind assertion.
if (m.index > 0) {
if (hostHeader[m.index - 1] !== '.') return false; // Lookbehind failed.
// Record subdomain(s) that need to be matched.
info.subdomains = hostHeader.slice(0, m.index - 1).split('.');
}
info.rootAuthority = info.authority = hostHeader.slice(m.index);
} else {
// Try to guess where the subdomain(s) end and the root hostname begins.
// To deal correclty with cases like x.x.y.z and x.y.x.y.z, be
// pessimistic and assume they're all subdomains to start with.
var potentialSubdomains = hostHeader.split('.');
info.rootAuthority = info.authority = potentialSubdomains.pop(); // TLD can't be subdomain!
for (var i = potentialSubdomains.length; i >= 0; i--) {
info.subdomains = potentialSubdomains.slice(0, i);
var r = this.handle(request, response, info);
if (r) return r;
info.rootAuthority = info.authority = potentialSubdomains[i - 1] + '.' + info.authority;
}
return false;
}
}
// Is this request for us or a subdomain of us?
if (!this.matchHostname_(info.authority)) return false;
// This request is for us or a subdomain.
// Do we need to try to find a subdomain for this request?
if (info.subdomains && info.subdomains.length) {
var subdomain = info.subdomains.pop();
if (!(subdomain in this.subdomains)) return false;
info.authority = subdomain + '.' + info.authority;
return this.subdomains[subdomain].handle(request, response, info);
}
// No, it's for us. Should we hide from unauthenticated clients?
if (this.access === 'hidden' && !($.user.isPrototypeOf(request.user))) {
return false;
}
// No. Serve reqeust.
this.route_(request, response, info);
return true;
};
Object.setOwnerOf($.servers.http.Host.prototype.handle, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.handle.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.route_ = function route_(request, response, info) {
/* Attempt to route an http(s) request for this host to the correct
* handler. If a handler is found, call it.
*
* If no handler is found, but this host has .pathToSubdomain set,
* or .pathToSubdomain is undefined but request contains a
* CodeCity-pathToSubdomain header with value '?1' (true, in RFC 8941
* Structured Field Value notation) then attempt to map the first
* element (directory name) of info.path to one of .subdomains and,
* if successful, call the corresponding subdomain host's .handle
* method.
*
* Otherwise generate a 404 error.
*
* Arguments:
* - request: $.servers.http.Request - the incoming request to handle.
* - response: $.servers.http.Response - the response to write to.
* - info: Object - some additional information generated by
* Host.prototype.handle (see that method for details).
*/
var path = info.path;
if (typeof path !== 'string' || path[0] !== '/') {
response.sendError(400, 'Invalid path "' + path + '"');
} else if (path in this) {
// Get handler object.
var obj = this[path];
if (!$.utils.isObject(obj)) {
response.sendError(500, "Handler is not an object.");
return;
}
// Check access control.
if (!($.user.isPrototypeOf(request.user)) && // Not logged in.
((this.access !== 'public' && obj.wwwAccess !== 'public') ||
obj.wwwAccess === 'private')) {
response.sendError(403);
return;
}
// Record routing info on Request object and serve page.
request.info = info;
if (typeof obj.www === 'string') {
$.jssp.eval(obj, 'www', request, response);
} else if (typeof obj.www === 'function') {
obj.www(request, response);
} else {
response.sendError(500, "Handler .www is neither a function nor a JSSP.");
}
} else if (this.subdomains &&
(this.pathToSubdomain ||
(this.pathToSubdomain === undefined &&
request.headers['codecity-pathtosubdomain'] === '?1'))) {
// Try to route to a subdomain based on top-level directory.
// E.g. https://example.codecity.world/foo/bar -> foo
var m = path.match(/^\/([-A-Za-z0-9]+)(\/.*)?$/);
var subdomain = ''; // Empty string gives good 404 message if .match fails.
if (m && (subdomain = m[1]) in this.subdomains) {
// Subdomain matched. Do we need to redirect to add a trailing '/'?
if (!m[2]) {
response.sendRedirect(subdomain + '/', 308);
return;
}
// Route to the subdomain. Modify info.path and info.origin as appropriate
info.path = m[2];
info.origin += '/' + subdomain;
if (!this.subdomains[subdomain].handle(request, response, info)) {
response.sendError(500, 'Host for pseudo-subdomain /' + subdomain + '/ rejected request.');
return;
}
} else {
response.sendError(404, 'Not Found (and /' + subdomain + '/ does not map to a subdomain).');
}
} else {
response.sendError(404);
}
};
Object.setOwnerOf($.servers.http.Host.prototype.route_, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.route_.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.matchHostname_ = function matchHostname_(hostname) {
/* Returns: boolean - true if hostname exactly matches this.hostRegExp or,
* if that is undefined, this.hostname.
*/
if (this.hostRegExp) {
if (!(this.hostRegExp instanceof RegExp)) {
throw new TypeError('invalid .hostRegExp');
}
var m = this.hostRegExp.exec(hostname);
return (m && m.index === 0); // Match only accepted if at start.
} else if (this.hostname) {
if (typeof this.hostname !== 'string') {
throw new TypeError('invalid .hostname');
}
return this.hostname === hostname; // Only exact matches.
} else {
return true;
}
};
Object.setOwnerOf($.servers.http.Host.prototype.matchHostname_, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.matchHostname_.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.hostname = undefined;
$.servers.http.Host.prototype.subdomains = null;
$.servers.http.Host.prototype.addSubdomain = function addSubdomain(name, host) {
/* Add the given Host as a subdomain of this Host.
*
* Arguments:
* - name: string - the subdomain name.
* - host: $.servers.http.Host - the Host to serve the subdomain.
*/
name = String(name);
if (!(host instanceof $.servers.http.Host)) {
throw new TypeError('host must be a Host');
}
if (!this.hasOwnProperty('subdomains')) {
this.subdomains = Object.create(null);
}
this.subdomains[name] = host;
};
Object.setOwnerOf($.servers.http.Host.prototype.addSubdomain, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.addSubdomain.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.url = function url(varArgs) {
/* Return the base URL for this host (omitting scheme).
*
* Generally prefer $.servers.http.Request.prototype.hostUrl (q.v.)
* instead of method - but in some cases it is necessary to generate
* a URL for the webserver without an existing inbound Request to use
* as reference, so this method allows one to be generated in the
* obvious way from this.hostname. As with .hostUrl:
*
* - Absent any argument, the returned URL will routes to this
* Host object.
* - If an argument is supplied, the returned URL will instead be for
* the named subdomain.
* - Multiple arguments can be supplied if there are nested subdomains.
*
* E.g.:
* rootHost.url() => '//example.codecity.world/'
* rootHost.url('code') => '//code.example.codecity.world/'
* rootHost.url('foo', 'bar') => '//foo.bar.example.codecity.world/'
*
* If .pathToSubdomain is enabled on one or more Host object(s):
* rootHost.url('code') => '//example.codecity.world/code/'
* rootHost.url('foo', 'bar') => '//example.codecity.world/foo/bar/'
* or: '//bar.example.codecity.world/foo/'
*
* Barring bugs, the returned URL should always end with a '/'.
* Arguments:
* - subdomain: string - a string denoting a subdomain of interest.
* Multiple arguments are allowed. RangeError is thrown if no such
* subdomain exists.
* Returns: string - the URL for the desired domain/subdomain.
*/
if (typeof this.hostname !== 'string') {
throw new Error('canonical hostname not set');
}
var hostname = this.hostname;
var host = this;
for (var subdomain, i = 0; (subdomain = arguments[i]); i++) {
hostname = host.urlForSubdomain(hostname, subdomain);
}
return '//' + hostname + '/';
};
Object.setOwnerOf($.servers.http.Host.prototype.url, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.url.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.pathToSubdomain = undefined;
$.servers.http.Host.prototype.urlForSubdomain = function urlForSubdomain(hostname, subdomain, pathToSubdomainHeader) {
/* A helper function for the .url method.
*
* Given a hostname for this host, add the specified subdomain
* if it exists, or throw RangeError if not.
*
* If this.pathToSubdomain is true, or this.pathToSubdomain is undefined
* and pathToSubdomainHeader is true, then the subdomain will be added as
* a directory name suffix rather than a hostname pefix.
*
* E.g.:
* rootHost.pathToSubdomain = false;
* rootHost.urlForSubdomain('example.codecity.world', 'code')
* => 'code.example.codecity.world'
*
* rootHost.pathToSubdomain = undefined;
* rootHost.urlForSubdomain('example', 'code', true)
* => 'example.codecity.world/code'
* rootHost.urlForSubdomain('example', 'code', false)
* => 'code.example.codecity.world'
* rootHost.pathToSubdomain = true;
* rootHost.urlForSubdomain('example', 'code', false)
* => 'example.codecity.world/code'
*
* Arguments:
* - hostname: string - the base hostname for this Host.
* - subdomain: string - the desired subdomain.
* - pathToSubdomainHeader: boolean | undefined - value of the
* CodeCity-pathToSubdomain header for the current request (if there
* is one).
*
* TODO: Give this function a better name, because what it returns
* is not actually a valid URL.
*/
if (!(this.subdomains && subdomain in this.subdomains)) {
throw new RangeError('nonexistent subdomain "' + subdomain + '"');
}
if (this.pathToSubdomain ||
this.pathToSubdomain === undefined && pathToSubdomainHeader) {
return hostname + '/' + subdomain;
} else {
return subdomain + '.' + hostname;
}
};
Object.setOwnerOf($.servers.http.Host.prototype.urlForSubdomain, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.urlForSubdomain.prototype, $.physicals.Maximilian);
$.servers.http.Host.prototype.deleteSubdomain = function deleteSubdomain(subdomain) {
/* Delete a subdomain, or all subdomains served by a particular
* Host object.
*
* Arguments:
* - subdomain: string | $.servers.http.Host - the name of the subdomain
* to be deleted, or the Host object serving it.
*/
if (!this.subdomains) return;
if (typeof subdomain === 'string') {
delete this.subdomains[subdomain];
} else if (subdomain instanceof $.servers.http.Host) {
for (var key in this.subdomains) {
if (this.subdomains[key] === subdomain) {
delete this.subdomains[key];
}
}
} else {
throw new TypeError('argument must be subdomain name or Host object');
}
if (Object.getOwnPropertyNames(this.subdomains).length === 0) {
delete this.subdomains;
}
};
Object.setOwnerOf($.servers.http.Host.prototype.deleteSubdomain, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.Host.prototype.deleteSubdomain.prototype, $.physicals.Maximilian);
$.servers.http.onRequest = function onRequest(connection) {
/* Called from $.servers.http.connection.onReceiveChunk when the
* connection.request has been fully parsed and is ready to be handled.
*
* Arguments:
* - conenction: Object with prototype $.servers.http.connection - the
* connection to be handle.
*/
var request = connection.request;
var response = connection.response;
try {
// Call .handle(request, response) on each Host object in
// $.servers.http.hosts in order until one returns true to indicate
// that it handled the request.
for (var host, i = 0; (host = this.hosts[i]); i++) {
if (host.handle(request, response)) return;
}
// No host responded to request.
response.sendError(400, 'Unknown Host');
} catch (e) {
suspend();
$.system.log(String(e) + '\n' + e.stack);
if (response.headersSent) {
// Too late to return a proper error page. Oh well.
response.write('<pre>' + $.utils.html.escape(String(e) + '\n' + e.stack) +
'</pre>');
} else {
response.sendError(500, e);
}
} finally {
suspend();
connection.close();
}
};
Object.setOwnerOf($.servers.http.onRequest, $.physicals.Maximilian);
Object.setOwnerOf($.servers.http.onRequest.prototype, $.physicals.Maximilian);
$.servers.http.hosts = [];
================================================
FILE: core/core_24_$.hosts.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Host objects for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.hosts = {};
$.hosts.root = (new 'Object.create')($.servers.http.Host.prototype);
$.hosts.root.subdomains = (new 'Object.create')(null);
$.hosts.root['/'] = {};
$.hosts.root['/'].www = '<!doctype html>\n<% var staticUrl = request.hostUrl(\'static\'); %>\n<html lang="en">\n<head>\n <title>Code City</title>\n <style>\n body {\n font-family: "Roboto Mono", monospace;\n text-align: center;\n }\n h1 {\n font-size: 40pt;\n font-weight: 100;\n }\n h1>img {\n vertical-align: text-bottom;\n }\n #tagline {\n font-style: italic;\n margin: 2em;\n }\n iframe {\n height: 50px;\n width: 100px;\n border: none;\n display: block;\n margin: 0 auto;\n }\n </style>\n <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">\n <link href="<%=staticUrl%>favicon.ico" rel="shortcut icon">\n</head>\n<body>\n <h1>\n <img src="<%=staticUrl%>logo.svg" alt="" width="95" height="100">\n Code City\n </h1>\n <p id="tagline">A community of inquisitive programmers.</p>\n <iframe src="<%=request.hostUrl(\'login\')%>?after=<%=request.hostUrl(\'connect\')%>"></iframe>\n</body>\n</html>';
$.hosts.root['/'].wwwAccess = 'public';
$.hosts.root['/mirror'] = {};
Object.setOwnerOf($.hosts.root['/mirror'], $.physicals.Maximilian);
$.hosts.root['/mirror'].www = "<!doctype html>\n<% var staticUrl = request.hostUrl('static'); %>\n<html>\n <head>\n <title>Code City Browser Mirror</title>\n <style>\n body {\n font-family: \"Roboto Mono\", monospace;\n }\n h1 {\n text-align: center;\n }\n h1>img {\n vertical-align: text-bottom;\n }\n </style>\n <link href=\"https://fonts.googleapis.com/css?family=Roboto+Mono\" rel=\"stylesheet\">\n <link href=\"<%=staticUrl%>favicon.ico\" rel=\"shortcut icon\">\n </head>\n <body>\n <h1>\n <img src=\"<%=staticUrl%>logo.svg\" alt=\"\" width=\"47.5\" height=\"50\">\n Code City Browser Mirror\n </h1>\n<%\nfor (var key in request) {\n if (!request.hasOwnProperty(key)) continue;\n var value = request[key];\n \n response.write('<h2>request.' + $.utils.html.escape(key) + ':</h2>\\n');\n response.write('<pre>');\n if (key === 'user') {\n response.write(value ? $.utils.html.escape(value.name) : value + '\\n');\n } else if (true || key === 'info') {\n response.write($.utils.html.escape($.utils.code.expressionFor(value, {\n depth: (key === 'info' ? 1 : 2),\n abbreviateMethods: true,\n proto: 'ignore',\n owner: 'ignore',\n })));\n }\n response.write('</pre>');\n}\n%>\n <h2>request.fromSameOrigin(): [<a href=\"<%= request.hostUrl() %>mirror\">test</code></a>]</h2>\n <pre><%= request.fromSameOrigin() %></pre>\n <h2>request.hostUrl('system'):</h2>\n <pre><%= $.utils.html.escape($.utils.code.quote(request.hostUrl('system'))) %></pre>\n <p>Done</p>\n </body>\n</html>";
$.hosts.root['/mirror'].wwwAccess = 'public';
$.hosts.root['/robots.txt'] = {};
$.hosts.root['/robots.txt'].www = "<% response.setHeader('Content-Type', 'text/plain; charset=utf-8') %>\n# Don't index this Code City instance at this time.\nUser-agent: *\nDisallow: /";
$.hosts.root['/robots.txt'].wwwAccess = 'public';
$.hosts.system = (new 'Object.create')($.servers.http.Host.prototype);
$.hosts.system['/logout'] = {};
Object.setOwnerOf($.hosts.system['/logout'], $.physicals.Neil);
$.hosts.system['/logout'].www = '<%\nvar staticUrl = request.hostUrl(\'static\');\nvar doLogout = !request.user ||\n (request.query === \'execute\' && request.fromSameOrigin());\nif (doLogout) {\n response.clearIdCookie()\n}\n%>\n<!doctype html>\n<html lang="en">\n<head>\n <title>Code City Logout</title>\n <style>\n body {\n font-family: "Roboto Mono", monospace;\n text-align: center;\n }\n h1 {\n font-size: 40pt;\n font-weight: 100;\n }\n h1>img {\n vertical-align: text-bottom;\n }\n #tagline {\n font-style: italic;\n margin: 2em;\n }\n iframe {\n height: 50px;\n width: 100px;\n border: none;\n display: block;\n margin: 0 auto;\n }\n </style>\n <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">\n <link href="<%=staticUrl%>favicon.ico" rel="shortcut icon">\n <link href="<%=staticUrl%>style/jfk.css" rel="stylesheet">\n\n </head>\n<body>\n <h1>\n <img src="<%=staticUrl%>logo.svg" alt="" width="95" height="100">\n Code City\n </h1>\n <p id="tagline"><%= request.info.rootAuthority || request.info.host.hostname || \'\' %></p>\n<% if (doLogout) { %>\n <p>You have been signed out.</p>\n <iframe src="<%=request.hostUrl(\'login\')%>"></iframe>\n<% } else { %>\n <div class="jfk-button jfk-button-action" role="button" id="signout">\n Sign out\n </div>\n <script>\n var button = document.getElementById(\'signout\');\n button.addEventListener(\'click\', function() {\n parent.location = "?execute";\n });\n </script>\n<% } %>\n</body>\n</html>';
$.hosts.dummy = (new 'Object.create')($.servers.http.Host.prototype);
Object.setOwnerOf($.hosts.dummy, $.physicals.Maximilian);
$.hosts.dummy.handle = function handle(request, response, info) {
/* Report the mishandling of an http(s) request which should have
* been intercepted by the nginx front-end and proxied to one
* of the other servers.
*
* This Host object is a singleton placeholer to mark (in
* $.hosts.root.subdomains) the subdomains that should be directed
* to loginServer, connectServer, etc., or served from the /static/
* directory. As such, no requests should ever be able to reach
* this Host object except due to a misconfiguration of nginx.
*
* Arguments:
* - request: $.servers.http.Request - the incoming request to handle.
* - response: $.servers.http.Response - the response to write to.
* - info: Object - some information used by recursive calls to this function.
* Returns: boolean - always true as all requests successfully generate
* an error message.
*/
response.sendError(500, 'This request should have been intercepted by ' +
'the reverse proxy. Check nginx configuration!');
return true;
};
Object.setOwnerOf($.hosts.dummy.handle, $.physicals.Maximilian);
Object.setOwnerOf($.hosts.dummy.handle.prototype, $.physicals.Maximilian);
$.hosts.root.subdomains.system = $.hosts.system;
$.hosts.root.subdomains.connect = $.hosts.dummy;
$.hosts.root.subdomains.login = $.hosts.dummy;
$.hosts.root.subdomains.mobwrite = $.hosts.dummy;
$.hosts.root.subdomains.static = $.hosts.dummy;
$.servers.http.hosts[0] = $.hosts.root;
================================================
FILE: core/core_25_$.db.tempId.js
================================================
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Temporary ID database for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.db = {};
$.db.tempId = {};
$.db.tempId.getObjById = function getObjById(id) {
/* Find object temporarily stored with the given ID.
*/
var record = this.tempIds_[id];
if (record) {
record.time = Date.now();
return record.obj;
}
return undefined;
};
Object.setOwnerOf($.db.tempId.getObjById, $.physicals.Maximilian);
$.db.tempId.storeObj = function storeObj(obj) {
/* Find temporary ID for obj in this.tempIds_,
* adding it if it's not already there.
*/
var records = this.tempIds_;
for (var id in records) {
if (Object.is(records[id].obj, obj)) {
records[id].time = Date.now();
return id;
}
}
do {
var id = Math.floor(Math.random() * 0xFFFFFFFF);
} while (records[id]);
records[id] = {obj: obj, time: Date.now()};
// Lazy call of cleanup.
this.cleanSoon();
return id;
};
Object.setOwnerOf($.db.tempId.storeObj, $.physicals.Maximilian);
$.db.tempId.cleanSoon = function cleanSoon() {
// Schedule a cleanup to happen in a minute.
// Allows multiple calls to be batched together.
if (!this.cleanThread_) {
this.cleanThread_ = setTimeout(this.cleanNow.bind(this), 60 * 1000);
}
};
Object.setOwnerOf($.db.tempId.cleanSoon, $.physicals.Neil);
$.db.tempId.cleanNow = function cleanNow() {
// Cleanup IDs/objects that have not been accessed in an hour.
clearTimeout(this.cleanThread_);
this.cleanThread_ = null;
var ttl = Date.now() - this.timeoutMs;
var records = this.tempIds_;
for (var id in records) {
if (records[id].time < ttl) {
delete records[id];
}
}
};
Object.setOwnerOf($.db.tempId.cleanNow, $.physicals.Neil);
$.db.tempId.timeoutMs = 3600000;
$.db.tempId.tempIds_ = (new 'Object.create')(null);
$.db.tempId.cleanThread_ = undefined;
================================================
FILE: core/core_25_$.userDatabase.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview User database for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.userDatabase = {};
Object.setOwnerOf($.userDatabase, $.physicals.Maximilian);
$.userDatabase.get = function get(id) {
// Returns the user, or undefined.
var hash = $.utils.string.hash('md5', this.salt_ + id);
var table = this.byMd5;
var value = table[hash];
if (!($.user.isPrototypeOf(value))) {
delete table[hash];
return undefined;
}
return value;
};
Object.setOwnerOf($.userDatabase.get, $.physicals.Neil);
Object.setOwnerOf($.userDatabase.get.prototype, $.physicals.Maximilian);
$.userDatabase.set = function set(id, user) {
if (!$.user.isPrototypeOf(user)) {
throw new TypeError('userDatabase only accepts $.user values');
}
var hash = $.utils.string.hash('md5', this.salt_ + id);
this.byMd5[hash] = user;
};
Object.setOwnerOf($.userDatabase.set, $.physicals.Maximilian);
Object.setOwnerOf($.userDatabase.set.prototype, $.physicals.Maximilian);
$.userDatabase.validate = function validate() {
var table = this.byMd5
for (var key in table) {
if (!($.user.isPrototypeOf(table[key]))) {
delete table[key];
}
}
};
Object.setOwnerOf($.userDatabase.validate, $.physicals.Maximilian);
Object.setOwnerOf($.userDatabase.validate.prototype, $.physicals.Maximilian);
$.userDatabase.salt_ = 'v2OU0LHchCl84mhu';
$.userDatabase.byMd5 = (new 'Object.create')(null);
================================================
FILE: core/core_26_inline_editor.js
================================================
/**
* @license
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Inline code editor for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.hosts.code = (new 'Object.create')($.servers.http.Host.prototype);
$.hosts.code['/inlineEdit'] = {};
$.hosts.code['/inlineEdit'].edit = function edit(obj, name, key) {
/* Return a (valid) URL for a web editing session editing obj[key],
* where obj might more commonly be known as name.
*/
if (!$.utils.isObject(obj)) throw new TypeError('obj must be an object');
if (typeof(key) !== 'string') throw new TypeError('key must be a string');
var objId = $.db.tempId.storeObj(obj);
var url = $.hosts.root.url('code') + 'inlineEdit?objId=' + objId;
if (name) {
url += '&name=' + encodeURIComponent(name);
}
if (key) {
url += '&key=' + encodeURIComponent(key);
}
return url;
};
Object.setOwnerOf($.hosts.code['/inlineEdit'].edit, $.physicals.Maximilian);
$.hosts.code['/inlineEdit'].load = function load(obj, key) {
/* Return string containing initial editor contents for editing
* obj[key].
*/
var pd = Object.getOwnPropertyDescriptor(obj, key);
var value = pd ? pd.value : undefined;
if (typeof value === 'function') {
return Function.prototype.toString.apply(value);
} else {
return $.utils.code.expressionFor(value, {depth: 1});
}
};
Object.setOwnerOf($.hosts.code['/inlineEdit'].load, $.physicals.Maximilian);
$.hosts.code['/inlineEdit'].save = function save(obj, key, src) {
/* Eval the string src and (if successful) save the resulting value
* as obj[key]. If the value produced from src and the existing
* value of obj[key] are both objects, then an attempt will be made
* to copy any properties from the old value to the new one.
*/
var old = obj[key];
src = $.utils.code.rewriteForEval(src, /* forceExpression= */ true);
// Evaluate src in global scope (eval by any other name, literally).
// TODO: don't use eval - prefer Function constructor for
// functions; generate other values from an Acorn parse tree.
var evalGlobal = eval;
var val = evalGlobal(src);
if (typeof old === 'function' && typeof val === 'function') {
$.utils.object.transplantProperties(old, val);
}
if (typeof val === 'function') {
val.lastModifiedTime = Date.now();
// TODO: Add user.
//val.lastModifiedUser = ...;
}
obj[key] = val;
return this.load(obj, key);
};
Object.setOwnerOf($.hosts.code['/inlineEdit'].save, $.physicals.Maximilian);
$.hosts.code['/inlineEdit'].www = '<%\nvar staticUrl = request.hostUrl(\'static\');\nvar params = request.parameters;\nvar objId = params.objId;\nvar obj = $.db.tempId.getObjById(params.objId);\nif (!$.utils.isObject(obj)) {\n // Bad edit URL.\n response.sendError(404);\n return;\n}\nvar key = params.key;\nvar src = params.src;\nvar status = \'\';\nif (src) {\n try {\n if (!request.fromSameOrigin()) {\n // Security check to ensure this is being loaded by the code editor.\n throw new Error(\'Cross-origin referer: \' + String(request.headers.referer));\n }\n src = this.save(obj, key, src);\n status = \'(saved)\';\n if (typeof obj[key] === \'function\') {\n if (params.isVerb) {\n obj[key].verb = params.verb;\n obj[key].dobj = params.dobj;\n obj[key].prep = params.prep;\n obj[key].iobj = params.iobj;\n } else {\n delete obj[key].verb;\n delete obj[key].dobj;\n delete obj[key].prep;\n delete obj[key].iobj;\n }\n }\n } catch (e) {\n status = \'(ERROR: \' + String(e) + \')\';\n }\n} else {\n src = this.load(obj, key);\n}\nvar isVerb = (Object.getOwnPropertyDescriptor(obj, key) && typeof obj[key] === \'function\') && obj[key].verb ? \'checked\' : \'\';\nvar verb = $.utils.html.escape((obj[key] && obj[key].verb) || \'\');\nvar dobj = obj[key] && obj[key].dobj;\nvar prep = obj[key] && obj[key].prep;\nvar iobj = obj[key] && obj[key].iobj;\nvar name = $.utils.html.escape(params.name);\nkey = $.utils.html.escape(key);\nvar objOpts = [\'none\', \'this\', \'any\']\n%>\n<!DOCTYPE html>\n<html><head>\n <title>Code Editor for <%= name %>.<%= key %></title>\n <link href="<%=staticUrl%>style/jfk.css" rel="stylesheet">\n <style>\n body {margin: 0; font-family: sans-serif}\n h1 {margin-bottom: 5; font-size: small}\n #submit {position: fixed; bottom: 1ex; right: 2ex; z-index: 9}\n .CodeMirror {height: auto; border: 1px solid #eee}\n #verb {width: 15ex}\n </style>\n\n <link rel="stylesheet" href="<%=staticUrl%>CodeMirror/lib/codemirror.css">\n <script src="<%=staticUrl%>CodeMirror/lib/codemirror.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/javascript/javascript.js"></script>\n</head><body>\n <form action="inlineEdit" method="post">\n <button type="submit" class="jfk-button-submit" id="submit"\n onclick="document.getElementById(\'src\').value = editor.getValue()">Save</button>\n <h1>Editing <%= name %>.<%= key %>\n <span id="status"><%= status %></span></h1>\n <input name="objId" type="hidden" value="<%= $.utils.html.escape(objId) %>">\n <input name="name" type="hidden" value="<%= name %>">\n <input name="key" type="hidden" value="<%= key %>">\n <div><input type="checkbox" name="isVerb" id="isVerb" <%= isVerb %> onclick="updateDisabled(); changed()">\n <label for="isVerb">Verb:</label>\n <input name="verb" id="verb" value="<%= verb %>" placeholder="name">\n <select name="dobj" id="dobj" onchange="changed()">\n <% for (var i = 0; i < objOpts.length; i++) {%>\n <option <%= dobj === objOpts[i] ? \'selected\' : \'\' %>><%= objOpts[i] %></option>\n <% } %>\n </select>\n <select name="prep" id="prep" onchange="changed()">\n <% for (var i = 0; i < $.utils.command.prepositionOptions.length; i++) {%>\n <option <%= prep === $.utils.command.prepositionOptions[i] ? \'selected\' : \'\' %>><%= $.utils.command.prepositionOptions[i] %></option>\n <% } %>\n </select>\n <select name="iobj" id="iobj" onchange="changed()">\n <% for (var i = 0; i < objOpts.length; i++) {%>\n <option <%= iobj === objOpts[i] ? \'selected\' : \'\' %>><%= objOpts[i] %></option>\n <% } %>\n </select>\n </div>\n <textarea name="src" id="src"><%= $.utils.html.escape(src) %>\n</textarea>\n </form>\n <script>\n var editor = CodeMirror.fromTextArea(document.getElementById(\'src\'), {\n lineNumbers: true,\n matchBrackets: true,\n viewportMargin: Infinity,\n });\n editor.on(\'change\', changed);\n function changed() {\n document.getElementById(\'status\').innerText = \'(modified)\'\n }\n function updateDisabled() {\n var disabled = document.getElementById(\'isVerb\').checked ? \'\' : \'disabled\';\n document.getElementById(\'verb\').disabled = disabled;\n document.getElementById(\'dobj\').disabled = disabled;\n document.getElementById(\'prep\').disabled = disabled;\n document.getElementById(\'iobj\').disabled = disabled;\n }\n updateDisabled();\n </script>\n</body></html>';
$.hosts.root.subdomains.code = $.hosts.code;
================================================
FILE: core/core_27_editor.js
================================================
/**
* @license
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Web-based code explorer/editor for Code City.
*/
//////////////////////////////////////////////////////////////////////
// AUTO-GENERATED CODE FROM DUMP. EDIT WITH CAUTION!
//////////////////////////////////////////////////////////////////////
$.hosts.code['/'] = {};
$.hosts.code['/'].www = '<!DOCTYPE HTML Frameset DTD>\n<% var staticUrl = request.hostUrl(\'static\'); %>\n<html>\n<head>\n <title>Code City: Code</title>\n <link href="<%=staticUrl%>favicon.ico" rel="shortcut icon">\n <script src="<%=staticUrl%>code/common.js"></script>\n <script src="<%=staticUrl%>code/code.js"></script>\n</head>\n<frameset rows="40%,60%">\n <frame id="explorer" src="explorer" />\n <frame id="editor" src="editor" />\n</frameset>\n<noframes>Sorry, your browser does not support frames!</noframes>\n</html>';
$.hosts.code['/editor'] = {};
$.hosts.code['/editor'].www = '<!doctype html>\n<% var staticUrl = request.hostUrl(\'static\'); %>\n<html>\n <head>\n <meta charset="utf-8"/>\n <title>Code City: Code Editor</title>\n <link rel="stylesheet" href="<%=staticUrl%>code/style.css">\n <link rel="stylesheet" href="<%=staticUrl%>code/editor.css">\n <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">\n <link rel="stylesheet" href="<%=staticUrl%>style/jfk.css">\n\n <link rel="stylesheet" href="<%=staticUrl%>CodeMirror/lib/codemirror.css">\n <link rel="stylesheet" href="<%=staticUrl%>CodeMirror/addon/lint/lint.css">\n <link rel="stylesheet" href="<%=staticUrl%>CodeMirror/theme/eclipse.css">\n <script src="<%=staticUrl%>CodeMirror/lib/codemirror.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/edit/matchbrackets.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/comment/continuecomment.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/mode/multiplex.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/lint/lint.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/lint/javascript-lint.js"></script>\n <script src="<%=staticUrl%>CodeMirror/addon/display/rulers.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/css/css.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/htmlembedded/htmlembedded.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/htmlmixed/htmlmixed.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/javascript/javascript.js"></script>\n <script src="<%=staticUrl%>CodeMirror/mode/xml/xml.js"></script>\n\n <script src="<%=staticUrl%>code/common.js"></script>\n <script id="editor_js" src="<%=staticUrl%>code/editor.js"></script>\n </head>\n <body>\n <div id="editorDialog">\n <div id="editorDialogMask"></div>\n <div id="editorDialogBox">\n <div id="editorConfirmBox">\n <p>Do you want to save changes?</p>\n <p>\n <button id="editorConfirmDiscard" class="jfk-button">Discard</button>\n <button id="editorConfirmSave" class="jfk-button jfk-button-submit">Save</button>\n <button id="editorConfirmCancel" class="jfk-button">Cancel</button>\n </p>\n </div>\n <div id="editorShareBox" class="disabled">\n <p>\n <label><input type="checkbox" id="editorShareCheck" disabled> Share this editor:</label>\n </p>\n <p>\n <input id="editorShareAddress" readonly>\n </p>\n <p>\n <button id="editorShareOk" class="jfk-button jfk-button-submit">Ok</button>\n </p>\n </div>\n </div>\n </div>\n <div id="editorButter"><div><div id="editorButterText"></div></div></div>\n <div id="editorSavingMask"></div>\n <div id="editorButtons">\n <button id="editorShare" class="jfk-button">Share...</button>\n <button id="editorSave" class="jfk-button">Save</button>\n </div>\n <div id="editorTabs" class="disabled">\n <span class="spacer"></span>\n </div>\n <div id="editorHeader" class="loading"></div>\n <div id="editorContainers"></div>\n </body>\n</html>\n';
$.hosts.code['/explorer'] = {};
$.hosts.code['/explorer'].www = '<!doctype html>\n<% var staticUrl = request.hostUrl(\'static\'); %>\n<html>\n <head>\n <meta charset="utf-8"/>\n <title>Code City: Code Explorer</title>\n <link rel="stylesheet" href="<%=staticUrl%>code/style.css">\n <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">\n <script src="<%=staticUrl%>code/common.js"></script>\n <script src="<%=staticUrl%>code/explorer.js"></script>\n </head>\n <body>\n <input type="text" id="input" autocomplete="off">\n <div id="autocompleteMenu"><div id="autocompleteMenuScroll"></div></div>\n <div id="panels"><div id="panelsScroll"><span id="panelSpacer"></span></div></div>\n </body>\n</html>\n';
$.hosts.code['/diff'] = {};
$.hosts.code['/diff'].www = '<% var staticUrl = request.hostUrl(\'static\'); %>\n<html>\n <head>\n <title>Code City Diff Editor</title>\n <script src="<%=staticUrl%>code/mobwrite/dmp.js"></script>\n <script src="<%=staticUrl%>code/diff.js"></script>\n <link rel="stylesheet" href="<%=staticUrl%>code/diff.css">\n </head>\n\n <body>\n </body>\n</html>\n';
$.hosts.code['/objectPanel'] = {};
$.hosts.code['/objectPanel'].www = '<!doctype html>\n<% var staticUrl = request.hostUrl(\'static\'); %>\n<html>\n <head>\n <meta charset="utf-8"/>\n <title>Code City: Code Object Panel</title>\n <link rel="stylesheet" href="<%=staticUrl%>code/style.css">\n <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono">\n </head>\n <body id="objectPanel">\n <table id="objectTable">\n <thead>\n <tr><td id="objectTitle">​</td></tr>\n </thead>\n <tbody id="objectTableBody">\n <tr><td class="loading">​</td></tr> <!-- Zero width space to align the loading ellipsis. -->\n </tbody>\n <tfoot id="objectFail">\n <tr><td>Server Error<br>Check your console…</td></tr>\n </tfoot>\n </table>\n <script src="<%=staticUrl%>code/common.js"></script>\n <script src="<%=staticUrl%>code/objectPanel.js"></script>\n <script>\n Code.ObjectPanel.data = <%=JSON.stringify(this.buildData(request.query), null, 2)%>;\n </script>\n </body>\n</html>\n';
$.hosts.code
gitextract_2201ao9s/
├── .clang-format
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── bin/
│ ├── dump-core
│ ├── nginx-dev
│ └── startup.command
├── connect/
│ ├── connect.html
│ ├── connectServer
│ ├── log.html
│ └── world.html
├── core/
│ ├── README
│ ├── core_10_base.js
│ ├── core_11_$.utils.js
│ ├── core_12_$.utils.code.js
│ ├── core_13_$.Selector.js
│ ├── core_20_$.utils.html.js
│ ├── core_21_$.jssp.js
│ ├── core_22_$.connection.js
│ ├── core_23_$.servers.http.js
│ ├── core_24_$.hosts.js
│ ├── core_25_$.db.tempId.js
│ ├── core_25_$.userDatabase.js
│ ├── core_26_inline_editor.js
│ ├── core_27_editor.js
│ ├── core_28_$.servers.eval.js
│ ├── core_30_$.utils.command.js
│ ├── core_31_$.utils_world.js
│ ├── core_32_physical.js
│ ├── core_33_world.js
│ ├── core_34_$.servers.login.js
│ ├── core_34_$.servers.telnet.js
│ ├── core_40_$.startRoom.js
│ ├── core_41_deutsche_zimmer.js
│ ├── core_42_plant.js
│ ├── core_43_genetics_lab.js
│ ├── core_44_$.assistant.js
│ ├── core_45_Challenge_Room.js
│ ├── core_46_$.secuityCourse.js
│ ├── core_99_startup.js
│ └── dump_spec.json
├── database/
│ ├── README
│ └── codecity.cfg
├── docs/
│ └── setup.md
├── etc/
│ ├── apache.conf
│ ├── cc-localhost.conf
│ ├── cc-onedomain.conf
│ ├── cc-subdomain.conf
│ ├── codecity-connect.service
│ ├── codecity-login.service
│ ├── codecity-mobwrite.service
│ ├── codecity.service
│ └── gcloud-snapshot
├── login/
│ ├── login.html
│ ├── loginServer
│ └── package.json
├── minimal/
│ ├── core_01_minimal.js
│ ├── minimal.cfg
│ └── readme.txt
├── mobwrite/
│ ├── mobwrite.cfg
│ ├── mobwrite_core.py
│ ├── mobwrite_core_test.py
│ └── mobwrite_server.py
├── server/
│ ├── code.js
│ ├── codecity
│ ├── compile
│ ├── config.txt
│ ├── dump
│ ├── dumper.js
│ ├── externs/
│ │ ├── WeakRef.js
│ │ ├── buffer/
│ │ │ ├── buffer.js
│ │ │ └── package.json
│ │ ├── crypto/
│ │ │ ├── crypto.js
│ │ │ └── package.json
│ │ ├── events/
│ │ │ ├── events.js
│ │ │ └── package.json
│ │ ├── fs/
│ │ │ ├── fs.js
│ │ │ └── package.json
│ │ ├── http/
│ │ │ ├── http.js
│ │ │ └── package.json
│ │ ├── https/
│ │ │ ├── https.js
│ │ │ └── package.json
│ │ ├── net/
│ │ │ ├── net.js
│ │ │ └── package.json
│ │ ├── node.js
│ │ ├── path/
│ │ │ ├── package.json
│ │ │ └── path.js
│ │ ├── stream/
│ │ │ ├── package.json
│ │ │ └── stream.js
│ │ ├── tls/
│ │ │ ├── package.json
│ │ │ └── tls.js
│ │ └── util/
│ │ ├── package.json
│ │ └── util.js
│ ├── interpreter.js
│ ├── iterable_weakmap.js
│ ├── iterable_weakset.js
│ ├── package.json
│ ├── parser.js
│ ├── priorityqueue.js
│ ├── registry.js
│ ├── repl
│ ├── selector.js
│ ├── serialize.js
│ ├── startup/
│ │ ├── cc.js
│ │ ├── es5.js
│ │ ├── es6.js
│ │ ├── es7.js
│ │ ├── es8.js
│ │ └── esx.js
│ └── tests/
│ ├── code_test.js
│ ├── db/
│ │ ├── core_01_$.js
│ │ ├── core_01_$.system.js
│ │ ├── test.cfg
│ │ ├── test_00_start.js
│ │ ├── test_01_es5.js
│ │ ├── test_01_es6.js
│ │ ├── test_01_es7.js
│ │ ├── test_02_errors.js
│ │ ├── test_02_perms.js
│ │ ├── test_09_end.js
│ │ ├── test_10_fibonacci.js
│ │ └── test_20_reboot.js
│ ├── dump_test.js
│ ├── dumper_test.js
│ ├── interpreter_bench.js
│ ├── interpreter_common.js
│ ├── interpreter_test.js
│ ├── interpreter_unit_test.js
│ ├── iterable_weakmap_test.js
│ ├── iterable_weakset_test.js
│ ├── priorityqueue_test.js
│ ├── registry_test.js
│ ├── run
│ ├── run.js
│ ├── selector_test.js
│ ├── serialize_bench.js
│ ├── serialize_test.js
│ ├── testcases.js
│ ├── testing.js
│ └── tinycore/
│ ├── README
│ ├── core_00_es_minimal.js
│ ├── core_10_base.js
│ ├── core_13_$.utils.code.js
│ ├── core_35_$.servers.eval.js
│ ├── dump_spec.json
│ └── tiny.cfg
├── static/
│ ├── 503.html
│ ├── code/
│ │ ├── code.js
│ │ ├── common.js
│ │ ├── diff.css
│ │ ├── diff.js
│ │ ├── editor.css
│ │ ├── editor.js
│ │ ├── explorer.js
│ │ ├── mobwrite/
│ │ │ ├── demo/
│ │ │ │ ├── editor.html
│ │ │ │ ├── form.html
│ │ │ │ ├── mobwrite_form.js
│ │ │ │ └── test.html
│ │ │ ├── mobwrite_cc.js
│ │ │ └── mobwrite_core.js
│ │ ├── objectPanel.js
│ │ ├── style.css
│ │ ├── svg.css
│ │ ├── svg.js
│ │ └── tests/
│ │ ├── test.html
│ │ └── test.js
│ ├── connect/
│ │ ├── common.css
│ │ ├── common.js
│ │ ├── connect.css
│ │ ├── connect.js
│ │ ├── log.css
│ │ ├── log.js
│ │ ├── prettify.css
│ │ ├── prettify.js
│ │ ├── tests/
│ │ │ ├── test.html
│ │ │ └── test.js
│ │ ├── world.css
│ │ └── world.js
│ ├── flamethrower.html
│ ├── login-close.html
│ ├── securitystore/
│ │ ├── style.css
│ │ └── utils.js
│ └── style/
│ ├── jfk.css
│ └── svg.css
└── third_party/
├── CodeMirror/
│ ├── AUTHORS
│ ├── CHANGELOG.md
│ ├── CONTRIBUTING.md
│ ├── LICENSE
│ ├── METADATA
│ ├── README.md
│ ├── addon/
│ │ ├── comment/
│ │ │ ├── comment.js
│ │ │ └── continuecomment.js
│ │ ├── dialog/
│ │ │ ├── dialog.css
│ │ │ └── dialog.js
│ │ ├── display/
│ │ │ ├── autorefresh.js
│ │ │ ├── fullscreen.css
│ │ │ ├── fullscreen.js
│ │ │ ├── panel.js
│ │ │ ├── placeholder.js
│ │ │ └── rulers.js
│ │ ├── edit/
│ │ │ ├── closebrackets.js
│ │ │ ├── closetag.js
│ │ │ ├── continuelist.js
│ │ │ ├── matchbrackets.js
│ │ │ ├── matchtags.js
│ │ │ └── trailingspace.js
│ │ ├── fold/
│ │ │ ├── brace-fold.js
│ │ │ ├── comment-fold.js
│ │ │ ├── foldcode.js
│ │ │ ├── foldgutter.css
│ │ │ ├── foldgutter.js
│ │ │ ├── indent-fold.js
│ │ │ ├── markdown-fold.js
│ │ │ └── xml-fold.js
│ │ ├── hint/
│ │ │ ├── anyword-hint.js
│ │ │ ├── css-hint.js
│ │ │ ├── html-hint.js
│ │ │ ├── javascript-hint.js
│ │ │ ├── show-hint.css
│ │ │ ├── show-hint.js
│ │ │ ├── sql-hint.js
│ │ │ └── xml-hint.js
│ │ ├── lint/
│ │ │ ├── coffeescript-lint.js
│ │ │ ├── css-lint.js
│ │ │ ├── html-lint.js
│ │ │ ├── javascript-lint.js
│ │ │ ├── json-lint.js
│ │ │ ├── lint.css
│ │ │ ├── lint.js
│ │ │ └── yaml-lint.js
│ │ ├── merge/
│ │ │ ├── merge.css
│ │ │ └── merge.js
│ │ ├── mode/
│ │ │ ├── loadmode.js
│ │ │ ├── multiplex.js
│ │ │ ├── multiplex_test.js
│ │ │ ├── overlay.js
│ │ │ └── simple.js
│ │ ├── runmode/
│ │ │ ├── colorize.js
│ │ │ ├── runmode-standalone.js
│ │ │ ├── runmode.js
│ │ │ └── runmode.node.js
│ │ ├── scroll/
│ │ │ ├── annotatescrollbar.js
│ │ │ ├── scrollpastend.js
│ │ │ ├── simplescrollbars.css
│ │ │ └── simplescrollbars.js
│ │ ├── search/
│ │ │ ├── jump-to-line.js
│ │ │ ├── match-highlighter.js
│ │ │ ├── matchesonscrollbar.css
│ │ │ ├── matchesonscrollbar.js
│ │ │ ├── search.js
│ │ │ └── searchcursor.js
│ │ ├── selection/
│ │ │ ├── active-line.js
│ │ │ ├── mark-selection.js
│ │ │ └── selection-pointer.js
│ │ ├── tern/
│ │ │ ├── tern.css
│ │ │ ├── tern.js
│ │ │ └── worker.js
│ │ └── wrap/
│ │ └── hardwrap.js
│ ├── bin/
│ │ ├── authors.sh
│ │ ├── lint
│ │ ├── release
│ │ ├── source-highlight
│ │ └── upload-release.js
│ ├── demo/
│ │ ├── activeline.html
│ │ ├── anywordhint.html
│ │ ├── bidi.html
│ │ ├── btree.html
│ │ ├── buffers.html
│ │ ├── changemode.html
│ │ ├── closebrackets.html
│ │ ├── closetag.html
│ │ ├── complete.html
│ │ ├── emacs.html
│ │ ├── folding.html
│ │ ├── fullscreen.html
│ │ ├── hardwrap.html
│ │ ├── html5complete.html
│ │ ├── indentwrap.html
│ │ ├── lint.html
│ │ ├── loadmode.html
│ │ ├── marker.html
│ │ ├── markselection.html
│ │ ├── matchhighlighter.html
│ │ ├── matchtags.html
│ │ ├── merge.html
│ │ ├── multiplex.html
│ │ ├── mustache.html
│ │ ├── panel.html
│ │ ├── placeholder.html
│ │ ├── preview.html
│ │ ├── requirejs.html
│ │ ├── resize.html
│ │ ├── rulers.html
│ │ ├── runmode.html
│ │ ├── search.html
│ │ ├── simplemode.html
│ │ ├── simplescrollbars.html
│ │ ├── spanaffectswrapping_shim.html
│ │ ├── sublime.html
│ │ ├── tern.html
│ │ ├── theme.html
│ │ ├── trailingspace.html
│ │ ├── variableheight.html
│ │ ├── vim.html
│ │ ├── visibletabs.html
│ │ ├── widget.html
│ │ └── xmlcomplete.html
│ ├── doc/
│ │ ├── activebookmark.js
│ │ ├── docs.css
│ │ ├── internals.html
│ │ ├── manual.html
│ │ ├── realworld.html
│ │ ├── releases.html
│ │ ├── reporting.html
│ │ ├── upgrade_v2.2.html
│ │ ├── upgrade_v3.html
│ │ └── upgrade_v4.html
│ ├── index.html
│ ├── keymap/
│ │ ├── emacs.js
│ │ ├── sublime.js
│ │ └── vim.js
│ ├── lib/
│ │ ├── codemirror.css
│ │ └── codemirror.js
│ ├── mode/
│ │ ├── apl/
│ │ │ ├── apl.js
│ │ │ └── index.html
│ │ ├── asciiarmor/
│ │ │ ├── asciiarmor.js
│ │ │ └── index.html
│ │ ├── asn.1/
│ │ │ ├── asn.1.js
│ │ │ └── index.html
│ │ ├── asterisk/
│ │ │ ├── asterisk.js
│ │ │ └── index.html
│ │ ├── brainfuck/
│ │ │ ├── brainfuck.js
│ │ │ └── index.html
│ │ ├── clike/
│ │ │ ├── clike.js
│ │ │ ├── index.html
│ │ │ ├── scala.html
│ │ │ └── test.js
│ │ ├── clojure/
│ │ │ ├── clojure.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── cmake/
│ │ │ ├── cmake.js
│ │ │ └── index.html
│ │ ├── cobol/
│ │ │ ├── cobol.js
│ │ │ └── index.html
│ │ ├── coffeescript/
│ │ │ ├── coffeescript.js
│ │ │ └── index.html
│ │ ├── commonlisp/
│ │ │ ├── commonlisp.js
│ │ │ └── index.html
│ │ ├── crystal/
│ │ │ ├── crystal.js
│ │ │ └── index.html
│ │ ├── css/
│ │ │ ├── css.js
│ │ │ ├── gss.html
│ │ │ ├── gss_test.js
│ │ │ ├── index.html
│ │ │ ├── less.html
│ │ │ ├── less_test.js
│ │ │ ├── scss.html
│ │ │ ├── scss_test.js
│ │ │ └── test.js
│ │ ├── cypher/
│ │ │ ├── cypher.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── d/
│ │ │ ├── d.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── dart/
│ │ │ ├── dart.js
│ │ │ └── index.html
│ │ ├── diff/
│ │ │ ├── diff.js
│ │ │ └── index.html
│ │ ├── django/
│ │ │ ├── django.js
│ │ │ └── index.html
│ │ ├── dockerfile/
│ │ │ ├── dockerfile.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── dtd/
│ │ │ ├── dtd.js
│ │ │ └── index.html
│ │ ├── dylan/
│ │ │ ├── dylan.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── ebnf/
│ │ │ ├── ebnf.js
│ │ │ └── index.html
│ │ ├── ecl/
│ │ │ ├── ecl.js
│ │ │ └── index.html
│ │ ├── eiffel/
│ │ │ ├── eiffel.js
│ │ │ └── index.html
│ │ ├── elm/
│ │ │ ├── elm.js
│ │ │ └── index.html
│ │ ├── erlang/
│ │ │ ├── erlang.js
│ │ │ └── index.html
│ │ ├── factor/
│ │ │ ├── factor.js
│ │ │ └── index.html
│ │ ├── fcl/
│ │ │ ├── fcl.js
│ │ │ └── index.html
│ │ ├── forth/
│ │ │ ├── forth.js
│ │ │ └── index.html
│ │ ├── fortran/
│ │ │ ├── fortran.js
│ │ │ └── index.html
│ │ ├── gas/
│ │ │ ├── gas.js
│ │ │ └── index.html
│ │ ├── gfm/
│ │ │ ├── gfm.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── gherkin/
│ │ │ ├── gherkin.js
│ │ │ └── index.html
│ │ ├── go/
│ │ │ ├── go.js
│ │ │ └── index.html
│ │ ├── groovy/
│ │ │ ├── groovy.js
│ │ │ └── index.html
│ │ ├── haml/
│ │ │ ├── haml.js
│ │ │ ├── index.html
│ │ │ └── test.js
│ │ ├── handlebars/
│ │ │ ├── handlebars.js
│ │ │ └── index.html
│ │ ├── haskell/
│ │ │ ├── haskell.js
│ │ │ └── index.html
│ │ ├── haskell-literate/
│ │ │ ├── haskell-literate.js
│ │ │ └── index.html
│ │ ├── haxe/
│ │ │ ├── haxe.js
│ │ │ └── index.html
│ │ ├── htmlembedded/
│ │ │ ├── htmlembedded.js
│ │ │ └── index.html
│ │ ├── htmlmixed/
│ │ │ ├── htmlmixed.js
│ │ │ └── index.html
│ │ ├── http/
│ │ │ ├── http.js
│ │ │ └── index.html
│ │ ├── idl/
│ │ │ ├── idl.js
│ │ │ └── index.html
│ │ ├── index.html
│ │ ├── javascript/
│ │ │ ├── index.html
│ │ │ ├── javascript.js
│ │ │ ├── json-ld.html
│ │ │ ├── test.js
│ │ │ └── typescript.html
│ │ ├── jinja2/
│ │ │ ├── index.html
│ │ │ └── jinja2.js
│ │ ├── jsx/
│ │ │ ├── index.html
│ │ │ ├── jsx.js
│ │ │ └── test.js
│ │ ├── julia/
│ │ │ ├── index.html
│ │ │ └── julia.js
│ │ ├── livescript/
│ │ │ ├── index.html
│ │ │ └── livescript.js
│ │ ├── lua/
│ │ │ ├── index.html
│ │ │ └── lua.js
│ │ ├── markdown/
│ │ │ ├── index.html
│ │ │ ├── markdown.js
│ │ │ └── test.js
│ │ ├── mathematica/
│ │ │ ├── index.html
│ │ │ └── mathematica.js
│ │ ├── mbox/
│ │ │ ├── index.html
│ │ │ └── mbox.js
│ │ ├── meta.js
│ │ ├── mirc/
│ │ │ ├── index.html
│ │ │ └── mirc.js
│ │ ├── mllike/
│ │ │ ├── index.html
│ │ │ └── mllike.js
│ │ ├── modelica/
│ │ │ ├── index.html
│ │ │ └── modelica.js
│ │ ├── mscgen/
│ │ │ ├── index.html
│ │ │ ├── mscgen.js
│ │ │ ├── mscgen_test.js
│ │ │ ├── msgenny_test.js
│ │ │ └── xu_test.js
│ │ ├── mumps/
│ │ │ ├── index.html
│ │ │ └── mumps.js
│ │ ├── nginx/
│ │ │ ├── index.html
│ │ │ └── nginx.js
│ │ ├── nsis/
│ │ │ ├── index.html
│ │ │ └── nsis.js
│ │ ├── ntriples/
│ │ │ ├── index.html
│ │ │ └── ntriples.js
│ │ ├── octave/
│ │ │ ├── index.html
│ │ │ └── octave.js
│ │ ├── oz/
│ │ │ ├── index.html
│ │ │ └── oz.js
│ │ ├── pascal/
│ │ │ ├── index.html
│ │ │ └── pascal.js
│ │ ├── pegjs/
│ │ │ ├── index.html
│ │ │ └── pegjs.js
│ │ ├── perl/
│ │ │ ├── index.html
│ │ │ └── perl.js
│ │ ├── php/
│ │ │ ├── index.html
│ │ │ ├── php.js
│ │ │ └── test.js
│ │ ├── pig/
│ │ │ ├── index.html
│ │ │ └── pig.js
│ │ ├── powershell/
│ │ │ ├── index.html
│ │ │ ├── powershell.js
│ │ │ └── test.js
│ │ ├── properties/
│ │ │ ├── index.html
│ │ │ └── properties.js
│ │ ├── protobuf/
│ │ │ ├── index.html
│ │ │ └── protobuf.js
│ │ ├── pug/
│ │ │ ├── index.html
│ │ │ └── pug.js
│ │ ├── puppet/
│ │ │ ├── index.html
│ │ │ └── puppet.js
│ │ ├── python/
│ │ │ ├── index.html
│ │ │ ├── python.js
│ │ │ └── test.js
│ │ ├── q/
│ │ │ ├── index.html
│ │ │ └── q.js
│ │ ├── r/
│ │ │ ├── index.html
│ │ │ └── r.js
│ │ ├── rpm/
│ │ │ ├── changes/
│ │ │ │ └── index.html
│ │ │ ├── index.html
│ │ │ └── rpm.js
│ │ ├── rst/
│ │ │ ├── index.html
│ │ │ └── rst.js
│ │ ├── ruby/
│ │ │ ├── index.html
│ │ │ ├── ruby.js
│ │ │ └── test.js
│ │ ├── rust/
│ │ │ ├── index.html
│ │ │ ├── rust.js
│ │ │ └── test.js
│ │ ├── sas/
│ │ │ ├── index.html
│ │ │ └── sas.js
│ │ ├── sass/
│ │ │ ├── index.html
│ │ │ ├── sass.js
│ │ │ └── test.js
│ │ ├── scheme/
│ │ │ ├── index.html
│ │ │ └── scheme.js
│ │ ├── shell/
│ │ │ ├── index.html
│ │ │ ├── shell.js
│ │ │ └── test.js
│ │ ├── sieve/
│ │ │ ├── index.html
│ │ │ └── sieve.js
│ │ ├── slim/
│ │ │ ├── index.html
│ │ │ ├── slim.js
│ │ │ └── test.js
│ │ ├── smalltalk/
│ │ │ ├── index.html
│ │ │ └── smalltalk.js
│ │ ├── smarty/
│ │ │ ├── index.html
│ │ │ └── smarty.js
│ │ ├── solr/
│ │ │ ├── index.html
│ │ │ └── solr.js
│ │ ├── soy/
│ │ │ ├── index.html
│ │ │ ├── soy.js
│ │ │ └── test.js
│ │ ├── sparql/
│ │ │ ├── index.html
│ │ │ └── sparql.js
│ │ ├── spreadsheet/
│ │ │ ├── index.html
│ │ │ └── spreadsheet.js
│ │ ├── sql/
│ │ │ ├── index.html
│ │ │ └── sql.js
│ │ ├── stex/
│ │ │ ├── index.html
│ │ │ ├── stex.js
│ │ │ └── test.js
│ │ ├── stylus/
│ │ │ ├── index.html
│ │ │ └── stylus.js
│ │ ├── swift/
│ │ │ ├── index.html
│ │ │ ├── swift.js
│ │ │ └── test.js
│ │ ├── tcl/
│ │ │ ├── index.html
│ │ │ └── tcl.js
│ │ ├── textile/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── textile.js
│ │ ├── tiddlywiki/
│ │ │ ├── index.html
│ │ │ ├── tiddlywiki.css
│ │ │ └── tiddlywiki.js
│ │ ├── tiki/
│ │ │ ├── index.html
│ │ │ ├── tiki.css
│ │ │ └── tiki.js
│ │ ├── toml/
│ │ │ ├── index.html
│ │ │ └── toml.js
│ │ ├── tornado/
│ │ │ ├── index.html
│ │ │ └── tornado.js
│ │ ├── troff/
│ │ │ ├── index.html
│ │ │ └── troff.js
│ │ ├── ttcn/
│ │ │ ├── index.html
│ │ │ └── ttcn.js
│ │ ├── ttcn-cfg/
│ │ │ ├── index.html
│ │ │ └── ttcn-cfg.js
│ │ ├── turtle/
│ │ │ ├── index.html
│ │ │ └── turtle.js
│ │ ├── twig/
│ │ │ ├── index.html
│ │ │ └── twig.js
│ │ ├── vb/
│ │ │ ├── index.html
│ │ │ └── vb.js
│ │ ├── vbscript/
│ │ │ ├── index.html
│ │ │ └── vbscript.js
│ │ ├── velocity/
│ │ │ ├── index.html
│ │ │ └── velocity.js
│ │ ├── verilog/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── verilog.js
│ │ ├── vhdl/
│ │ │ ├── index.html
│ │ │ └── vhdl.js
│ │ ├── vue/
│ │ │ ├── index.html
│ │ │ └── vue.js
│ │ ├── webidl/
│ │ │ ├── index.html
│ │ │ └── webidl.js
│ │ ├── xml/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── xml.js
│ │ ├── xquery/
│ │ │ ├── index.html
│ │ │ ├── test.js
│ │ │ └── xquery.js
│ │ ├── yacas/
│ │ │ ├── index.html
│ │ │ └── yacas.js
│ │ ├── yaml/
│ │ │ ├── index.html
│ │ │ └── yaml.js
│ │ ├── yaml-frontmatter/
│ │ │ ├── index.html
│ │ │ └── yaml-frontmatter.js
│ │ └── z80/
│ │ ├── index.html
│ │ └── z80.js
│ ├── package.json
│ ├── rollup.config.js
│ ├── src/
│ │ ├── codemirror.js
│ │ ├── display/
│ │ │ ├── Display.js
│ │ │ ├── focus.js
│ │ │ ├── gutters.js
│ │ │ ├── highlight_worker.js
│ │ │ ├── line_numbers.js
│ │ │ ├── mode_state.js
│ │ │ ├── operations.js
│ │ │ ├── scroll_events.js
│ │ │ ├── scrollbars.js
│ │ │ ├── scrolling.js
│ │ │ ├── selection.js
│ │ │ ├── update_display.js
│ │ │ ├── update_line.js
│ │ │ ├── update_lines.js
│ │ │ └── view_tracking.js
│ │ ├── edit/
│ │ │ ├── CodeMirror.js
│ │ │ ├── commands.js
│ │ │ ├── deleteNearSelection.js
│ │ │ ├── drop_events.js
│ │ │ ├── fromTextArea.js
│ │ │ ├── global_events.js
│ │ │ ├── key_events.js
│ │ │ ├── legacy.js
│ │ │ ├── main.js
│ │ │ ├── methods.js
│ │ │ ├── mouse_events.js
│ │ │ ├── options.js
│ │ │ └── utils.js
│ │ ├── input/
│ │ │ ├── ContentEditableInput.js
│ │ │ ├── TextareaInput.js
│ │ │ ├── indent.js
│ │ │ ├── input.js
│ │ │ ├── keymap.js
│ │ │ ├── keynames.js
│ │ │ └── movement.js
│ │ ├── line/
│ │ │ ├── highlight.js
│ │ │ ├── line_data.js
│ │ │ ├── pos.js
│ │ │ ├── saw_special_spans.js
│ │ │ ├── spans.js
│ │ │ └── utils_line.js
│ │ ├── measurement/
│ │ │ ├── position_measurement.js
│ │ │ └── widgets.js
│ │ ├── model/
│ │ │ ├── Doc.js
│ │ │ ├── change_measurement.js
│ │ │ ├── changes.js
│ │ │ ├── chunk.js
│ │ │ ├── document_data.js
│ │ │ ├── history.js
│ │ │ ├── line_widget.js
│ │ │ ├── mark_text.js
│ │ │ ├── selection.js
│ │ │ └── selection_updates.js
│ │ ├── modes.js
│ │ └── util/
│ │ ├── StringStream.js
│ │ ├── bidi.js
│ │ ├── browser.js
│ │ ├── dom.js
│ │ ├── event.js
│ │ ├── feature_detection.js
│ │ ├── misc.js
│ │ └── operation_group.js
│ ├── test/
│ │ ├── comment_test.js
│ │ ├── contenteditable_test.js
│ │ ├── doc_test.js
│ │ ├── driver.js
│ │ ├── emacs_test.js
│ │ ├── html-hint-test.js
│ │ ├── index.html
│ │ ├── lint.js
│ │ ├── mode_test.css
│ │ ├── mode_test.js
│ │ ├── multi_test.js
│ │ ├── phantom_driver.js
│ │ ├── run.js
│ │ ├── scroll_test.js
│ │ ├── search_test.js
│ │ ├── sql-hint-test.js
│ │ ├── sublime_test.js
│ │ ├── test.js
│ │ └── vim_test.js
│ └── theme/
│ ├── 3024-day.css
│ ├── 3024-night.css
│ ├── abcdef.css
│ ├── ambiance-mobile.css
│ ├── ambiance.css
│ ├── base16-dark.css
│ ├── base16-light.css
│ ├── bespin.css
│ ├── blackboard.css
│ ├── cobalt.css
│ ├── colorforth.css
│ ├── darcula.css
│ ├── dracula.css
│ ├── duotone-dark.css
│ ├── duotone-light.css
│ ├── eclipse.css
│ ├── elegant.css
│ ├── erlang-dark.css
│ ├── gruvbox-dark.css
│ ├── hopscotch.css
│ ├── icecoder.css
│ ├── idea.css
│ ├── isotope.css
│ ├── lesser-dark.css
│ ├── liquibyte.css
│ ├── lucario.css
│ ├── material.css
│ ├── mbo.css
│ ├── mdn-like.css
│ ├── midnight.css
│ ├── monokai.css
│ ├── neat.css
│ ├── neo.css
│ ├── night.css
│ ├── oceanic-next.css
│ ├── panda-syntax.css
│ ├── paraiso-dark.css
│ ├── paraiso-light.css
│ ├── pastel-on-dark.css
│ ├── railscasts.css
│ ├── rubyblue.css
│ ├── seti.css
│ ├── shadowfox.css
│ ├── solarized.css
│ ├── ssms.css
│ ├── the-matrix.css
│ ├── tomorrow-night-bright.css
│ ├── tomorrow-night-eighties.css
│ ├── ttcn.css
│ ├── twilight.css
│ ├── vibrant-ink.css
│ ├── xq-dark.css
│ ├── xq-light.css
│ ├── yeti.css
│ └── zenburn.css
├── DMP/
│ ├── AUTHORS
│ ├── LICENSE
│ ├── METADATA
│ ├── diff_match_patch.py
│ └── diff_match_patch_uncompressed.js
├── JSHint/
│ ├── LICENSE
│ ├── README.md
│ └── jshint.js
└── SVG-Edit/
├── AUTHORS
├── LICENSE
├── METADATA
├── README.md
└── editor/
├── browser.js
├── canvg/
│ ├── canvg.js
│ └── rgbcolor.js
├── coords.js
├── draw.js
├── external/
│ └── dynamic-import-polyfill/
│ └── importModule.js
├── history.js
├── historyrecording.js
├── jquery-svg.js
├── layer.js
├── math.js
├── path.js
├── pathseg.js
├── recalculate.js
├── sanitize.js
├── select.js
├── svgcanvas.js
├── svgedit.js
├── svgtransformlist.js
├── svgutils.js
└── units.js
Showing preview only (287K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3704 symbols across 314 files)
FILE: core/core_11_$.utils.js
function doSpider (line 154) | function doSpider(object) {
FILE: core/core_12_$.utils.code.js
function fail (line 460) | function fail(message) {
function expressionForProperty (line 467) | function expressionForProperty(key) {
FILE: core/core_30_$.utils.command.js
function match (line 133) | function match(str) {
FILE: core/core_32_physical.js
function check (line 324) | function check(name) {
FILE: core/core_43_genetics_lab.js
function blend (line 307) | function blend(name) {
FILE: mobwrite/mobwrite_core.py
class Configuration (line 27) | class Configuration(dict):
method initConfig (line 28) | def initConfig(self, filename):
class TextObj (line 103) | class TextObj:
method __init__ (line 110) | def __init__(self, *args, **kwargs):
method setText (line 115) | def setText(self, newtext):
class ViewObj (line 128) | class ViewObj:
method __init__ (line 143) | def __init__(self, *args, **kwargs):
class MobWrite (line 156) | class MobWrite:
method parseRequest (line 157) | def parseRequest(self, data):
method applyPatches (line 263) | def applyPatches(self, viewobj, diffs, action):
FILE: mobwrite/mobwrite_core_test.py
class MobWriteCoreTest (line 25) | class MobWriteCoreTest(unittest.TestCase):
method setUp (line 27) | def setUp(self):
method tearDown (line 31) | def tearDown(self):
method testParseRequest (line 34) | def testParseRequest(self):
FILE: mobwrite/mobwrite_server.py
class TextObj (line 49) | class TextObj(mobwrite_core.TextObj):
method __init__ (line 61) | def __init__(self, *args, **kwargs):
method setText (line 74) | def setText(self, newText):
method cleanup (line 78) | def cleanup(self):
function fetch_textobj (line 105) | def fetch_textobj(name, view):
class ViewObj (line 130) | class ViewObj(mobwrite_core.ViewObj):
method __init__ (line 149) | def __init__(self, *args, **kwargs):
method cleanup (line 161) | def cleanup(self):
method nullify (line 178) | def nullify(self):
function fetch_viewobj (line 183) | def fetch_viewobj(username, filename):
class DaemonMobWrite (line 206) | class DaemonMobWrite(BaseHTTPRequestHandler, mobwrite_core.MobWrite):
method do_POST (line 208) | def do_POST(self):
method send_headers (line 243) | def send_headers(self, code):
method handleRequest (line 252) | def handleRequest(self, text):
method doActions (line 257) | def doActions(self, actions):
method generateDiffs (line 392) | def generateDiffs(self, viewobj, print_username, print_filename, force):
function cleanup_thread (line 449) | def cleanup_thread():
function main (line 463) | def main():
FILE: server/externs/node.js
function require (line 47) | function require(name) {}
FILE: server/interpreter.js
function hook (line 5761) | function hook(error) {
function walk (line 5970) | function walk(node) {
FILE: server/iterable_weakmap.js
class Cell (line 28) | class Cell {
method constructor (line 33) | constructor(ref, value) {
class IterableWeakMap (line 49) | class IterableWeakMap extends WeakMap {
method constructor (line 53) | constructor(iterable = undefined) {
method clear (line 88) | clear() {
method delete (line 102) | delete(key) {
method entries (line 115) | *entries() {
method forEach (line 137) | forEach(callback, thisArg = undefined) {
method get (line 149) | get(key) {
method keys (line 158) | *keys() {
method set (line 173) | set(key, value) {
method size (line 189) | get size() {
method values (line 197) | *values() {
FILE: server/iterable_weakset.js
class IterableWeakSet (line 33) | class IterableWeakSet {
method constructor (line 37) | constructor(iterable = undefined) {
method add (line 75) | add(value) {
method clear (line 90) | clear() {
method delete (line 104) | delete(value) {
method entries (line 117) | *entries() {
method forEach (line 133) | forEach(callback, thisArg = undefined) {
method has (line 144) | has(value) {
method size (line 151) | get size() {
method values (line 159) | *values() {
FILE: server/priorityqueue.js
function parent (line 39) | function parent(i) {
function children (line 50) | function children(i) {
class PriorityQueue (line 59) | class PriorityQueue {
method constructor (line 60) | constructor() {
method deleteMin (line 71) | deleteMin() {
method insert (line 93) | insert(value, priority) {
method length (line 98) | get length() {
method percolateDown_ (line 108) | percolateDown_(i) {
method percolateUp_ (line 133) | percolateUp_(i) {
method reducePriority (line 153) | reducePriority(value, priority) {
method set (line 165) | set(value, priority) {
FILE: server/registry.js
class Registry (line 41) | class Registry {
method constructor (line 42) | constructor() {
method entries (line 53) | entries() {
method get (line 63) | get(key) {
method getKey (line 77) | getKey(value) {
method has (line 86) | has(key) {
method keys (line 94) | keys() {
method set (line 104) | set(key, value) {
method values (line 119) | values() {
FILE: server/serialize.js
function decodeValue (line 140) | function decodeValue(value) {
function encodeValue (line 305) | function encodeValue(value) {
FILE: server/startup/es6.js
function toInteger (line 242) | function toInteger(value) {
function toLength (line 252) | function toLength(value) {
FILE: server/startup/esx.js
function toInteger (line 104) | function toInteger(value) {
function toLength (line 114) | function toLength(value) {
FILE: server/tests/db/test_01_es5.js
function is (line 418) | function is(x, y) {
function arca (line 480) | function arca(a, b) {
function aeca (line 565) | function aeca(a, b) {
function aseca (line 568) | function aseca(a, b) {
function checkLen (line 970) | function checkLen(exp, desc) {
function checkIdx (line 1013) | function checkIdx(idx, exp, desc) {
function F (line 1130) | function F(){}
function F (line 1138) | function F() {}
function F (line 1153) | function F() {}
function f (line 1224) | function f() {
function makeAdder (line 1269) | function makeAdder(x) {
function T (line 1350) | function T(x, y) { this.sum += x + y; }
function T (line 1357) | function T() { return {}; }
function T (line 1363) | function T() { return 0; }
function log (line 1419) | function log(x) {
function t (line 1430) | function t() { throw {name: 'args'}; }
function check (line 1439) | function check(v) {
function f (line 1913) | function f() { return this; }
function f (line 1919) | function f() { n += arguments.length; }
function f (line 1975) | function f() { return this; }
function f (line 1980) | function f() { return arguments.length; }
function f (line 2008) | function f() { return this; }
function f (line 2013) | function f() { return arguments.length; }
function Foo (line 2028) | function Foo() {constructed = (this instanceof Foo)}
function Foo (line 2037) | function Foo() {constructed = (this instanceof Foo)}
function Foo (line 2046) | function Foo() {invoked = true;}
FILE: server/tests/db/test_01_es6.js
function isCherries (line 211) | function isCherries(fruit) {
function isCherries (line 224) | function isCherries(fruit) {
function expectError (line 518) | function expectError(method, thisVal, args) {
FILE: server/tests/db/test_02_errors.js
function foo (line 40) | function foo() {
function bar (line 55) | function bar() {
FILE: server/tests/db/test_10_fibonacci.js
function test_fibonacci10k (line 25) | function test_fibonacci10k() {
FILE: server/tests/dumper_test.js
class MockWritable (line 40) | class MockWritable {
method constructor (line 41) | constructor() {
method write (line 47) | write(chunk) {
method toString (line 52) | toString() {
function doCases (line 266) | function doCases(cases) {
FILE: server/tests/interpreter_bench.js
function runBench (line 37) | function runBench(b, name, setup, timed) {
FILE: server/tests/interpreter_test.js
function runSimpleTest (line 53) | function runSimpleTest(t, name, src, expected) {
function runTest (line 81) | function runTest(t, name, src, expected, options) {
function runAsyncTest (line 130) | async function runAsyncTest(t, name, src, expected, options) {
function createAsync (line 711) | function createAsync(intrp) {
function snooze (line 1039) | function snooze(ms) {
function createSend (line 1325) | function createSend(intrp) {
function createReceive (line 1355) | function createReceive(intrp) {
function createPauseAndSend (line 1497) | function createPauseAndSend(intrp) {
function createStopAndSend (line 1527) | function createStopAndSend(intrp) {
FILE: server/tests/iterable_weakmap_test.js
function gcAndFinalise (line 35) | async function gcAndFinalise() {
FILE: server/tests/iterable_weakset_test.js
function gcAndFinalise (line 35) | async function gcAndFinalise() {
FILE: server/tests/priorityqueue_test.js
function checkInvariants (line 76) | function checkInvariants(t, pq, note) {
FILE: server/tests/run.js
function runBenchmarks (line 57) | async function runBenchmarks(files) {
function runTests (line 80) | async function runTests(files) {
function getFiles (line 108) | function getFiles(pattern) {
FILE: server/tests/serialize_bench.js
function runSerializationBench (line 43) | function runSerializationBench(b, name, src, initFunc) {
function runDeserializationBench (line 83) | function runDeserializationBench(b, name, src, initFunc) {
function runInterpreterBench (line 114) | function runInterpreterBench(b, name, src) {
FILE: server/tests/serialize_test.js
function roundTrip (line 43) | function roundTrip(intrp) {
function runTest (line 73) | function runTest(t, name, src1, src2, src3, expected, options) {
function runAsyncTest (line 163) | async function runAsyncTest(t, name, src1, src2, expected, options) {
FILE: server/tests/testing.js
function B (line 32) | function B() {
function T (line 109) | function T() {
FILE: static/code/code.js
constant CLIPBOARD_ID (line 99) | const CLIPBOARD_ID = 'svgedit_clipboard';
function flashStorage (line 105) | function flashStorage () {
function storageChange (line 118) | function storageChange(ev) {
FILE: static/code/common.js
function decodeUnicode (line 208) | function decodeUnicode(m, p1) {
FILE: static/code/tests/test.js
function testCommonSelectorToParts (line 13) | function testCommonSelectorToParts() {
function testCommonPartsToSelector (line 18) | function testCommonPartsToSelector() {
function testCommonSelectorToReference (line 23) | function testCommonSelectorToReference() {
function testGetPrefix (line 30) | function testGetPrefix() {
function testAutocompletePrefix (line 45) | function testAutocompletePrefix() {
FILE: static/connect/prettify.js
function T (line 18) | function T(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var...
function U (line 22) | function U(a,d){function f(a){var c=a.nodeType;if(1==c){if(!b.test(a.cla...
function J (line 23) | function J(a,d,f,b,v){f&&(a={h:a,l:1,j:null,m:null,a:f,c:null,i:d,g:null...
function V (line 23) | function V(a){for(var d=void 0,f=a.firstChild;f;f=f.nextSibling)var b=f....
function G (line 23) | function G(a,d){function f(a){for(var l=a.i,m=a.h,c=[l,"pln"],p=0,w=a.a....
function y (line 25) | function y(a){var d=[],f=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\...
function L (line 29) | function L(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!A.test(a.clas...
function t (line 31) | function t(a,d){for(var f=d.length;0<=--f;){var b=d[f];I.hasOwnProperty(...
function K (line 31) | function K(a,d){a&&I.hasOwnProperty(a)||(a=/^\s*</.test(d)?
function M (line 32) | function M(a){var d=a.j;try{var f=U(a.h,a.l),b=f.a;a.a=b;a.c=f.c;a.i=0;K...
function f (line 43) | function f(){for(var b=E.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity...
FILE: static/connect/tests/test.js
function testCommonEscapeSpaces (line 15) | function testCommonEscapeSpaces() {
function testLogGetTemplate (line 23) | function testLogGetTemplate() {
function testWorldGetTemplate (line 43) | function testWorldGetTemplate() {
function testWorldWrap (line 58) | function testWorldWrap() {
FILE: static/connect/world.js
function wrapForWidth (line 1887) | function wrapForWidth(width) {
FILE: static/securitystore/utils.js
function formattedPrice (line 4) | function formattedPrice(number) {
function renderPrices (line 12) | function renderPrices() {
FILE: third_party/CodeMirror/addon/comment/comment.js
function firstNonWS (line 18) | function firstNonWS(str) {
function probablyInsideString (line 48) | function probablyInsideString(cm, pos, line) {
function getMode (line 52) | function getMode(cm, pos) {
FILE: third_party/CodeMirror/addon/comment/continuecomment.js
function continueComment (line 12) | function continueComment(cm) {
function continueLineCommentEnabled (line 57) | function continueLineCommentEnabled(cm) {
FILE: third_party/CodeMirror/addon/dialog/dialog.js
function dialogDiv (line 14) | function dialogDiv(cm, template, bottom) {
function closeNotification (line 32) | function closeNotification(cm, newVal) {
function close (line 45) | function close(newVal) {
function close (line 104) | function close() {
function close (line 143) | function close() {
FILE: third_party/CodeMirror/addon/display/autorefresh.js
function startListening (line 23) | function startListening(cm, state) {
function stopListening (line 42) | function stopListening(_cm, state) {
FILE: third_party/CodeMirror/addon/display/fullscreen.js
function setFullscreen (line 21) | function setFullscreen(cm) {
function setNormal (line 32) | function setNormal(cm) {
FILE: third_party/CodeMirror/addon/display/panel.js
function Panel (line 51) | function Panel(cm, node, options, height) {
function initPanels (line 77) | function initPanels(cm) {
function removePanels (line 111) | function removePanels(cm) {
function isAtTop (line 122) | function isAtTop(cm, dom) {
FILE: third_party/CodeMirror/addon/display/placeholder.js
function clearPlaceholder (line 31) | function clearPlaceholder(cm) {
function setPlaceholder (line 37) | function setPlaceholder(cm) {
function onBlur (line 49) | function onBlur(cm) {
function onChange (line 52) | function onChange(cm) {
function isEmpty (line 60) | function isEmpty(cm) {
FILE: third_party/CodeMirror/addon/display/rulers.js
function drawRulers (line 28) | function drawRulers(cm) {
FILE: third_party/CodeMirror/addon/edit/closebrackets.js
function getOption (line 32) | function getOption(conf, name) {
function ensureBound (line 39) | function ensureBound(chars) {
function handler (line 47) | function handler(ch) {
function getConfig (line 51) | function getConfig(cm) {
function handleBackspace (line 58) | function handleBackspace(cm) {
function handleEnter (line 75) | function handleEnter(cm) {
function contractSelection (line 99) | function contractSelection(sel) {
function handleChar (line 105) | function handleChar(cm, ch) {
function charsAround (line 176) | function charsAround(cm, pos) {
function stringStartsAfter (line 182) | function stringStartsAfter(cm, pos) {
FILE: third_party/CodeMirror/addon/edit/closetag.js
function autoCloseGT (line 53) | function autoCloseGT(cm) {
function autoCloseCurrent (line 99) | function autoCloseCurrent(cm, typingSlash) {
function autoCloseSlash (line 141) | function autoCloseSlash(cm) {
function indexOf (line 148) | function indexOf(collection, elt) {
function closingTagExists (line 157) | function closingTagExists(cm, tagName, pos, state, newTag) {
FILE: third_party/CodeMirror/addon/edit/continuelist.js
function incrementRemainingMarkdownListNumbers (line 55) | function incrementRemainingMarkdownListNumbers(cm, pos) {
FILE: third_party/CodeMirror/addon/edit/matchbrackets.js
function bracketRegex (line 19) | function bracketRegex(config) {
function findMatchingBracket (line 23) | function findMatchingBracket(cm, where, config) {
function scanForBracket (line 54) | function scanForBracket(cm, where, dir, style, config) {
function matchBrackets (line 81) | function matchBrackets(cm, autoclear, config) {
function doMatchBrackets (line 110) | function doMatchBrackets(cm) {
FILE: third_party/CodeMirror/addon/edit/matchtags.js
function clear (line 28) | function clear(cm) {
function doMatchTags (line 34) | function doMatchTags(cm) {
function maybeUpdateMatch (line 55) | function maybeUpdateMatch(cm) {
FILE: third_party/CodeMirror/addon/fold/brace-fold.js
function findOpening (line 18) | function findOpening(openCh) {
function hasImport (line 63) | function hasImport(line) {
function hasInclude (line 87) | function hasInclude(line) {
FILE: third_party/CodeMirror/addon/fold/foldcode.js
function doFold (line 14) | function doFold(cm, pos, options, force) {
function makeWidget (line 61) | function makeWidget(cm, options) {
function getOption (line 140) | function getOption(cm, options, name) {
FILE: third_party/CodeMirror/addon/fold/foldgutter.js
function State (line 39) | function State(options) {
function parseOptions (line 44) | function parseOptions(opts) {
function isFolded (line 52) | function isFolded(cm, line) {
function marker (line 58) | function marker(spec) {
function updateFoldInfo (line 68) | function updateFoldInfo(cm, from, to) {
function updateInViewport (line 87) | function updateInViewport(cm) {
function onGutterClick (line 96) | function onGutterClick(cm, line, gutter) {
function onChange (line 106) | function onChange(cm) {
function onViewportChange (line 115) | function onViewportChange(cm) {
function onFold (line 139) | function onFold(cm, from) {
FILE: third_party/CodeMirror/addon/fold/indent-fold.js
function lineIndent (line 14) | function lineIndent(cm, lineNo) {
FILE: third_party/CodeMirror/addon/fold/markdown-fold.js
function isHeader (line 17) | function isHeader(lineNo) {
function headerLevel (line 22) | function headerLevel(lineNo, line, nextLine) {
FILE: third_party/CodeMirror/addon/fold/xml-fold.js
function cmp (line 15) | function cmp(a, b) { return a.line - b.line || a.ch - b.ch; }
function Iter (line 21) | function Iter(cm, line, ch, range) {
function tagAt (line 28) | function tagAt(iter, ch) {
function nextLine (line 33) | function nextLine(iter) {
function prevLine (line 39) | function prevLine(iter) {
function toTagEnd (line 46) | function toTagEnd(iter) {
function toTagStart (line 57) | function toTagStart(iter) {
function toNextTag (line 69) | function toNextTag(iter) {
function toPrevTag (line 79) | function toPrevTag(iter) {
function findMatchingClose (line 91) | function findMatchingClose(iter, tag) {
function findMatchingOpen (line 112) | function findMatchingOpen(iter, tag) {
FILE: third_party/CodeMirror/addon/hint/css-hint.js
function add (line 35) | function add(keywords) {
FILE: third_party/CodeMirror/addon/hint/html-hint.js
function populate (line 334) | function populate(obj) {
function htmlHint (line 344) | function htmlHint(cm, options) {
FILE: third_party/CodeMirror/addon/hint/javascript-hint.js
function forEach (line 14) | function forEach(arr, f) {
function arrayContains (line 18) | function arrayContains(arr, item) {
function scriptHint (line 31) | function scriptHint(editor, keywords, getToken, options) {
function javascriptHint (line 62) | function javascriptHint(editor, options) {
function getCoffeeScriptToken (line 69) | function getCoffeeScriptToken(editor, cur) {
function coffeescriptHint (line 87) | function coffeescriptHint(editor, options) {
function forAllProps (line 102) | function forAllProps(obj, callback) {
function getCompletions (line 111) | function getCompletions(token, context, keywords, options) {
FILE: third_party/CodeMirror/addon/hint/show-hint.js
function Completion (line 55) | function Completion(cm, options) {
function parseOptions (line 143) | function parseOptions(cm, pos, options) {
function getText (line 155) | function getText(completion) {
function buildKeyMap (line 160) | function buildKeyMap(completion, handle) {
function getHintElement (line 201) | function getHintElement(hintsElement, el) {
function Widget (line 208) | function Widget(completion, data) {
function applicableHelpers (line 366) | function applicableHelpers(cm, helpers) {
function fetchHints (line 374) | function fetchHints(hint, cm, options, callback) {
function resolveAutoHints (line 384) | function resolveAutoHints(cm, pos) {
FILE: third_party/CodeMirror/addon/hint/sql-hint.js
function isArray (line 24) | function isArray(val) { return Object.prototype.toString.call(val) == "[...
function getKeywords (line 26) | function getKeywords(editor) {
function getIdentifierQuote (line 32) | function getIdentifierQuote(editor) {
function getText (line 38) | function getText(item) {
function wrapTable (line 42) | function wrapTable(name, value) {
function parseTables (line 48) | function parseTables(input) {
function getTable (line 62) | function getTable(name) {
function shallowClone (line 66) | function shallowClone(object) {
function match (line 73) | function match(string, word) {
function addMatches (line 79) | function addMatches(result, search, wordlist, formatter) {
function cleanName (line 95) | function cleanName(name) {
function insertIdentifierQuotes (line 108) | function insertIdentifierQuotes(name) {
function nameCompletion (line 122) | function nameCompletion(cur, token, result, editor) {
function eachWord (line 187) | function eachWord(lineText, f) {
function findTableByAlias (line 193) | function findTableByAlias(alias, editor) {
FILE: third_party/CodeMirror/addon/hint/xml-hint.js
function getHints (line 16) | function getHints(cm, options) {
FILE: third_party/CodeMirror/addon/lint/javascript-lint.js
function validator (line 15) | function validator(text, options) {
function parseErrors (line 32) | function parseErrors(errors, output) {
FILE: third_party/CodeMirror/addon/lint/lint.js
function showTooltip (line 15) | function showTooltip(e, content) {
function rm (line 31) | function rm(elt) {
function hideTooltip (line 34) | function hideTooltip(tt) {
function showTooltipFor (line 41) | function showTooltipFor(e, content, node) {
function LintState (line 58) | function LintState(cm, options, hasGutter) {
function parseOptions (line 67) | function parseOptions(_cm, options) {
function clearMarks (line 73) | function clearMarks(cm) {
function makeMarker (line 81) | function makeMarker(labels, severity, multiple, tooltips) {
function getMaxSeverity (line 96) | function getMaxSeverity(a, b) {
function groupByLine (line 101) | function groupByLine(annotations) {
function annotationTooltip (line 110) | function annotationTooltip(ann) {
function lintAsync (line 123) | function lintAsync(cm, getAnnotations, passOptions) {
function startLinting (line 139) | function startLinting(cm) {
function updateLinting (line 160) | function updateLinting(cm, annotationsNotSorted) {
function onChange (line 195) | function onChange(cm) {
function popupTooltips (line 202) | function popupTooltips(annotations, e) {
function onMouseOver (line 212) | function onMouseOver(cm, e) {
FILE: third_party/CodeMirror/addon/merge/merge.js
function DiffView (line 18) | function DiffView(mv, type) {
function ensureDiff (line 74) | function ensureDiff(dv) {
function registerUpdate (line 84) | function registerUpdate(dv) {
function registerScroll (line 149) | function registerScroll(dv, otherDv) {
function syncScroll (line 159) | function syncScroll(dv, toOrig) {
function getOffsets (line 205) | function getOffsets(editor, around) {
function setScrollLock (line 212) | function setScrollLock(dv, val, action) {
function removeClass (line 220) | function removeClass(editor, line, classes) {
function clearMarks (line 229) | function clearMarks(editor, arr, classes) {
function updateMarks (line 241) | function updateMarks(editor, diff, state, type, classes) {
function addClass (line 261) | function addClass(editor, lineNr, classes, main, start, end) {
function markChanges (line 271) | function markChanges(editor, diff, type, marks, from, to, classes) {
function makeConnections (line 315) | function makeConnections(dv) {
function getMatchingOrigLine (line 337) | function getMatchingOrigLine(editLine, chunks) {
function alignableFor (line 352) | function alignableFor(cm, chunks, isOrig) {
function mergeAlignable (line 374) | function mergeAlignable(result, origAlignable, chunks, setIndex) {
function findAlignedLines (line 409) | function findAlignedLines(dv, other) {
function alignChunks (line 426) | function alignChunks(dv, force) {
function alignLines (line 458) | function alignLines(cm, lines, aligners) {
function padAbove (line 472) | function padAbove(cm, line, size) {
function drawConnectorsForChunk (line 484) | function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) {
function copyChunk (line 521) | function copyChunk(dv, to, from, chunk) {
function buildGap (line 596) | function buildGap(dv) {
function asString (line 641) | function asString(obj) {
function getDiff (line 648) | function getDiff(a, b, ignoreWhitespace) {
function getChunks (line 665) | function getChunks(diff) {
function endOfLineClean (line 693) | function endOfLineClean(diff, i) {
function startOfLineClean (line 702) | function startOfLineClean(diff, i) {
function chunkBoundariesAround (line 711) | function chunkBoundariesAround(chunks, n, nInEdit) {
function collapseSingle (line 727) | function collapseSingle(cm, from, to) {
function collapseStretch (line 749) | function collapseStretch(size, editors) {
function unclearNearChunks (line 763) | function unclearNearChunks(dv, margin, off, clear) {
function collapseIdenticalStretches (line 773) | function collapseIdenticalStretches(mv, margin) {
function elt (line 797) | function elt(tag, content, className, style) {
function clear (line 806) | function clear(node) {
function attrs (line 811) | function attrs(elt) {
function copyObj (line 816) | function copyObj(obj, target) {
function moveOver (line 822) | function moveOver(pos, str, copy, other) {
function TrackAlignable (line 841) | function TrackAlignable(cm) {
function posMin (line 961) | function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a ...
function posMax (line 962) | function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a ...
function posEq (line 963) | function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
function findPrevDiff (line 965) | function findPrevDiff(chunks, start, isOrig) {
function findNextDiff (line 973) | function findNextDiff(chunks, start, isOrig) {
function goNearbyDiff (line 981) | function goNearbyDiff(cm, dir) {
FILE: third_party/CodeMirror/addon/mode/loadmode.js
function splitCallback (line 15) | function splitCallback(cont, n) {
function ensureDeps (line 19) | function ensureDeps(mode, cont) {
FILE: third_party/CodeMirror/addon/mode/multiplex.js
function indexOf (line 18) | function indexOf(string, pattern, from, returnEnd) {
FILE: third_party/CodeMirror/addon/mode/multiplex_test.js
function MT (line 22) | function MT(name) {
FILE: third_party/CodeMirror/addon/mode/simple.js
function ensureState (line 61) | function ensureState(states, name) {
function toRegex (line 66) | function toRegex(val, caret) {
function asToken (line 78) | function asToken(val) {
function Rule (line 88) | function Rule(data, states) {
function tokenFunction (line 95) | function tokenFunction(states, config) {
function cmp (line 158) | function cmp(a, b) {
function enterLocalMode (line 170) | function enterLocalMode(config, state, spec, token) {
function indexOf (line 186) | function indexOf(val, arr) {
function indentFunction (line 190) | function indentFunction(states, meta) {
FILE: third_party/CodeMirror/addon/runmode/colorize.js
function textContent (line 16) | function textContent(node, out) {
FILE: third_party/CodeMirror/addon/runmode/runmode-standalone.js
function splitLines (line 9) | function splitLines(string){ return string.split(/\r?\n|\r/); }
function StringStream (line 11) | function StringStream(string) {
FILE: third_party/CodeMirror/addon/runmode/runmode.node.js
function splitLines (line 6) | function splitLines(string){return string.split(/\r\n?|\n/);}
function StringStream (line 25) | function StringStream(string, tabSize, context) {
function copyObj (line 130) | function copyObj(obj, target, overwrite) {
FILE: third_party/CodeMirror/addon/scroll/annotatescrollbar.js
function Annotation (line 21) | function Annotation(cm, options) {
function getY (line 75) | function getY(pos, top) {
FILE: third_party/CodeMirror/addon/scroll/scrollpastend.js
function onChange (line 28) | function onChange(cm, change) {
function updateBottomMargin (line 33) | function updateBottomMargin(cm) {
FILE: third_party/CodeMirror/addon/scroll/simplescrollbars.js
function Bar (line 14) | function Bar(cls, orientation, scroll) {
function SimpleScrollbars (line 96) | function SimpleScrollbars(cls, place, scroll) {
FILE: third_party/CodeMirror/addon/search/jump-to-line.js
function dialog (line 16) | function dialog(cm, text, shortText, deflt, f) {
function getJumpDialog (line 21) | function getJumpDialog(cm) {
function interpretLine (line 25) | function interpretLine(cm, string) {
FILE: third_party/CodeMirror/addon/search/match-highlighter.js
function State (line 42) | function State(options) {
function cursorActivity (line 71) | function cursorActivity(cm) {
function onFocus (line 76) | function onFocus(cm) {
function scheduleHighlight (line 84) | function scheduleHighlight(cm, state) {
function addOverlay (line 89) | function addOverlay(cm, query, hasBoundary, style) {
function removeOverlay (line 99) | function removeOverlay(cm) {
function highlightMatches (line 111) | function highlightMatches(cm) {
function isWord (line 134) | function isWord(cm, from, to) {
function boundariesAround (line 151) | function boundariesAround(stream, re) {
function makeOverlay (line 156) | function makeOverlay(query, hasBoundary, style) {
FILE: third_party/CodeMirror/addon/search/matchesonscrollbar.js
function SearchAnnotation (line 20) | function SearchAnnotation(cm, query, caseFold, options) {
function offsetLine (line 60) | function offsetLine(line, changeStart, sizeChange) {
FILE: third_party/CodeMirror/addon/search/search.js
function searchOverlay (line 22) | function searchOverlay(query, caseInsensitive) {
function SearchState (line 42) | function SearchState() {
function getSearchState (line 47) | function getSearchState(cm) {
function queryCaseInsensitive (line 51) | function queryCaseInsensitive(query) {
function getSearchCursor (line 55) | function getSearchCursor(cm, query, pos) {
function persistentDialog (line 60) | function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
function dialog (line 70) | function dialog(cm, text, shortText, deflt, f) {
function confirmDialog (line 75) | function confirmDialog(cm, text, shortText, fs) {
function parseString (line 80) | function parseString(string) {
function parseQuery (line 88) | function parseQuery(query) {
function startSearch (line 101) | function startSearch(cm, state, query) {
function doSearch (line 113) | function doSearch(cm, rev, persistent, immediate) {
function findNext (line 164) | function findNext(cm, rev, callback) {cm.operation(function() {
function clearSearch (line 177) | function clearSearch(cm) {cm.operation(function() {
function getQueryDialog (line 187) | function getQueryDialog(cm) {
function getReplaceQueryDialog (line 190) | function getReplaceQueryDialog(cm) {
function getReplacementQueryDialog (line 193) | function getReplacementQueryDialog(cm) {
function getDoReplaceConfirm (line 196) | function getDoReplaceConfirm(cm) {
function replaceAll (line 200) | function replaceAll(cm, query, text) {
function replace (line 211) | function replace(cm, all) {
FILE: third_party/CodeMirror/addon/search/searchcursor.js
function regexpFlags (line 15) | function regexpFlags(regexp) {
function ensureFlags (line 22) | function ensureFlags(regexp, flags) {
function maybeMultiline (line 29) | function maybeMultiline(regexp) {
function searchRegexpForward (line 33) | function searchRegexpForward(doc, regexp, start) {
function searchRegexpForwardMultiline (line 45) | function searchRegexpForwardMultiline(doc, regexp, start) {
function lastMatchIn (line 75) | function lastMatchIn(string, regexp) {
function searchRegexpBackward (line 87) | function searchRegexpBackward(doc, regexp, start) {
function searchRegexpBackwardMultiline (line 100) | function searchRegexpBackwardMultiline(doc, regexp, start) {
function adjustPos (line 133) | function adjustPos(orig, folded, pos, foldFunc) {
function searchStringForward (line 145) | function searchStringForward(doc, query, start, caseFold) {
function searchStringBackward (line 173) | function searchStringBackward(doc, query, start, caseFold) {
function SearchCursor (line 200) | function SearchCursor(doc, query, pos, options) {
FILE: third_party/CodeMirror/addon/selection/active-line.js
function clearActiveLines (line 32) | function clearActiveLines(cm) {
function sameArray (line 40) | function sameArray(a, b) {
function updateActiveLines (line 47) | function updateActiveLines(cm, ranges) {
function selectionChange (line 69) | function selectionChange(cm, sel) {
FILE: third_party/CodeMirror/addon/selection/mark-selection.js
function onCursorActivity (line 36) | function onCursorActivity(cm) {
function onChange (line 41) | function onChange(cm) {
function coverRange (line 50) | function coverRange(cm, from, to, addAt) {
function clear (line 66) | function clear(cm) {
function reset (line 72) | function reset(cm) {
function update (line 79) | function update(cm) {
FILE: third_party/CodeMirror/addon/selection/selection-pointer.js
function mousemove (line 43) | function mousemove(cm, event) {
function mouseout (line 54) | function mouseout(cm, event) {
function reset (line 62) | function reset(cm) {
function scheduleUpdate (line 67) | function scheduleUpdate(cm) {
function update (line 77) | function update(cm) {
FILE: third_party/CodeMirror/addon/tern/tern.js
function getFile (line 150) | function getFile(ts, name, c) {
function findDoc (line 160) | function findDoc(ts, doc, name) {
function resolveDoc (line 172) | function resolveDoc(ts, id) {
function trackChange (line 178) | function trackChange(ts, doc, change) {
function sendDoc (line 198) | function sendDoc(ts, doc) {
function hint (line 207) | function hint(ts, cm, c) {
function typeToIcon (line 242) | function typeToIcon(type) {
function showContextInfo (line 254) | function showContextInfo(ts, cm, pos, queryName, c) {
function updateArgHints (line 277) | function updateArgHints(ts, cm) {
function showArgHints (line 319) | function showArgHints(ts, cm, pos) {
function parseFnType (line 344) | function parseFnType(text) {
function jumpToDef (line 377) | function jumpToDef(ts, cm) {
function jumpBack (line 405) | function jumpBack(ts, cm) {
function moveTo (line 411) | function moveTo(ts, curDoc, doc, start, end) {
function findContext (line 420) | function findContext(doc, data) {
function atInterestingExpression (line 450) | function atInterestingExpression(cm) {
function rename (line 458) | function rename(ts, cm) {
function selectName (line 469) | function selectName(ts, cm) {
function applyChanges (line 488) | function applyChanges(ts, changes) {
function buildRequest (line 508) | function buildRequest(ts, doc, query, pos) {
function getFragmentAround (line 550) | function getFragmentAround(data, start, end) {
function elt (line 581) | function elt(tagname, cls /*, ... elts*/) {
function dialog (line 592) | function dialog(cm, text, f) {
function tempTooltip (line 601) | function tempTooltip(cm, content, ts) {
function onEditorActivity (line 627) | function onEditorActivity(cm, f) {
function makeTooltip (line 640) | function makeTooltip(x, y, content) {
function remove (line 648) | function remove(node) {
function fadeOut (line 653) | function fadeOut(tooltip) {
function showError (line 658) | function showError(ts, cm, msg) {
function closeArgHints (line 665) | function closeArgHints(ts) {
function docValue (line 673) | function docValue(ts, doc) {
function WorkerServer (line 681) | function WorkerServer(ts) {
FILE: third_party/CodeMirror/addon/tern/worker.js
function getFile (line 26) | function getFile(file, c) {
function startServer (line 31) | function startServer(defs, plugins, scripts) {
FILE: third_party/CodeMirror/addon/wrap/hardwrap.js
function findParagraph (line 16) | function findParagraph(cm, pos, options) {
function findBreakPoint (line 32) | function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
function wrapRange (line 46) | function wrapRange(cm, from, to, options) {
FILE: third_party/CodeMirror/doc/activebookmark.js
function updateSoon (line 9) | function updateSoon() {
function update (line 16) | function update() {
FILE: third_party/CodeMirror/keymap/emacs.js
function posEq (line 15) | function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
function addToRing (line 20) | function addToRing(str) {
function growRingTop (line 24) | function growRingTop(str) {
function getFromRing (line 28) | function getFromRing(n) { return killRing[killRing.length - (n ? Math.mi...
function popFromRing (line 29) | function popFromRing() { if (killRing.length > 1) killRing.pop(); return...
function kill (line 33) | function kill(cm, from, to, ring, text) {
function byChar (line 48) | function byChar(cm, pos, dir) {
function byWord (line 52) | function byWord(cm, pos, dir) {
function byLine (line 56) | function byLine(cm, pos, dir) {
function byPage (line 60) | function byPage(cm, pos, dir) {
function byParagraph (line 64) | function byParagraph(cm, pos, dir) {
function bySentence (line 79) | function bySentence(cm, pos, dir) {
function byExpr (line 98) | function byExpr(cm, pos, dir) {
function getPrefix (line 119) | function getPrefix(cm, precise) {
function repeated (line 126) | function repeated(cmd) {
function findEnd (line 135) | function findEnd(cm, pos, by, dir) {
function move (line 146) | function move(by, dir) {
function killTo (line 154) | function killTo(cm, by, dir, ring) {
function killRegion (line 163) | function killRegion(cm, ring) {
function addPrefix (line 175) | function addPrefix(cm, digit) {
function maybeClearPrefix (line 188) | function maybeClearPrefix(cm, arg) {
function clearPrefix (line 193) | function clearPrefix(cm) {
function maybeDuplicateInput (line 199) | function maybeDuplicateInput(cm, event) {
function addPrefixMap (line 208) | function addPrefixMap(cm) {
function maybeRemovePrefixMap (line 215) | function maybeRemovePrefixMap(cm, arg) {
function setMark (line 225) | function setMark(cm) {
function clearMark (line 231) | function clearMark(cm) {
function getInput (line 236) | function getInput(cm, msg, f) {
function operateOnWord (line 243) | function operateOnWord(cm, op) {
function toEnclosingExpr (line 249) | function toEnclosingExpr(cm) {
function quit (line 269) | function quit(cm) {
function regPrefix (line 410) | function regPrefix(d) {
FILE: third_party/CodeMirror/keymap/sublime.js
function findPosSubword (line 21) | function findPosSubword(doc, start, dir) {
function moveSubword (line 43) | function moveSubword(cm, dir) {
function insertLine (line 101) | function insertLine(cm, above) {
function wordAt (line 123) | function wordAt(cm, pos) {
function addCursorToSelection (line 155) | function addCursorToSelection(cm, dir) {
function isSelectedRange (line 176) | function isSelectedRange(ranges, from, to) {
function selectBetweenBrackets (line 183) | function selectBetweenBrackets(cm) {
function sortLines (line 323) | function sortLines(cm, caseSensitive) {
function modifyWordOrSelection (line 425) | function modifyWordOrSelection(cm, mod) {
function getTarget (line 523) | function getTarget(cm) {
function findAndGoTo (line 534) | function findAndGoTo(cm, forward) {
FILE: third_party/CodeMirror/keymap/vim.js
function enterVimMode (line 247) | function enterVimMode(cm) {
function leaveVimMode (line 256) | function leaveVimMode(cm) {
function detachVimMap (line 263) | function detachVimMap(cm, next) {
function attachVimMap (line 275) | function attachVimMap(cm, prev) {
function fatCursorMarks (line 288) | function fatCursorMarks(cm) {
function updateFatCursorMark (line 307) | function updateFatCursorMark(cm) {
function enableFatCursorMark (line 313) | function enableFatCursorMark(cm) {
function disableFatCursorMark (line 318) | function disableFatCursorMark(cm) {
function cmKey (line 333) | function cmKey(key, cm) {
function cmKeyToVimKey (line 349) | function cmKeyToVimKey(key) {
function getOnPasteFn (line 382) | function getOnPasteFn(cm) {
function makeKeyRange (line 401) | function makeKeyRange(start, size) {
function isLine (line 414) | function isLine(cm, line) {
function isLowerCase (line 417) | function isLowerCase(k) {
function isMatchableSymbol (line 420) | function isMatchableSymbol(k) {
function isNumber (line 423) | function isNumber(k) {
function isUpperCase (line 426) | function isUpperCase(k) {
function isWhiteSpaceString (line 429) | function isWhiteSpaceString(k) {
function isEndOfSentenceSymbol (line 432) | function isEndOfSentenceSymbol(k) {
function inArray (line 435) | function inArray(val, arr) {
function defineOption (line 445) | function defineOption(name, defaultValue, type, aliases, callback) {
function setOption (line 465) | function setOption(name, value, cm, cfg) {
function getOption (line 497) | function getOption(name, cm, cfg) {
function add (line 540) | function add(cm, oldCur, newCur) {
function move (line 567) | function move(cm, offset) {
function MacroModeState (line 619) | function MacroModeState() {
function maybeInitVimState (line 651) | function maybeInitVimState(cm) {
function resetVimGlobalState (line 694) | function resetVimGlobalState() {
function toCtxArray (line 753) | function toCtxArray(ctx) {
function handleMacroRecording (line 853) | function handleMacroRecording() {
function handleEsc (line 866) | function handleEsc() {
function doKeyToKey (line 878) | function doKeyToKey(keys) {
function handleKeyInsertMode (line 891) | function handleKeyInsertMode() {
function handleKeyNonInsertMode (line 924) | function handleKeyNonInsertMode() {
function InputState (line 997) | function InputState() {
function clearInputState (line 1029) | function clearInputState(cm, reason) {
function Register (line 1040) | function Register(text, linewise, blockwise) {
function defineRegister (line 1088) | function defineRegister(name, register) {
function RegisterController (line 1108) | function RegisterController(registers) {
function HistoryController (line 1182) | function HistoryController() {
function handleQuery (line 1350) | function handleQuery(query, ignoreCase, smartCase) {
function onPromptClose (line 1366) | function onPromptClose(query) {
function onPromptKeyUp (line 1374) | function onPromptKeyUp(e, query, close) {
function onPromptKeyDown (line 1400) | function onPromptKeyDown(e, query, close) {
function onPromptClose (line 1470) | function onPromptClose(input) {
function onPromptKeyDown (line 1477) | function onPromptKeyDown(e, input, close) {
function defineMotion (line 2072) | function defineMotion(name, fn) {
function fillArray (line 2076) | function fillArray(val, times) {
function defineOperator (line 2240) | function defineOperator(name, fn) {
function defineAction (line 2776) | function defineAction(name, fn) {
function clipCursorToContent (line 2788) | function clipCursorToContent(cm, cur, includeLineBreak) {
function copyArgs (line 2795) | function copyArgs(args) {
function offsetCursor (line 2804) | function offsetCursor(cur, offsetLine, offsetCh) {
function getOffset (line 2811) | function getOffset(anchor, head) {
function commandMatches (line 2817) | function commandMatches(keys, keyMap, context, inputState) {
function commandMatch (line 2836) | function commandMatch(pressed, mapped) {
function lastChar (line 2849) | function lastChar(keys) {
function repeatFn (line 2867) | function repeatFn(cm, fn, repeat) {
function copyCursor (line 2874) | function copyCursor(cur) {
function cursorEqual (line 2877) | function cursorEqual(cur1, cur2) {
function cursorIsBefore (line 2880) | function cursorIsBefore(cur1, cur2) {
function cursorMin (line 2889) | function cursorMin(cur1, cur2) {
function cursorMax (line 2895) | function cursorMax(cur1, cur2) {
function cursorIsBetween (line 2901) | function cursorIsBetween(cur1, cur2, cur3) {
function lineLength (line 2907) | function lineLength(cm, lineNum) {
function trim (line 2910) | function trim(s) {
function escapeRegex (line 2916) | function escapeRegex(s) {
function extendLineToColumn (line 2919) | function extendLineToColumn(cm, lineNum, column) {
function selectBlock (line 2931) | function selectBlock(cm, selectionEnd) {
function selectForInsert (line 2967) | function selectForInsert(cm, head, height) {
function getIndex (line 2976) | function getIndex(ranges, cursor, end) {
function getSelectedAreaRange (line 2986) | function getSelectedAreaRange(cm, vim) {
function updateLastSelection (line 3037) | function updateLastSelection(cm, vim) {
function expandSelection (line 3053) | function expandSelection(cm, start, end) {
function updateCmSelection (line 3080) | function updateCmSelection(cm, sel, mode) {
function makeCmSelection (line 3089) | function makeCmSelection(cm, sel, mode, exclusive) {
function getHead (line 3138) | function getHead(cm) {
function exitVisualMode (line 3153) | function exitVisualMode(cm, moveHead) {
function clipToLine (line 3172) | function clipToLine(cm, curStart, curEnd) {
function expandSelectionToLine (line 3201) | function expandSelectionToLine(_cm, curStart, curEnd) {
function findFirstNonWhiteSpaceCharacter (line 3207) | function findFirstNonWhiteSpaceCharacter(text) {
function expandWordUnderCursor (line 3215) | function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbo...
function recordJumpPosition (line 3256) | function recordJumpPosition(cm, oldCur, newCur) {
function recordLastCharacterSearch (line 3262) | function recordLastCharacterSearch(increment, args) {
function findSymbol (line 3340) | function findSymbol(cm, repeat, forward, symb) {
function findWord (line 3406) | function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
function moveToWord (line 3478) | function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) {
function moveToCharacter (line 3523) | function moveToCharacter(cm, repeat, forward, character) {
function moveToColumn (line 3538) | function moveToColumn(cm, repeat) {
function updateMark (line 3545) | function updateMark(cm, vim, markName, pos) {
function charIdxInLine (line 3555) | function charIdxInLine(start, line, character, forward, includeChar) {
function findParagraph (line 3576) | function findParagraph(cm, head, repeat, dir, inclusive) {
function findSentence (line 3624) | function findSentence(cm, cur, repeat, dir) {
function selectCompanionObject (line 3799) | function selectCompanionObject(cm, head, symb, inclusive) {
function findBeginningAndEnd (line 3846) | function findBeginningAndEnd(cm, head, symb, inclusive) {
function SearchState (line 3906) | function SearchState() {}
function getSearchState (line 3933) | function getSearchState(cm) {
function dialog (line 3937) | function dialog(cm, template, shortText, onClose, options) {
function splitBySlash (line 3947) | function splitBySlash(argString) {
function findUnescapedSlashes (line 3951) | function findUnescapedSlashes(argString) {
function splitBySeparator (line 3955) | function splitBySeparator(argString, separator) {
function findUnescapedSeparators (line 3968) | function findUnescapedSeparators(str, separator) {
function translateRegex (line 3985) | function translateRegex(str) {
function translateRegexReplace (line 4027) | function translateRegexReplace(str) {
function unescapeRegexReplace (line 4065) | function unescapeRegexReplace(str) {
function parseQuery (line 4099) | function parseQuery(query, ignoreCase, smartCase) {
function showConfirm (line 4133) | function showConfirm(cm, text) {
function makePrompt (line 4141) | function makePrompt(prefix, desc) {
function showPrompt (line 4149) | function showPrompt(cm, options) {
function regexEqual (line 4154) | function regexEqual(r1, r2) {
function updateSearchQuery (line 4168) | function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
function searchOverlay (line 4184) | function searchOverlay(query) {
function highlightSearchMatches (line 4220) | function highlightSearchMatches(cm, query) {
function findNext (line 4238) | function findNext(cm, prev, query, repeat) {
function clearSearchHighlight (line 4259) | function clearSearchHighlight(cm) {
function isInRange (line 4279) | function isInRange(pos, start, end) {
function getUserVisibleLines (line 4294) | function getUserVisibleLines(cm) {
function getMarkPos (line 4304) | function getMarkPos(cm, vim, markName) {
function parseArgs (line 4690) | function parseArgs() {
function compareFn (line 4743) | function compareFn(a, b) {
function comparePatternFn (line 4753) | function comparePatternFn(a, b) {
function doReplace (line 5016) | function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor...
function exitInsertMode (line 5117) | function exitInsertMode(cm) {
function _mapCommand (line 5147) | function _mapCommand(command) {
function mapCommand (line 5151) | function mapCommand(keys, type, name, args, extra) {
function executeMacroRegister (line 5181) | function executeMacroRegister(cm, vim, macroModeState, registerName) {
function logKey (line 5217) | function logKey(macroModeState, key) {
function logInsertModeChange (line 5226) | function logInsertModeChange(macroModeState) {
function logSearchQuery (line 5235) | function logSearchQuery(macroModeState, query) {
function onChange (line 5248) | function onChange(cm, changeObj) {
function onCursorActivity (line 5283) | function onCursorActivity(cm) {
function updateFakeCursor (line 5303) | function updateFakeCursor(cm) {
function handleExternalSelection (line 5312) | function handleExternalSelection(cm, vim) {
function InsertModeKey (line 5343) | function InsertModeKey(keyName) {
function onKeyEventTargetKeyDown (line 5352) | function onKeyEventTargetKeyDown(e) {
function repeatLastEdit (line 5379) | function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
function repeatInsertModeChanges (line 5426) | function repeatInsertModeChanges(cm, changes, repeat) {
FILE: third_party/CodeMirror/lib/codemirror.js
function classTest (line 50) | function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)...
function removeChildren (line 61) | function removeChildren(e) {
function removeChildrenAndAdd (line 67) | function removeChildrenAndAdd(parent, e) {
function elt (line 71) | function elt(tag, content, className, style) {
function eltP (line 80) | function eltP(tag, content, className, style) {
function contains (line 103) | function contains(parent, child) {
function activeElt (line 114) | function activeElt() {
function addClass (line 129) | function addClass(node, cls) {
function joinClasses (line 133) | function joinClasses(a, b) {
function bind (line 146) | function bind(f) {
function copyObj (line 151) | function copyObj(obj, target, overwrite) {
function countColumn (line 161) | function countColumn(string, end, tabSize, startIndex, startValue) {
function indexOf (line 182) | function indexOf(array, elt) {
function findColumn (line 200) | function findColumn(string, goal, tabSize) {
function spaceStr (line 215) | function spaceStr(n) {
function lst (line 221) | function lst(arr) { return arr[arr.length-1] }
function map (line 223) | function map(array, f) {
function insertSorted (line 229) | function insertSorted(array, value, score) {
function nothing (line 235) | function nothing() {}
function createObj (line 237) | function createObj(base, props) {
function isWordCharBasic (line 250) | function isWordCharBasic(ch) {
function isWordChar (line 254) | function isWordChar(ch, helper) {
function isEmpty (line 260) | function isEmpty(obj) {
function isExtendingChar (line 271) | function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendi...
function skipExtendingChars (line 274) | function skipExtendingChars(str, pos, dir) {
function findFirst (line 282) | function findFirst(pred, from, to) {
function Display (line 299) | function Display(place, doc, input) {
function getLine (line 399) | function getLine(doc, n) {
function getBetween (line 415) | function getBetween(doc, start, end) {
function getLines (line 427) | function getLines(doc, from, to) {
function updateLineHeight (line 435) | function updateLineHeight(line, height) {
function lineNo (line 442) | function lineNo(line) {
function lineAtHeight (line 456) | function lineAtHeight(chunk, h) {
function isLine (line 476) | function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
function lineNumberFor (line 478) | function lineNumberFor(options, i) {
function Pos (line 483) | function Pos(line, ch, sticky) {
function cmp (line 494) | function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
function equalCursorPos (line 496) | function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b)...
function copyPos (line 498) | function copyPos(x) {return Pos(x.line, x.ch)}
function maxPos (line 499) | function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
function minPos (line 500) | function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
function clipLine (line 504) | function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.fi...
function clipPos (line 505) | function clipPos(doc, pos) {
function clipToLen (line 511) | function clipToLen(pos, linelen) {
function clipPosArray (line 517) | function clipPosArray(doc, array) {
function seeReadOnlySpans (line 526) | function seeReadOnlySpans() {
function seeCollapsedSpans (line 530) | function seeCollapsedSpans() {
function MarkedSpan (line 536) | function MarkedSpan(marker, from, to) {
function getMarkedSpanFor (line 542) | function getMarkedSpanFor(spans, marker) {
function removeMarkedSpan (line 550) | function removeMarkedSpan(spans, span) {
function addMarkedSpan (line 557) | function addMarkedSpan(line, span) {
function markedSpansBefore (line 566) | function markedSpansBefore(old, startCh, isInsert) {
function markedSpansAfter (line 578) | function markedSpansAfter(old, endCh, isInsert) {
function stretchSpansOverChange (line 598) | function stretchSpansOverChange(doc, change) {
function clearEmptySpans (line 660) | function clearEmptySpans(spans) {
function removeReadOnlyRanges (line 671) | function removeReadOnlyRanges(doc, from, to) {
function detachMarkedSpans (line 700) | function detachMarkedSpans(line) {
function attachMarkedSpans (line 707) | function attachMarkedSpans(line, spans) {
function extraLeft (line 716) | function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
function extraRight (line 717) | function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
function compareCollapsedMarkers (line 722) | function compareCollapsedMarkers(a, b) {
function collapsedSpanAtSide (line 735) | function collapsedSpanAtSide(line, start) {
function collapsedSpanAtStart (line 745) | function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, t...
function collapsedSpanAtEnd (line 746) | function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, fal...
function collapsedSpanAround (line 748) | function collapsedSpanAround(line, ch) {
function conflictingCollapsedRange (line 761) | function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {
function visualLine (line 781) | function visualLine(line) {
function visualLineEnd (line 788) | function visualLineEnd(line) {
function visualLineContinued (line 797) | function visualLineContinued(line) {
function visualLineNo (line 808) | function visualLineNo(doc, lineN) {
function visualLineEndNo (line 816) | function visualLineEndNo(doc, lineN) {
function lineIsHidden (line 828) | function lineIsHidden(doc, line) {
function lineIsHiddenInner (line 839) | function lineIsHiddenInner(doc, line, span) {
function heightAtLine (line 856) | function heightAtLine(lineObj) {
function lineLength (line 878) | function lineLength(line) {
function findMaxLine (line 897) | function findMaxLine(cm) {
function iterateBidiSections (line 913) | function iterateBidiSections(order, from, to, f) {
function getBidiPartAt (line 927) | function getBidiPartAt(order, ch, sticky) {
function charType (line 973) | function charType(code) {
function BidiSpan (line 986) | function BidiSpan(level, from, to) {
function getOrder (line 1118) | function getOrder(line, direction) {
function getHandlers (line 1142) | function getHandlers(emitter, type) {
function off (line 1146) | function off(emitter, type, f) {
function signal (line 1161) | function signal(emitter, type /*, values...*/) {
function signalDOMEvent (line 1171) | function signalDOMEvent(cm, e, override) {
function signalCursorActivity (line 1178) | function signalCursorActivity(cm) {
function hasHandler (line 1186) | function hasHandler(emitter, type) {
function eventMixin (line 1192) | function eventMixin(ctor) {
function e_preventDefault (line 1200) | function e_preventDefault(e) {
function e_stopPropagation (line 1204) | function e_stopPropagation(e) {
function e_defaultPrevented (line 1208) | function e_defaultPrevented(e) {
function e_stop (line 1211) | function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
function e_target (line 1213) | function e_target(e) {return e.target || e.srcElement}
function e_button (line 1214) | function e_button(e) {
function zeroWidthElement (line 1235) | function zeroWidthElement(measure) {
function hasBadBidiRects (line 1250) | function hasBadBidiRects(measure) {
function hasBadZoomedRects (line 1299) | function hasBadZoomedRects(measure) {
function defineMode (line 1313) | function defineMode(name, mode) {
function defineMIME (line 1319) | function defineMIME(mime, spec) {
function resolveMode (line 1325) | function resolveMode(spec) {
function getMode (line 1344) | function getMode(options, spec) {
function extendMode (line 1368) | function extendMode(mode, properties) {
function copyState (line 1373) | function copyState(mode, state) {
function innerMode (line 1387) | function innerMode(mode, state) {
function startState (line 1398) | function startState(mode, a1, a2) {
function highlightLine (line 1542) | function highlightLine(cm, line, context, forceToEnd) {
function getLineStyles (line 1587) | function getLineStyles(cm, line, updateFrontier) {
function getContextBefore (line 1603) | function getContextBefore(cm, n, precise) {
function processLine (line 1623) | function processLine(cm, text, context, startAt) {
function callBlankLine (line 1634) | function callBlankLine(mode, state) {
function readToken (line 1641) | function readToken(mode, stream, state, inner) {
function takeToken (line 1658) | function takeToken(cm, pos, precise, asArray) {
function extractLineClasses (line 1672) | function extractLineClasses(type, output) {
function runMode (line 1687) | function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
function findStartLine (line 1731) | function findStartLine(cm, n, precise) {
function retreatFrontier (line 1748) | function retreatFrontier(doc, n) {
function updateLine (line 1781) | function updateLine(line, text, markedSpans, estimateHeight) {
function cleanUpLine (line 1793) | function cleanUpLine(line) {
function interpretTokenStyle (line 1802) | function interpretTokenStyle(style, options) {
function buildLineContent (line 1814) | function buildLineContent(cm, lineView) {
function defaultSpecialCharPlaceholder (line 1872) | function defaultSpecialCharPlaceholder(ch) {
function buildToken (line 1881) | function buildToken(builder, text, style, startStyle, endStyle, css, att...
function splitSpaces (line 1948) | function splitSpaces(text, trailingBefore) {
function buildTokenBadBidi (line 1963) | function buildTokenBadBidi(inner, order) {
function buildCollapsedSpan (line 1983) | function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
function insertLineContent (line 2001) | function insertLineContent(line, builder, styles) {
function LineView (line 2080) | function LineView(doc, line, lineN) {
function buildViewArray (line 2092) | function buildViewArray(cm, from, to) {
function pushOperation (line 2104) | function pushOperation(op) {
function fireCallbacksForOps (line 2115) | function fireCallbacksForOps(group) {
function finishOperation (line 2131) | function finishOperation(op, endCb) {
function signalLater (line 2151) | function signalLater(emitter, type /*, values...*/) {
function fireOrphanDelayed (line 2171) | function fireOrphanDelayed() {
function updateLineForChanges (line 2180) | function updateLineForChanges(cm, lineView, lineN, dims) {
function ensureLineWrapped (line 2193) | function ensureLineWrapped(lineView) {
function updateLineBackground (line 2204) | function updateLineBackground(cm, lineView) {
function getLineContent (line 2219) | function getLineContent(cm, lineView) {
function updateLineText (line 2232) | function updateLineText(cm, lineView) {
function updateLineClasses (line 2247) | function updateLineClasses(cm, lineView) {
function updateLineGutter (line 2257) | function updateLineGutter(cm, lineView, lineN, dims) {
function updateLineWidgets (line 2295) | function updateLineWidgets(cm, lineView, dims) {
function buildLineElement (line 2306) | function buildLineElement(cm, lineView, lineN, dims) {
function insertLineWidgets (line 2320) | function insertLineWidgets(cm, lineView, dims) {
function insertLineWidgetsFor (line 2326) | function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
function positionLineWidget (line 2342) | function positionLineWidget(widget, node, lineView, dims) {
function widgetHeight (line 2360) | function widgetHeight(widget) {
function eventInWidget (line 2376) | function eventInWidget(display, e) {
function paddingTop (line 2386) | function paddingTop(display) {return display.lineSpace.offsetTop}
function paddingVert (line 2387) | function paddingVert(display) {return display.mover.offsetHeight - displ...
function paddingH (line 2388) | function paddingH(display) {
function scrollGap (line 2397) | function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
function displayWidth (line 2398) | function displayWidth(cm) {
function displayHeight (line 2401) | function displayHeight(cm) {
function ensureLineHeights (line 2409) | function ensureLineHeights(cm, lineView, rect) {
function mapFromLineView (line 2430) | function mapFromLineView(lineView, line, lineN) {
function updateExternalMeasurement (line 2443) | function updateExternalMeasurement(cm, line) {
function measureChar (line 2456) | function measureChar(cm, line, ch, bias) {
function findViewForLine (line 2461) | function findViewForLine(cm, lineN) {
function prepareMeasureForLine (line 2474) | function prepareMeasureForLine(cm, line) {
function measureCharPrepared (line 2496) | function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
function nodeAndOffsetInLineMap (line 2518) | function nodeAndOffsetInLineMap(map$$1, ch, bias) {
function getUsefulRect (line 2556) | function getUsefulRect(rects, bias) {
function measureCharInner (line 2566) | function measureCharInner(cm, prepared, ch, bias) {
function maybeUpdateRectForZooming (line 2619) | function maybeUpdateRectForZooming(measure, rect) {
function clearLineMeasurementCacheFor (line 2629) | function clearLineMeasurementCacheFor(lineView) {
function clearLineMeasurementCache (line 2638) | function clearLineMeasurementCache(cm) {
function clearCaches (line 2645) | function clearCaches(cm) {
function pageScrollX (line 2652) | function pageScrollX() {
function pageScrollY (line 2659) | function pageScrollY() {
function widgetTopHeight (line 2664) | function widgetTopHeight(lineObj) {
function intoCoordSystem (line 2675) | function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
function fromCoordSystem (line 2697) | function fromCoordSystem(cm, coords, context) {
function charCoords (line 2714) | function charCoords(cm, pos, context, lineObj, bias) {
function cursorCoords (line 2735) | function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHei...
function estimateCoords (line 2766) | function estimateCoords(cm, pos) {
function PosWithInfo (line 2781) | function PosWithInfo(line, ch, sticky, outside, xRel) {
function coordsChar (line 2790) | function coordsChar(cm, x, y) {
function wrappedLineExtent (line 2810) | function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
function wrappedLineExtentChar (line 2818) | function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
function boxIsAfter (line 2826) | function boxIsAfter(box, x, y, left) {
function coordsCharInner (line 2830) | function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {
function coordsBidiPart (line 2897) | function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, ...
function coordsBidiPartWrapped (line 2921) | function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, or...
function textHeight (line 2956) | function textHeight(display) {
function charWidth (line 2976) | function charWidth(display) {
function getDimensions (line 2988) | function getDimensions(cm) {
function compensateForHScroll (line 3005) | function compensateForHScroll(display) {
function estimateHeight (line 3012) | function estimateHeight(cm) {
function estimateLineHeights (line 3030) | function estimateLineHeights(cm) {
function posFromMouse (line 3043) | function posFromMouse(cm, e, liberal, forRect) {
function findViewIndex (line 3061) | function findViewIndex(cm, n) {
function updateSelection (line 3072) | function updateSelection(cm) {
function prepareSelection (line 3076) | function prepareSelection(cm, primary) {
function drawSelectionCursor (line 3097) | function drawSelectionCursor(cm, head, output) {
function cmpCoords (line 3115) | function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
function drawSelectionRange (line 3118) | function drawSelectionRange(cm, range$$1, output) {
function restartBlink (line 3211) | function restartBlink(cm) {
function ensureFocus (line 3224) | function ensureFocus(cm) {
function delayBlurEvent (line 3228) | function delayBlurEvent(cm) {
function onFocus (line 3236) | function onFocus(cm, e) {
function onBlur (line 3255) | function onBlur(cm, e) {
function updateHeightsInViewport (line 3269) | function updateHeightsInViewport(cm) {
function updateWidgetHeight (line 3309) | function updateWidgetHeight(line) {
function visibleLines (line 3319) | function visibleLines(display, doc, viewport) {
function alignHorizontally (line 3342) | function alignHorizontally(cm) {
function maybeUpdateLineNumberWidth (line 3365) | function maybeUpdateLineNumberWidth(cm) {
function maybeScrollWindow (line 3387) | function maybeScrollWindow(cm, rect) {
function scrollPosIntoView (line 3404) | function scrollPosIntoView(cm, pos, end, margin) {
function scrollIntoView (line 3438) | function scrollIntoView(cm, rect) {
function calculateScrollPos (line 3448) | function calculateScrollPos(cm, rect) {
function addToScrollTop (line 3478) | function addToScrollTop(cm, top) {
function ensureCursorVisible (line 3486) | function ensureCursorVisible(cm) {
function scrollToCoords (line 3492) | function scrollToCoords(cm, x, y) {
function scrollToRange (line 3498) | function scrollToRange(cm, range$$1) {
function resolveScrollToPos (line 3507) | function resolveScrollToPos(cm) {
function scrollToCoordsRange (line 3516) | function scrollToCoordsRange(cm, from, to, margin) {
function updateScrollTop (line 3528) | function updateScrollTop(cm, val) {
function setScrollTop (line 3536) | function setScrollTop(cm, val, forceScroll) {
function setScrollLeft (line 3546) | function setScrollLeft(cm, val, isScroller, forceScroll) {
function measureForScrollbars (line 3559) | function measureForScrollbars(cm) {
function maybeDisable (line 3651) | function maybeDisable() {
function updateScrollbars (line 3680) | function updateScrollbars(cm, measure) {
function updateScrollbarsInner (line 3694) | function updateScrollbarsInner(cm, measure) {
function initScrollbars (line 3716) | function initScrollbars(cm) {
function startOperation (line 3746) | function startOperation(cm) {
function endOperation (line 3768) | function endOperation(cm) {
function endOperations (line 3779) | function endOperations(group) {
function endOperation_R1 (line 3793) | function endOperation_R1(op) {
function endOperation_W1 (line 3806) | function endOperation_W1(op) {
function endOperation_R2 (line 3810) | function endOperation_R2(op) {
function endOperation_W2 (line 3831) | function endOperation_W2(op) {
function endOperation_finish (line 3856) | function endOperation_finish(op) {
function runInOp (line 3895) | function runInOp(cm, f) {
function operation (line 3902) | function operation(cm, f) {
function methodOp (line 3912) | function methodOp(f) {
function docMethodOp (line 3920) | function docMethodOp(f) {
function regChange (line 3936) | function regChange(cm, from, to, lendiff) {
function regLineChange (line 4001) | function regLineChange(cm, line, type) {
function resetView (line 4015) | function resetView(cm) {
function viewCuttingPoint (line 4021) | function viewCuttingPoint(cm, oldN, newN, dir) {
function adjustView (line 4048) | function adjustView(cm, from, to) {
function countDirtyView (line 4069) | function countDirtyView(cm) {
function startWorker (line 4080) | function startWorker(cm, time) {
function highlightWorker (line 4085) | function highlightWorker(cm) {
function maybeClipScrollbars (line 4155) | function maybeClipScrollbars(cm) {
function selectionSnapshot (line 4166) | function selectionSnapshot(cm) {
function restoreSelection (line 4183) | function restoreSelection(snapshot) {
function updateDisplayIfNeeded (line 4199) | function updateDisplayIfNeeded(cm, update) {
function postUpdateDisplay (line 4271) | function postUpdateDisplay(cm, update) {
function updateDisplaySimple (line 4301) | function updateDisplaySimple(cm, viewport) {
function patchDisplay (line 4318) | function patchDisplay(cm, updateNumbersFrom, dims) {
function updateGutterSpace (line 4359) | function updateGutterSpace(cm) {
function setDocumentHeight (line 4364) | function setDocumentHeight(cm, measure) {
function updateGutters (line 4372) | function updateGutters(cm) {
function setGuttersForLineNumbers (line 4390) | function setGuttersForLineNumbers(options) {
function wheelEventDelta (line 4421) | function wheelEventDelta(e) {
function wheelEventPixels (line 4428) | function wheelEventPixels(e) {
function onScrollWheel (line 4435) | function onScrollWheel(cm, e) {
function normalizeSelection (line 4574) | function normalizeSelection(cm, ranges, primIndex) {
function simpleSelection (line 4592) | function simpleSelection(anchor, head) {
function changeEnd (line 4598) | function changeEnd(change) {
function adjustForChange (line 4606) | function adjustForChange(pos, change) {
function computeSelAfterChange (line 4615) | function computeSelAfterChange(doc, change) {
function offsetPos (line 4625) | function offsetPos(pos, old, nw) {
function computeReplacedSel (line 4634) | function computeReplacedSel(doc, changes, hint) {
function loadMode (line 4655) | function loadMode(cm) {
function resetModeState (line 4660) | function resetModeState(cm) {
function isWholeLineUpdate (line 4676) | function isWholeLineUpdate(doc, change) {
function updateDoc (line 4682) | function updateDoc(doc, change, markedSpans, estimateHeight$$1) {
function linkedDocs (line 4734) | function linkedDocs(doc, f, sharedHistOnly) {
function attachDoc (line 4749) | function attachDoc(cm, doc) {
function setDirectionClass (line 4761) | function setDirectionClass(cm) {
function directionChanged (line 4765) | function directionChanged(cm) {
function History (line 4772) | function History(startGen) {
function historyChangeFromChange (line 4789) | function historyChangeFromChange(doc, change) {
function clearSelectionEvents (line 4798) | function clearSelectionEvents(array) {
function lastChangeEvent (line 4808) | function lastChangeEvent(hist, force) {
function addChangeToHistory (line 4823) | function addChangeToHistory(doc, change, selAfter, opId) {
function selectionEventCanBeMerged (line 4866) | function selectionEventCanBeMerged(doc, origin, prev, sel) {
function addSelectionToHistory (line 4879) | function addSelectionToHistory(doc, sel, opId, options) {
function pushSelectionToHistory (line 4901) | function pushSelectionToHistory(sel, dest) {
function attachLocalSpans (line 4908) | function attachLocalSpans(doc, change, from, to) {
function removeClearedSpans (line 4919) | function removeClearedSpans(spans) {
function getOldSpans (line 4930) | function getOldSpans(doc, change) {
function mergeOldSpans (line 4943) | function mergeOldSpans(doc, change) {
function copyHistoryArray (line 4967) | function copyHistoryArray(events, newGroup, instantiateSel) {
function extendRange (line 4999) | function extendRange(range, head, other, extend) {
function extendSelection (line 5018) | function extendSelection(doc, head, other, options, extend) {
function extendSelections (line 5025) | function extendSelections(doc, heads, options) {
function replaceOneSelection (line 5035) | function replaceOneSelection(doc, i, range, options) {
function setSimpleSelection (line 5042) | function setSimpleSelection(doc, anchor, head, options) {
function filterSelectionChange (line 5048) | function filterSelectionChange(doc, sel, options) {
function setSelectionReplaceHistory (line 5067) | function setSelectionReplaceHistory(doc, sel, options) {
function setSelection (line 5078) | function setSelection(doc, sel, options) {
function setSelectionNoUndo (line 5083) | function setSelectionNoUndo(doc, sel, options) {
function setSelectionInner (line 5095) | function setSelectionInner(doc, sel) {
function reCheckSelection (line 5110) | function reCheckSelection(doc) {
function skipAtomicInSelection (line 5116) | function skipAtomicInSelection(doc, sel, bias, mayClear) {
function skipAtomicInner (line 5131) | function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
function skipAtomic (line 5164) | function skipAtomic(doc, pos, oldPos, bias, mayClear) {
function movePos (line 5177) | function movePos(doc, pos, dir, line) {
function selectAll (line 5189) | function selectAll(cm) {
function filterChange (line 5196) | function filterChange(doc, change, update) {
function makeChange (line 5223) | function makeChange(doc, change, ignoreReadOnly) {
function makeChangeInner (line 5245) | function makeChangeInner(doc, change) {
function makeChangeFromHistory (line 5263) | function makeChangeFromHistory(doc, type, allowSelectionOnly) {
function shiftDoc (line 5339) | function shiftDoc(doc, distance) {
function makeChangeSingleDoc (line 5355) | function makeChangeSingleDoc(doc, change, selAfter, spans) {
function makeChangeSingleDocInEditor (line 5388) | function makeChangeSingleDocInEditor(cm, change, spans) {
function replaceRange (line 5446) | function replaceRange(doc, code, from, to, origin) {
function rebaseHistSelSingle (line 5457) | function rebaseHistSelSingle(pos, from, to, diff) {
function rebaseHistArray (line 5473) | function rebaseHistArray(array, from, to, diff) {
function rebaseHist (line 5501) | function rebaseHist(hist, change) {
function changeLine (line 5510) | function changeLine(doc, handle, changeType, op) {
function LeafChunk (line 5532) | function LeafChunk(lines) {
function BranchChunk (line 5585) | function BranchChunk(children) {
function adjustScrollWhenAboveVisible (line 5748) | function adjustScrollWhenAboveVisible(cm, line, diff) {
function addLineWidget (line 5753) | function addLineWidget(doc, handle, node, options) {
function markText (line 5913) | function markText(doc, from, to, options, type) {
function markTextShared (line 6012) | function markTextShared(doc, from, to, options, type) {
function findSharedMarkers (line 6027) | function findSharedMarkers(doc) {
function copySharedMarkers (line 6031) | function copySharedMarkers(doc, markers) {
function detachSharedMarkers (line 6043) | function detachSharedMarkers(markers) {
function onDrop (line 6485) | function onDrop(e) {
function onDragStart (line 6545) | function onDragStart(cm, e) {
function onDragOver (line 6568) | function onDragOver(cm, e) {
function clearDragCursor (line 6580) | function clearDragCursor(cm) {
function forEachCodeMirror (line 6591) | function forEachCodeMirror(f) {
function ensureGlobalHandlers (line 6604) | function ensureGlobalHandlers() {
function registerGlobalHandlers (line 6609) | function registerGlobalHandlers() {
function onResize (line 6622) | function onResize(cm) {
function normalizeKeyName (line 6693) | function normalizeKeyName(name) {
function normalizeKeyMap (line 6717) | function normalizeKeyMap(keymap) {
function lookupKey (line 6744) | function lookupKey(key, map$$1, handle, context) {
function isModifierKey (line 6763) | function isModifierKey(value) {
function addModifierNames (line 6768) | function addModifierNames(name, event, noShift) {
function keyName (line 6778) | function keyName(event, noShift) {
function getKeyMap (line 6788) | function getKeyMap(val) {
function deleteNearSelection (line 6794) | function deleteNearSelection(cm, compute) {
function moveCharLogically (line 6817) | function moveCharLogically(line, ch, dir) {
function moveLogically (line 6822) | function moveLogically(line, start, dir) {
function endOfLine (line 6827) | function endOfLine(visually, cm, lineObj, lineNo, dir) {
function moveVisually (line 6854) | function moveVisually(cm, line, start, dir) {
function lineStart (line 7066) | function lineStart(cm, lineN) {
function lineEnd (line 7072) | function lineEnd(cm, lineN) {
function lineStartSmart (line 7078) | function lineStartSmart(cm, pos) {
function doHandleBinding (line 7091) | function doHandleBinding(cm, bound, dropShift) {
function lookupKeyForEditor (line 7111) | function lookupKeyForEditor(cm, name, handle) {
function dispatchKey (line 7125) | function dispatchKey(cm, name, e, handle) {
function dispatchKeyInner (line 7143) | function dispatchKeyInner(cm, name, e, handle) {
function handleKeyBinding (line 7160) | function handleKeyBinding(cm, e) {
function handleCharBinding (line 7179) | function handleCharBinding(cm, e, ch) {
function onKeyDown (line 7184) | function onKeyDown(e) {
function showCrossHair (line 7205) | function showCrossHair(cm) {
function onKeyUp (line 7220) | function onKeyUp(e) {
function onKeyPress (line 7225) | function onKeyPress(e) {
function clickRepeat (line 7252) | function clickRepeat(pos, button) {
function onMouseDown (line 7273) | function onMouseDown(e) {
function handleMappedButton (line 7310) | function handleMappedButton(cm, button, pos, repeat, event) {
function configureMouse (line 7330) | function configureMouse(cm, repeat, event) {
function leftButtonDown (line 7343) | function leftButtonDown(cm, pos, repeat, event) {
function leftButtonStartDrag (line 7361) | function leftButtonStartDrag(cm, event, pos, behavior) {
function rangeForUnit (line 7400) | function rangeForUnit(cm, pos, unit) {
function leftButtonSelect (line 7409) | function leftButtonSelect(cm, event, start, behavior) {
function bidiSimplify (line 7541) | function bidiSimplify(cm, range$$1) {
function gutterEvent (line 7576) | function gutterEvent(cm, e, type, prevent) {
function clickInGutter (line 7605) | function clickInGutter(cm, e) {
function onContextMenu (line 7614) | function onContextMenu(cm, e) {
function contextMenuInGutter (line 7620) | function contextMenuInGutter(cm, e) {
function themeChanged (line 7625) | function themeChanged(cm) {
function defineOptions (line 7636) | function defineOptions(CodeMirror) {
function guttersChanged (line 7774) | function guttersChanged(cm) {
function dragDropChanged (line 7780) | function dragDropChanged(cm, value, old) {
function wrappingChanged (line 7793) | function wrappingChanged(cm) {
function CodeMirror (line 7811) | function CodeMirror(place, options) {
function registerEventHandlers (line 7888) | function registerEventHandlers(cm) {
function indentLine (line 8003) | function indentLine(cm, n, how, aggressive) {
function setLastCopied (line 8067) | function setLastCopied(newLastCopied) {
function applyTextInput (line 8071) | function applyTextInput(cm, inserted, deleted, sel, origin) {
function handlePaste (line 8118) | function handlePaste(e, cm) {
function triggerElectric (line 8128) | function triggerElectric(cm, inserted) {
function copyableRanges (line 8152) | function copyableRanges(cm) {
function disableBrowserMagic (line 8163) | function disableBrowserMagic(field, spellcheck, autocorrect, autocapital...
function hiddenTextarea (line 8169) | function hiddenTextarea() {
function addEditorMethods (line 8192) | function addEditorMethods(CodeMirror) {
function findPosH (line 8640) | function findPosH(doc, pos, dir, unit, visually) {
function findPosV (line 8700) | function findPosV(cm, pos, dir, unit) {
function onCopyCut (line 8763) | function onCopyCut(e) {
function poll (line 8921) | function poll() {
function posToDOM (line 9087) | function posToDOM(cm, pos) {
function isInGutter (line 9103) | function isInGutter(node) {
function badPos (line 9109) | function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
function domTextBetween (line 9111) | function domTextBetween(cm, from, to, fromLine, toLine) {
function domToPos (line 9164) | function domToPos(cm, node, offset) {
function locateNodeInLineView (line 9183) | function locateNodeInLineView(lineView, node, offset) {
function prepareCopyCut (line 9280) | function prepareCopyCut(e) {
function p (line 9420) | function p() {
function prepareSelectAllHack (line 9524) | function prepareSelectAllHack() {
function rehide (line 9537) | function rehide() {
function fromTextArea (line 9584) | function fromTextArea(textarea, options) {
function addLegacyProps (line 9641) | function addLegacyProps(CodeMirror) {
FILE: third_party/CodeMirror/mode/asciiarmor/asciiarmor.js
function errorIfNotEmpty (line 14) | function errorIfNotEmpty(stream) {
FILE: third_party/CodeMirror/mode/asn.1/asn.1.js
function tokenBase (line 29) | function tokenBase(stream, state) {
function tokenString (line 68) | function tokenString(quote) {
function Context (line 90) | function Context(indented, column, type, align, prev) {
function pushContext (line 97) | function pushContext(state, col, type) {
function popContext (line 103) | function popContext(state) {
function words (line 162) | function words(str) {
FILE: third_party/CodeMirror/mode/asterisk/asterisk.js
function basicToken (line 66) | function basicToken(stream,state){
FILE: third_party/CodeMirror/mode/clike/clike.js
function Context (line 14) | function Context(indented, column, type, info, align, prev) {
function pushContext (line 22) | function pushContext(state, col, type, info) {
function popContext (line 28) | function popContext(state) {
function typeBefore (line 35) | function typeBefore(stream, state, pos) {
function isTopScope (line 41) | function isTopScope(context) {
function tokenBase (line 75) | function tokenBase(stream, state) {
function tokenString (line 128) | function tokenString(quote) {
function tokenComment (line 141) | function tokenComment(stream, state) {
function maybeEOL (line 153) | function maybeEOL(stream, state) {
function words (line 257) | function words(str) {
function contains (line 262) | function contains(words, word) {
function cTypes (line 286) | function cTypes(identifier) {
function objCTypes (line 291) | function objCTypes(identifier) {
function cppHook (line 298) | function cppHook(stream, state) {
function pointerHook (line 313) | function pointerHook(_stream, state) {
function cIsReservedIdentifier (line 320) | function cIsReservedIdentifier(token) {
function cpp14Literal (line 326) | function cpp14Literal(stream) {
function cpp11StringHook (line 331) | function cpp11StringHook(stream, state) {
function cppLooksLikeConstructor (line 355) | function cppLooksLikeConstructor(word) {
function tokenAtString (line 361) | function tokenAtString(stream, state) {
function tokenRawString (line 374) | function tokenRawString(stream, state) {
function def (line 385) | function def(mimes, mode) {
function tokenTripleString (line 522) | function tokenTripleString(stream, state) {
function tokenNestedComment (line 534) | function tokenNestedComment(depth) {
function tokenKotlinString (line 620) | function tokenKotlinString(tripleString){
function tokenCeylonString (line 805) | function tokenCeylonString(type) {
FILE: third_party/CodeMirror/mode/clike/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function MTCPP (line 70) | function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.c...
function MTOBJC (line 89) | function MTOBJC(name) { test.mode(name, mode_objc, Array.prototype.slice...
function MTSCALA (line 131) | function MTSCALA(name) { test.mode("scala_" + name, mode_scala, Array.pr...
FILE: third_party/CodeMirror/mode/clojure/clojure.js
function base (line 168) | function base(stream, state) {
function inString (line 197) | function inString(stream, state) {
function inComment (line 208) | function inComment(stream, state) {
function createLookupMap (line 225) | function createLookupMap(words) {
function is (line 233) | function is(value, test) {
FILE: third_party/CodeMirror/mode/clojure/test.js
function MT (line 7) | function MT(name) {
function testFormsThatHaveBodyParameter (line 363) | function testFormsThatHaveBodyParameter(forms) {
function typeTokenPairs (line 381) | function typeTokenPairs(type, tokens) {
FILE: third_party/CodeMirror/mode/cmake/cmake.js
function tokenString (line 17) | function tokenString(stream, state) {
function tokenize (line 37) | function tokenize(stream, state) {
FILE: third_party/CodeMirror/mode/cobol/cobol.js
function makeKeywords (line 22) | function makeKeywords(str) {
function isNumber (line 150) | function isNumber(ch, stream){
FILE: third_party/CodeMirror/mode/coffeescript/coffeescript.js
function wordRegexp (line 21) | function wordRegexp(words) {
function tokenBase (line 50) | function tokenBase(stream, state) {
function tokenFactory (line 179) | function tokenFactory(delimiter, singleline, outclass) {
function longComment (line 206) | function longComment(stream, state) {
function indent (line 218) | function indent(stream, state, type) {
function dedent (line 242) | function dedent(stream, state) {
function tokenLexer (line 266) | function tokenLexer(stream, state) {
FILE: third_party/CodeMirror/mode/commonlisp/commonlisp.js
function readSym (line 21) | function readSym(stream) {
function base (line 30) | function base(stream, state) {
function inString (line 64) | function inString(stream, state) {
function inComment (line 73) | function inComment(stream, state) {
FILE: third_party/CodeMirror/mode/crystal/crystal.js
function wordRegExp (line 15) | function wordRegExp(words, end) {
function chain (line 19) | function chain(tokenize, stream, state) {
function tokenBase (line 58) | function tokenBase(stream, state) {
function tokenNest (line 237) | function tokenNest(begin, end, style, started) {
function tokenMacro (line 256) | function tokenMacro(begin, end, started) {
function tokenMacroDef (line 274) | function tokenMacroDef(stream, state) {
function tokenFollowIdent (line 291) | function tokenFollowIdent(stream, state) {
function tokenFollowType (line 305) | function tokenFollowType(stream, state) {
function tokenQuote (line 315) | function tokenQuote(end, style, embed) {
function tokenHereDoc (line 354) | function tokenHereDoc(phrase, embed) {
FILE: third_party/CodeMirror/mode/css/css.js
function ret (line 35) | function ret(style, tp) { type = tp; return style; }
function tokenBase (line 39) | function tokenBase(stream, state) {
function tokenString (line 93) | function tokenString(quote) {
function tokenParenthesized (line 108) | function tokenParenthesized(stream, state) {
function Context (line 119) | function Context(type, indent, prev) {
function pushContext (line 125) | function pushContext(state, stream, type, indent) {
function popContext (line 130) | function popContext(state) {
function pass (line 136) | function pass(type, stream, state) {
function popAndPass (line 139) | function popAndPass(type, stream, state, n) {
function wordAsValue (line 147) | function wordAsValue(stream) {
function keySet (line 418) | function keySet(array) {
function tokenCComment (line 694) | function tokenCComment(stream, state) {
FILE: third_party/CodeMirror/mode/css/gss_test.js
function MT (line 8) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/css/less_test.js
function MT (line 8) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/css/scss_test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/css/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/cypher/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/d/d.js
function tokenBase (line 27) | function tokenBase(stream, state) {
function tokenString (line 77) | function tokenString(quote) {
function tokenComment (line 90) | function tokenComment(stream, state) {
function tokenNestedComment (line 102) | function tokenNestedComment(stream, state) {
function Context (line 114) | function Context(indented, column, type, align, prev) {
function pushContext (line 121) | function pushContext(state, col, type) {
function popContext (line 127) | function popContext(state) {
function words (line 194) | function words(str) {
FILE: third_party/CodeMirror/mode/d/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/dart/dart.js
function set (line 23) | function set(words) {
function pushInterpolationStack (line 29) | function pushInterpolationStack(state) {
function popInterpolationStack (line 33) | function popInterpolationStack(state) {
function sizeInterpolationStack (line 37) | function sizeInterpolationStack(state) {
function tokenString (line 85) | function tokenString(quote, stream, state, raw) {
function tokenInterpolation (line 112) | function tokenInterpolation(stream, state) {
function tokenInterpolationIdentifier (line 124) | function tokenInterpolationIdentifier(stream, state) {
function tokenNestedComment (line 130) | function tokenNestedComment(depth) {
FILE: third_party/CodeMirror/mode/django/django.js
function tokenBase (line 49) | function tokenBase (stream, state) {
function inString (line 71) | function inString (delimiter, previousTokenizer) {
function inVariable (line 94) | function inVariable (stream, state) {
function inTag (line 193) | function inTag (stream, state) {
function inComment (line 319) | function inComment (stream, state) {
function inBlockComment (line 326) | function inBlockComment (stream, state) {
FILE: third_party/CodeMirror/mode/dockerfile/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/dtd/dtd.js
function ret (line 23) | function ret(style, tp) {type = tp; return style;}
function tokenBase (line 25) | function tokenBase(stream, state) {
function tokenSGMLComment (line 54) | function tokenSGMLComment(stream, state) {
function tokenString (line 66) | function tokenString(quote) {
function inBlock (line 80) | function inBlock(style, terminator) {
FILE: third_party/CodeMirror/mode/dylan/dylan.js
function forEach (line 14) | function forEach(arr, f) {
function some (line 17) | function some(arr, f) {
function chain (line 160) | function chain(stream, state, f) {
function tokenBase (line 165) | function tokenBase(stream, state) {
function tokenComment (line 295) | function tokenComment(stream, state) {
function tokenString (line 314) | function tokenString(quote, style) {
FILE: third_party/CodeMirror/mode/dylan/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/ecl/ecl.js
function words (line 16) | function words(str) {
function metaHook (line 22) | function metaHook(stream, state) {
function tokenBase (line 41) | function tokenBase(stream, state) {
function tokenString (line 107) | function tokenString(quote) {
function tokenComment (line 120) | function tokenComment(stream, state) {
function Context (line 132) | function Context(indented, column, type, align, prev) {
function pushContext (line 139) | function pushContext(state, col, type) {
function popContext (line 142) | function popContext(state) {
FILE: third_party/CodeMirror/mode/eiffel/eiffel.js
function wordObj (line 15) | function wordObj(words) {
function chain (line 88) | function chain(newtok, stream, state) {
function tokenBase (line 93) | function tokenBase(stream, state) {
function readQuoted (line 119) | function readQuoted(quote, style, unescaped) {
FILE: third_party/CodeMirror/mode/elm/elm.js
function switchState (line 16) | function switchState(source, setState, f) {
function normal (line 32) | function normal() {
function ncomment (line 117) | function ncomment(type, nest) {
function stringLiteral (line 140) | function stringLiteral(source, setState) {
function stringGap (line 159) | function stringGap(source, setState) {
FILE: third_party/CodeMirror/mode/erlang/erlang.js
function tokenizer (line 103) | function tokenizer(stream,state) {
function nongreedy (line 290) | function nongreedy(stream,re,words) {
function greedy (line 304) | function greedy(stream,re,words) {
function doubleQuote (line 321) | function doubleQuote(stream) {
function singleQuote (line 325) | function singleQuote(stream) {
function quote (line 329) | function quote(stream,quoteChar,escapeChar) {
function lookahead (line 341) | function lookahead(stream) {
function is_member (line 346) | function is_member(element,list) {
function rval (line 350) | function rval(state,stream,type) {
function aToken (line 384) | function aToken(tok,col,ind,typ) {
function realToken (line 391) | function realToken(type,stream) {
function fakeToken (line 398) | function fakeToken(type) {
function peekToken (line 402) | function peekToken(state,depth) {
function pushToken (line 413) | function pushToken(state,token) {
function maybe_drop_pre (line 421) | function maybe_drop_pre(s,token) {
function maybe_drop_post (line 435) | function maybe_drop_post(s) {
function d (line 463) | function d(stack,tt) {
function indenter (line 503) | function indenter(state,textAfter) {
function wordafter (line 546) | function wordafter(str) {
function postcommaToken (line 552) | function postcommaToken(state) {
function defaultToken (line 559) | function defaultToken(state) {
function getToken (line 573) | function getToken(state,tokens) {
function getTokenIndex (line 580) | function getTokenIndex(objs,propname,propvals) {
function truthy (line 590) | function truthy(x) {
FILE: third_party/CodeMirror/mode/fcl/fcl.js
function tokenBase (line 48) | function tokenBase(stream, state) {
function tokenComment (line 89) | function tokenComment(stream, state) {
function Context (line 101) | function Context(indented, column, type, align, prev) {
function pushContext (line 109) | function pushContext(state, col, type) {
function popContext (line 113) | function popContext(state) {
FILE: third_party/CodeMirror/mode/forth/forth.js
function toWordList (line 16) | function toWordList(words) {
function searchWordList (line 67) | function searchWordList (wordList, word) {
FILE: third_party/CodeMirror/mode/fortran/fortran.js
function words (line 15) | function words(array) {
function tokenBase (line 117) | function tokenBase(stream, state) {
function tokenString (line 155) | function tokenString(quote) {
FILE: third_party/CodeMirror/mode/gas/gas.js
function x86 (line 144) | function x86(_parserConfig) {
function armv6 (line 191) | function armv6(_parserConfig) {
function nextUntilUnescaped (line 234) | function nextUntilUnescaped(stream, end) {
function clikeComment (line 245) | function clikeComment(stream, state) {
FILE: third_party/CodeMirror/mode/gfm/gfm.js
function blankLine (line 18) | function blankLine(state) {
FILE: third_party/CodeMirror/mode/gfm/test.js
function MT (line 7) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function FT (line 9) | function FT(name) { test.mode(name, modeHighlightFormatting, Array.proto...
FILE: third_party/CodeMirror/mode/go/go.js
function tokenBase (line 41) | function tokenBase(stream, state) {
function tokenString (line 85) | function tokenString(quote) {
function tokenComment (line 98) | function tokenComment(stream, state) {
function Context (line 110) | function Context(indented, column, type, align, prev) {
function pushContext (line 117) | function pushContext(state, col, type) {
function popContext (line 120) | function popContext(state) {
FILE: third_party/CodeMirror/mode/groovy/groovy.js
function words (line 15) | function words(str) {
function tokenBase (line 31) | function tokenBase(stream, state) {
function startString (line 81) | function startString(quote, stream, state) {
function tokenBaseUntilBrace (line 107) | function tokenBaseUntilBrace() {
function tokenComment (line 125) | function tokenComment(stream, state) {
function expectExpression (line 137) | function expectExpression(last, newline) {
function Context (line 143) | function Context(indented, column, type, align, prev) {
function pushContext (line 150) | function pushContext(state, col, type) {
function popContext (line 153) | function popContext(state) {
FILE: third_party/CodeMirror/mode/haml/haml.js
function rubyInQuote (line 19) | function rubyInQuote(endQuote) {
function ruby (line 33) | function ruby(stream, state) {
function html (line 41) | function html(stream, state) {
FILE: third_party/CodeMirror/mode/haml/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/haskell/haskell.js
function switchState (line 16) | function switchState(source, setState, f) {
function normal (line 32) | function normal(source, setState) {
function ncomment (line 125) | function ncomment(type, nest) {
function stringLiteral (line 149) | function stringLiteral(source, setState) {
function stringGap (line 172) | function stringGap(source, setState) {
function setType (line 184) | function setType(t) {
FILE: third_party/CodeMirror/mode/haxe/haxe.js
function kw (line 19) | function kw(type) {return {type: type, style: "keyword"};}
function chain (line 37) | function chain(stream, state, f) {
function toUnescaped (line 42) | function toUnescaped(stream, end) {
function ret (line 54) | function ret(tp, style, cont) {
function haxeTokenBase (line 59) | function haxeTokenBase(stream, state) {
function haxeTokenString (line 110) | function haxeTokenString(quote) {
function haxeTokenComment (line 118) | function haxeTokenComment(stream, state) {
function HaxeLexical (line 134) | function HaxeLexical(indented, column, type, align, prev, info) {
function inScope (line 143) | function inScope(state, varname) {
function parseHaxe (line 148) | function parseHaxe(state, style, type, content, stream) {
function imported (line 170) | function imported(state, typename) {
function registerimport (line 178) | function registerimport(importname) {
function pass (line 187) | function pass() {
function cont (line 190) | function cont() {
function inList (line 194) | function inList(name, list) {
function register (line 199) | function register(varname) {
function pushcontext (line 214) | function pushcontext() {
function popcontext (line 218) | function popcontext() {
function pushlex (line 223) | function pushlex(type, info) {
function poplex (line 231) | function poplex() {
function expect (line 241) | function expect(wanted) {
function statement (line 250) | function statement(type) {
function expression (line 272) | function expression(type) {
function maybeexpression (line 283) | function maybeexpression(type) {
function maybeoperator (line 288) | function maybeoperator(type, value) {
function maybeattribute (line 297) | function maybeattribute(type) {
function metadef (line 303) | function metadef(type) {
function metaargs (line 308) | function metaargs(type) {
function importdef (line 312) | function importdef (type, value) {
function typedef (line 317) | function typedef (type, value)
function maybelabel (line 323) | function maybelabel(type) {
function property (line 327) | function property(type) {
function objprop (line 330) | function objprop(type) {
function commasep (line 334) | function commasep(what, end) {
function block (line 345) | function block(type) {
function vardef1 (line 349) | function vardef1(type, value) {
function vardef2 (line 353) | function vardef2(type, value) {
function forspec1 (line 357) | function forspec1(type, value) {
function forin (line 365) | function forin(_type, value) {
function functiondef (line 368) | function functiondef(type, value) {
function typeuse (line 374) | function typeuse(type) {
function typestring (line 377) | function typestring(type) {
function typeprop (line 382) | function typeprop(type) {
function funarg (line 385) | function funarg(type, value) {
FILE: third_party/CodeMirror/mode/htmlmixed/htmlmixed.js
function maybeBackup (line 29) | function maybeBackup(stream, pat, style) {
function getAttrRegexp (line 41) | function getAttrRegexp(attr) {
function getAttrValue (line 47) | function getAttrValue(text, attr) {
function getTagRegexp (line 52) | function getTagRegexp(tagName, anchored) {
function addTags (line 56) | function addTags(from, to) {
function findMatchingMode (line 65) | function findMatchingMode(tagInfo, tagText) {
function html (line 87) | function html(stream, state) {
FILE: third_party/CodeMirror/mode/http/http.js
function failFirstLine (line 15) | function failFirstLine(stream, state) {
function start (line 21) | function start(stream, state) {
function responseStatusCode (line 33) | function responseStatusCode(stream, state) {
function responseStatusText (line 54) | function responseStatusText(stream, state) {
function requestPath (line 60) | function requestPath(stream, state) {
function requestProtocol (line 66) | function requestProtocol(stream, state) {
function header (line 75) | function header(stream) {
function body (line 89) | function body(stream) {
FILE: third_party/CodeMirror/mode/idl/idl.js
function wordRegexp (line 14) | function wordRegexp(words) {
function tokenBase (line 244) | function tokenBase(stream) {
FILE: third_party/CodeMirror/mode/javascript/javascript.js
function kw (line 25) | function kw(type) {return {type: type, style: "keyword"};}
function readRegexp (line 46) | function readRegexp(stream) {
function ret (line 61) | function ret(tp, style, cont) {
function tokenBase (line 65) | function tokenBase(stream, state) {
function tokenString (line 129) | function tokenString(quote) {
function tokenComment (line 145) | function tokenComment(stream, state) {
function tokenQuasi (line 157) | function tokenQuasi(stream, state) {
function findFatArrow (line 177) | function findFatArrow(stream, state) {
function JSLexical (line 212) | function JSLexical(indented, column, type, align, prev, info) {
function inScope (line 221) | function inScope(state, varname) {
function parseJS (line 230) | function parseJS(state, style, type, content, stream) {
function pass (line 254) | function pass() {
function cont (line 257) | function cont() {
function inList (line 261) | function inList(name, list) {
function register (line 265) | function register(varname) {
function registerVarScoped (line 285) | function registerVarScoped(varname, context) {
function isModifier (line 300) | function isModifier(name) {
function Context (line 306) | function Context(prev, vars, block) { this.prev = prev; this.vars = vars...
function Var (line 307) | function Var(name, next) { this.name = name; this.next = next }
function pushcontext (line 310) | function pushcontext() {
function pushblockcontext (line 314) | function pushblockcontext() {
function popcontext (line 318) | function popcontext() {
function pushlex (line 323) | function pushlex(type, info) {
function poplex (line 334) | function poplex() {
function expect (line 344) | function expect(wanted) {
function statement (line 353) | function statement(type, value) {
function maybeCatchBinding (line 402) | function maybeCatchBinding(type) {
function expression (line 405) | function expression(type, value) {
function expressionNoComma (line 408) | function expressionNoComma(type, value) {
function parenExpr (line 411) | function parenExpr(type) {
function expressionInner (line 415) | function expressionInner(type, value, noComma) {
function maybeexpression (line 436) | function maybeexpression(type) {
function maybeoperatorComma (line 441) | function maybeoperatorComma(type, value) {
function maybeoperatorNoComma (line 445) | function maybeoperatorNoComma(type, value, noComma) {
function quasi (line 468) | function quasi(type, value) {
function continueQuasi (line 473) | function continueQuasi(type) {
function arrowBody (line 480) | function arrowBody(type) {
function arrowBodyNoComma (line 484) | function arrowBodyNoComma(type) {
function maybeTarget (line 488) | function maybeTarget(noComma) {
function target (line 495) | function target(_, value) {
function targetNoComma (line 498) | function targetNoComma(_, value) {
function maybelabel (line 501) | function maybelabel(type) {
function property (line 505) | function property(type) {
function objprop (line 508) | function objprop(type, value) {
function getterSetter (line 538) | function getterSetter(type) {
function afterprop (line 543) | function afterprop(type) {
function commasep (line 547) | function commasep(what, end, sep) {
function contCommasep (line 566) | function contCommasep(what, end, info) {
function block (line 571) | function block(type) {
function maybetype (line 575) | function maybetype(type, value) {
function mayberettype (line 581) | function mayberettype(type) {
function isKW (line 587) | function isKW(_, value) {
function typeexpr (line 593) | function typeexpr(type, value) {
function maybeReturnType (line 608) | function maybeReturnType(type) {
function typeprop (line 611) | function typeprop(type, value) {
function typearg (line 625) | function typearg(type, value) {
function afterType (line 631) | function afterType(type, value) {
function maybeTypeArgs (line 638) | function maybeTypeArgs(_, value) {
function typeparam (line 641) | function typeparam() {
function maybeTypeDefault (line 644) | function maybeTypeDefault(_, value) {
function vardef (line 647) | function vardef(_, value) {
function pattern (line 651) | function pattern(type, value) {
function proppattern (line 658) | function proppattern(type, value) {
function eltpattern (line 669) | function eltpattern() {
function maybeAssign (line 672) | function maybeAssign(_type, value) {
function vardefCont (line 675) | function vardefCont(type) {
function maybeelse (line 678) | function maybeelse(type, value) {
function forspec (line 681) | function forspec(type, value) {
function forspec1 (line 685) | function forspec1(type) {
function formaybeinof (line 691) | function formaybeinof(_type, value) {
function forspec2 (line 695) | function forspec2(type, value) {
function forspec3 (line 700) | function forspec3(type) {
function functiondef (line 703) | function functiondef(type, value) {
function functiondecl (line 709) | function functiondecl(type, value) {
function typename (line 715) | function typename(type, value) {
function funarg (line 723) | function funarg(type, value) {
function classExpression (line 729) | function classExpression(type, value) {
function className (line 734) | function className(type, value) {
function classNameAfter (line 737) | function classNameAfter(type, value) {
function classBody (line 745) | function classBody(type, value) {
function classfield (line 769) | function classfield(type, value) {
function afterExport (line 776) | function afterExport(type, value) {
function exportField (line 782) | function exportField(type, value) {
function afterImport (line 786) | function afterImport(type) {
function importSpec (line 791) | function importSpec(type, value) {
function maybeMoreImports (line 797) | function maybeMoreImports(type) {
function maybeAs (line 800) | function maybeAs(_type, value) {
function maybeFrom (line 803) | function maybeFrom(_type, value) {
function arrayLiteral (line 806) | function arrayLiteral(type) {
function enumdef (line 810) | function enumdef() {
function enummember (line 813) | function enummember() {
function isContinuedStatement (line 817) | function isContinuedStatement(state, textAfter) {
function expressionAllowed (line 823) | function expressionAllowed(stream, state, backUp) {
FILE: third_party/CodeMirror/mode/javascript/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function TS (line 302) | function TS(name) {
function LD (line 461) | function LD(name) {
FILE: third_party/CodeMirror/mode/jinja2/jinja2.js
function tokenBase (line 36) | function tokenBase (stream, state) {
FILE: third_party/CodeMirror/mode/jsx/jsx.js
function Context (line 17) | function Context(state, mode, depth, prev) {
function copyContext (line 21) | function copyContext(context) {
function flatXMLIndent (line 32) | function flatXMLIndent(state) {
function token (line 40) | function token(stream, state) {
function xmlToken (line 47) | function xmlToken(stream, state, cx) {
function jsToken (line 105) | function jsToken(stream, state, cx) {
FILE: third_party/CodeMirror/mode/jsx/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function TS (line 77) | function TS(name) { test.mode(name, ts_mode, Array.prototype.slice.call(...
FILE: third_party/CodeMirror/mode/julia/julia.js
function wordRegexp (line 15) | function wordRegexp(words, end) {
function inArray (line 64) | function inArray(state) {
function inGenerator (line 68) | function inGenerator(state, bracket, depth) {
function currentScope (line 80) | function currentScope(state, n) {
function tokenBase (line 89) | function tokenBase(stream, state) {
function tokenCallOrDef (line 269) | function tokenCallOrDef(stream, state) {
function tokenAnnotation (line 307) | function tokenAnnotation(stream, state) {
function tokenComment (line 322) | function tokenComment(stream, state) {
function tokenChar (line 337) | function tokenChar(stream, state) {
function tokenStringFactory (line 364) | function tokenStringFactory(delimiter) {
FILE: third_party/CodeMirror/mode/lua/lua.js
function prefixRE (line 21) | function prefixRE(words) {
function wordRE (line 24) | function wordRE(words) {
function readBracket (line 70) | function readBracket(stream) {
function normal (line 77) | function normal(stream, state) {
function bracketed (line 100) | function bracketed(level, style) {
function string (line 113) | function string(quote) {
FILE: third_party/CodeMirror/mode/markdown/markdown.js
function getMode (line 19) | function getMode(name) {
function switchInline (line 97) | function switchInline(stream, state, f) {
function switchBlock (line 102) | function switchBlock(stream, state, f) {
function lineIsEmpty (line 107) | function lineIsEmpty(line) {
function blankLine (line 113) | function blankLine(state) {
function blockNormal (line 150) | function blockNormal(stream, state) {
function htmlBlock (line 282) | function htmlBlock(stream, state) {
function local (line 297) | function local(stream, state) {
function getType (line 322) | function getType(state) {
function handleText (line 405) | function handleText(stream, state) {
function inlineNormal (line 412) | function inlineNormal(stream, state) {
function linkInline (line 642) | function linkInline(stream, state) {
function linkHref (line 662) | function linkHref(stream, state) {
function getLinkHrefInside (line 682) | function getLinkHrefInside(endChar) {
function footnoteLink (line 700) | function footnoteLink(stream, state) {
function footnoteLinkInside (line 711) | function footnoteLinkInside(stream, state) {
function footnoteUrl (line 725) | function footnoteUrl(stream, state) {
FILE: third_party/CodeMirror/mode/markdown/test.js
function MT (line 7) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function FT (line 9) | function FT(name) { test.mode(name, modeHighlightFormatting, Array.proto...
function MT_noXml (line 11) | function MT_noXml(name) { test.mode(name, modeMT_noXml, Array.prototype....
function MT_noFencedHighlight (line 13) | function MT_noFencedHighlight(name) { test.mode(name, modeMT_noFencedHig...
function AtxNoSpaceTest (line 15) | function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.pr...
function TokenTypeOverrideTest (line 40) | function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClass...
function FormatTokenTypeOverrideTest (line 47) | function FormatTokenTypeOverrideTest(name) { test.mode(name, modeFormatt...
function ET (line 49) | function ET(name) { test.mode(name, modeET, Array.prototype.slice.call(a...
FILE: third_party/CodeMirror/mode/mathematica/mathematica.js
function tokenBase (line 32) | function tokenBase(stream, state) {
function tokenString (line 133) | function tokenString(stream, state) {
function tokenComment (line 148) | function tokenComment(stream, state) {
FILE: third_party/CodeMirror/mode/mbox/mbox.js
function styleForHeader (line 35) | function styleForHeader(header) {
function readToken (line 40) | function readToken(stream, state) {
FILE: third_party/CodeMirror/mode/mirc/mirc.js
function parseWords (line 18) | function parseWords(str) {
function chain (line 86) | function chain(stream, state, f) {
function tokenBase (line 90) | function tokenBase(stream, state) {
function tokenComment (line 153) | function tokenComment(stream, state) {
function tokenUnparsed (line 164) | function tokenUnparsed(stream, state) {
FILE: third_party/CodeMirror/mode/mllike/mllike.js
function tokenBase (line 48) | function tokenBase(stream, state) {
function tokenString (line 110) | function tokenString(stream, state) {
function tokenComment (line 125) | function tokenComment(stream, state) {
function tokenLongString (line 138) | function tokenLongString(stream, state) {
FILE: third_party/CodeMirror/mode/modelica/modelica.js
function tokenLineComment (line 30) | function tokenLineComment(stream, state) {
function tokenBlockComment (line 36) | function tokenBlockComment(stream, state) {
function tokenString (line 48) | function tokenString(stream, state) {
function tokenIdent (line 62) | function tokenIdent(stream, state) {
function tokenQIdent (line 81) | function tokenQIdent(stream, state) {
function tokenUnsignedNuber (line 93) | function tokenUnsignedNuber(stream, state) {
function words (line 202) | function words(str) {
function def (line 213) | function def(mimes, mode) {
FILE: third_party/CodeMirror/mode/mscgen/mscgen.js
function wordRegexpBoundary (line 74) | function wordRegexpBoundary(pWords) {
function wordRegexp (line 78) | function wordRegexp(pWords) {
function startStateFn (line 82) | function startStateFn() {
function copyStateFn (line 91) | function copyStateFn(pState) {
function produceTokenFunction (line 100) | function produceTokenFunction(pConfig) {
FILE: third_party/CodeMirror/mode/mscgen/mscgen_test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/mscgen/msgenny_test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/mscgen/xu_test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/mumps/mumps.js
function wordRegexp (line 19) | function wordRegexp(words) {
function tokenBase (line 34) | function tokenBase(stream, state) {
FILE: third_party/CodeMirror/mode/nginx/nginx.js
function words (line 16) | function words(str) {
function ret (line 36) | function ret(style, tp) {type = tp; return style;}
function tokenBase (line 38) | function tokenBase(stream, state) {
function tokenCComment (line 97) | function tokenCComment(stream, state) {
function tokenSGMLComment (line 109) | function tokenSGMLComment(stream, state) {
function tokenString (line 121) | function tokenString(quote) {
FILE: third_party/CodeMirror/mode/ntriples/ntriples.js
function transitState (line 59) | function transitState(currState, c) {
FILE: third_party/CodeMirror/mode/octave/octave.js
function wordRegexp (line 15) | function wordRegexp(words) {
function tokenTranspose (line 46) | function tokenTranspose(stream, state) {
function tokenComment (line 57) | function tokenComment(stream, state) {
function tokenBase (line 66) | function tokenBase(stream, state) {
FILE: third_party/CodeMirror/mode/oz/oz.js
function wordRegexp (line 16) | function wordRegexp(words) {
function tokenBase (line 37) | function tokenBase(stream, state) {
function tokenClass (line 139) | function tokenClass(stream, state) {
function tokenMeth (line 148) | function tokenMeth(stream, state) {
function tokenFunProc (line 157) | function tokenFunProc(stream, state) {
function tokenComment (line 178) | function tokenComment(stream, state) {
function tokenString (line 190) | function tokenString(quote) {
function buildElectricInputRegEx (line 206) | function buildElectricInputRegEx() {
FILE: third_party/CodeMirror/mode/pascal/pascal.js
function words (line 15) | function words(str) {
function tokenBase (line 39) | function tokenBase(stream, state) {
function tokenString (line 77) | function tokenString(quote) {
function tokenComment (line 89) | function tokenComment(stream, state) {
FILE: third_party/CodeMirror/mode/pegjs/pegjs.js
function identifier (line 17) | function identifier(stream) {
FILE: third_party/CodeMirror/mode/perl/perl.js
function tokenChain (line 483) | function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.l...
function tokenSOMETHING (line 503) | function tokenSOMETHING(stream,state,string){
function tokenPerl (line 511) | function tokenPerl(stream,state){
function look (line 804) | function look(stream, c){
function prefix (line 809) | function prefix(stream, c){
function suffix (line 819) | function suffix(stream, c){
function eatSuffix (line 826) | function eatSuffix(stream, c){
FILE: third_party/CodeMirror/mode/php/php.js
function keywords (line 14) | function keywords(str) {
function matchSequence (line 21) | function matchSequence(list, end, escapes) {
function phpString (line 33) | function phpString(closing, escapes) {
function phpString_ (line 36) | function phpString_(stream, state, closing, escapes) {
function dispatch (line 157) | function dispatch(stream, state) {
FILE: third_party/CodeMirror/mode/php/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function build_recursive_monsters (line 78) | function build_recursive_monsters(nt, t, n){
function build_recursive_monsters_2 (line 124) | function build_recursive_monsters_2(mf1, mf2, nt, t, n){
FILE: third_party/CodeMirror/mode/pig/pig.js
function chain (line 28) | function chain(stream, state, f) {
function tokenComment (line 33) | function tokenComment(stream, state) {
function tokenString (line 46) | function tokenString(quote) {
function tokenBase (line 62) | function tokenBase(stream, state) {
function keywords (line 140) | function keywords(str) {
FILE: third_party/CodeMirror/mode/powershell/powershell.js
function buildRegexp (line 16) | function buildRegexp(patterns, options) {
function tokenBase (line 162) | function tokenBase(stream, state) {
function tokenSingleQuoteString (line 237) | function tokenSingleQuoteString(stream, state) {
function tokenDoubleQuoteString (line 251) | function tokenDoubleQuoteString(stream, state) {
function tokenStringInterpolation (line 274) | function tokenStringInterpolation(stream, state) {
function tokenMultiStringReturn (line 278) | function tokenMultiStringReturn(stream, state) {
function tokenHereStringInterpolation (line 284) | function tokenHereStringInterpolation(stream, state) {
function tokenInterpolation (line 288) | function tokenInterpolation(stream, state, parentTokenize) {
function tokenComment (line 312) | function tokenComment(stream, state) {
function tokenVariable (line 324) | function tokenVariable(stream, state) {
function tokenVariableWithBraces (line 339) | function tokenVariableWithBraces(stream, state) {
function tokenMultiString (line 350) | function tokenMultiString(stream, state) {
FILE: third_party/CodeMirror/mode/powershell/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
function forEach (line 8) | function forEach(arr, f) { for (var i = 0; i < arr.length; i++) f(arr[i]...
FILE: third_party/CodeMirror/mode/protobuf/protobuf.js
function wordRegexp (line 14) | function wordRegexp(words) {
function tokenBase (line 31) | function tokenBase(stream) {
FILE: third_party/CodeMirror/mode/pug/pug.js
function State (line 29) | function State() {
function javaScript (line 105) | function javaScript(stream, state) {
function javaScriptArguments (line 122) | function javaScriptArguments(stream, state) {
function yieldStatement (line 143) | function yieldStatement(stream) {
function doctype (line 149) | function doctype(stream) {
function interpolation (line 155) | function interpolation(stream, state) {
function interpolationContinued (line 163) | function interpolationContinued(stream, state) {
function caseStatement (line 179) | function caseStatement(stream, state) {
function when (line 186) | function when(stream, state) {
function defaultStatement (line 194) | function defaultStatement(stream) {
function extendsStatement (line 200) | function extendsStatement(stream, state) {
function append (line 207) | function append(stream, state) {
function prepend (line 213) | function prepend(stream, state) {
function block (line 219) | function block(stream, state) {
function include (line 226) | function include(stream, state) {
function includeFiltered (line 233) | function includeFiltered(stream, state) {
function includeFilteredContinued (line 240) | function includeFilteredContinued(stream, state) {
function mixin (line 249) | function mixin(stream, state) {
function call (line 256) | function call(stream, state) {
function callArguments (line 270) | function callArguments(stream, state) {
function conditional (line 281) | function conditional(stream, state) {
function each (line 288) | function each(stream, state) {
function eachContinued (line 294) | function eachContinued(stream, state) {
function whileStatement (line 309) | function whileStatement(stream, state) {
function tag (line 316) | function tag(stream, state) {
function filter (line 327) | function filter(stream, state) {
function code (line 344) | function code(stream, state) {
function id (line 351) | function id(stream) {
function className (line 357) | function className(stream) {
function attrs (line 363) | function attrs(stream, state) {
function attrsContinued (line 375) | function attrsContinued(stream, state) {
function attributesBlock (line 419) | function attributesBlock(stream, state) {
function indent (line 427) | function indent(stream) {
function comment (line 433) | function comment(stream, state) {
function colon (line 441) | function colon(stream) {
function text (line 447) | function text(stream, state) {
function dot (line 459) | function dot(stream, state) {
function fail (line 472) | function fail(stream) {
function setInnerMode (line 478) | function setInnerMode(stream, state, mode) {
function innerMode (line 491) | function innerMode(stream, state, force) {
function restOfLine (line 511) | function restOfLine(stream, state) {
function startState (line 525) | function startState() {
function copyState (line 528) | function copyState(state) {
function nextToken (line 537) | function nextToken(stream, state) {
FILE: third_party/CodeMirror/mode/puppet/puppet.js
function define (line 22) | function define(style, string) {
function tokenString (line 47) | function tokenString(stream, state) {
function tokenize (line 68) | function tokenize(stream, state) {
FILE: third_party/CodeMirror/mode/python/python.js
function wordRegexp (line 14) | function wordRegexp(words) {
function top (line 37) | function top(state) {
function tokenBase (line 78) | function tokenBase(stream, state) {
function tokenBaseInner (line 101) | function tokenBaseInner(stream, state) {
function formatStringFactory (line 183) | function formatStringFactory(delimiter, tokenOuter) {
function tokenStringFactory (line 244) | function tokenStringFactory(delimiter, tokenOuter) {
function pushPyScope (line 277) | function pushPyScope(state) {
function pushBracketScope (line 284) | function pushBracketScope(stream, state, type) {
function dedent (line 291) | function dedent(stream, state) {
function tokenLexer (line 300) | function tokenLexer(stream, state) {
FILE: third_party/CodeMirror/mode/python/test.js
function MT (line 9) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/q/q.js
function buildRE (line 19) | function buildRE(w){return new RegExp("^("+w.join("|")+")$");}
function tokenBase (line 20) | function tokenBase(stream,state){
function tokenLineComment (line 62) | function tokenLineComment(stream,state){
function tokenBlockComment (line 65) | function tokenBlockComment(stream,state){
function tokenCommentToEOF (line 72) | function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";}
function tokenString (line 73) | function tokenString(stream,state){
function pushContext (line 82) | function pushContext(state,type,col){state.context={prev:state.context,i...
function popContext (line 83) | function popContext(state){state.indent=state.context.indent;state.conte...
FILE: third_party/CodeMirror/mode/r/r.js
function wordObj (line 17) | function wordObj(words) {
function tokenBase (line 36) | function tokenBase(stream, state) {
function tokenString (line 97) | function tokenString(quote) {
function push (line 120) | function push(state, type, stream) {
function setFlag (line 127) | function setFlag(state, flag) {
function pop (line 135) | function pop(state) {
FILE: third_party/CodeMirror/mode/rst/rst.js
function format (line 76) | function format(string) {
function to_normal (line 156) | function to_normal(stream, state) {
function to_explicit (line 356) | function to_explicit(stream, state) {
function to_comment (line 463) | function to_comment(stream, state) {
function to_verbatim (line 467) | function to_verbatim(stream, state) {
function as_block (line 471) | function as_block(stream, state, token) {
function to_mode (line 484) | function to_mode(stream, state) {
function context (line 503) | function context(phase, stage, mode, local) {
function change (line 507) | function change(state, tok, ctx) {
function stage (line 512) | function stage(state) {
function phase (line 516) | function phase(state) {
FILE: third_party/CodeMirror/mode/ruby/ruby.js
function wordObj (line 15) | function wordObj(words) {
function chain (line 34) | function chain(newtok, stream, state) {
function tokenBase (line 39) | function tokenBase(stream, state) {
function regexpAhead (line 139) | function regexpAhead(stream) {
function tokenBaseUntilBrace (line 161) | function tokenBaseUntilBrace(depth) {
function tokenBaseOnce (line 177) | function tokenBaseOnce() {
function readQuoted (line 188) | function readQuoted(quote, style, embed, unescaped) {
function readHereDoc (line 219) | function readHereDoc(phrase, mayIndent) {
function readBlockComment (line 227) | function readBlockComment(stream, state) {
FILE: third_party/CodeMirror/mode/ruby/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/rust/test.js
function MT (line 6) | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(argu...
FILE: third_party/CodeMirror/mode/sas/sas.js
function define (line 51) | function define(style, string, context) {
function tokenize (line 95) | function tokenize(stream, state) {
FILE: third_party/CodeMirror/mode/sass/sass.js
function tokenRegexp (line 21) | function tokenRegexp(words) {
function isEndLine (line 36) | function isEndLine(stream) {
function urlTokens (line 40) | function urlTokens(stream, state) {
function comment (line 60) | function comment(indentation, multiLine) {
function buildStringTokenizer (line 79) | function buildStringTokenizer(quote, greedy) {
function buildInterpolationTokenizer (line 108) | function buildInterpolationTokenizer(currentTokenizer) {
function indent (line 120) | function indent(state) {
function dedent (line 129) | function dedent(state) {
function tokenBase (line 135) | function tokenBase(stream, state) {
function tokenLexer (line 396) | function tokenLexer(stream, state) {
FILE: third_party/CodeMirror/mode/sass/test.js
function MT (line 9) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/scheme/scheme.js
function makeKeywords (line 23) | function makeKeywords(str) {
function stateStack (line 32) | function stateStack(indent, type, prev) { // represents a state stack ob...
function pushStack (line 38) | function pushStack(state, indent, type) {
function popStack (line 42) | function popStack(state) {
function isBinaryNumber (line 51) | function isBinaryNumber (stream) {
function isOctalNumber (line 55) | function isOctalNumber (stream) {
function isDecimalNumber (line 59) | function isDecimalNumber (stream, backup) {
function isHexNumber (line 66) | function isHexNumber (stream) {
FILE: third_party/CodeMirror/mode/shell/shell.js
function define (line 17) | function define(style, dict) {
function tokenBase (line 39) | function tokenBase(stream, state) {
function tokenString (line 85) | function tokenString(quote, style) {
function tokenStringStart (line 112) | function tokenStringStart(quote, style) {
function tokenize (line 132) | function tokenize(stream, state) {
FILE: third_party/CodeMirror/mode/shell/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/sieve/sieve.js
function words (line 15) | function words(str) {
function tokenBase (line 25) | function tokenBase(stream, state) {
function tokenMultiLineString (line 112) | function tokenMultiLineString(stream, state)
function tokenCComment (line 137) | function tokenCComment(stream, state) {
function tokenString (line 149) | function tokenString(quote) {
FILE: third_party/CodeMirror/mode/slim/slim.js
function backup (line 72) | function backup(pos, tokenize, style) {
function maybeBackup (line 87) | function maybeBackup(stream, state, pat, offset, style) {
function continueLine (line 97) | function continueLine(state, column) {
function finishContinue (line 106) | function finishContinue(state) {
function lineContinuable (line 113) | function lineContinuable(column, tokenize) {
function commaContinuable (line 127) | function commaContinuable(column, tokenize) {
function rubyInQuote (line 138) | function rubyInQuote(endQuote, tokenize) {
function startRubySplat (line 152) | function startRubySplat(tokenize) {
function ruby (line 174) | function ruby(stream, state) {
function htmlLine (line 178) | function htmlLine(stream, state) {
function html (line 184) | function html(stream, state) {
function startHtmlLine (line 192) | function startHtmlLine(lastTokenize) {
function startHtmlMode (line 200) | function startHtmlMode(stream, state, offset) {
function comment (line 211) | function comment(stream, state) {
function commentMode (line 216) | function commentMode(stream, state) {
function attributeWrapper (line 227) | function attributeWrapper(stream, state) {
function attributeWrapperAssign (line 241) | function attributeWrapperAssign(stream, state) {
function attributeWrapperValue (line 248) | function attributeWrapperValue(stream, state) {
function startAttributeWrapperMode (line 265) | function startAttributeWrapperMode(state, endQuote, tokenize) {
function sub (line 278) | function sub(stream, state) {
function firstSub (line 292) | function firstSub(stream, state) {
function createMode (line 298) | function createMode(mode) {
function getMode (line 311) | function getMode(mode) {
function startSubMode (line 318) | function startSubMode(mode, state) {
function doctypeLine (line 335) | function doctypeLine(stream, _state) {
function startLine (line 340) | function startLine(stream, state) {
function slim (line 368) | function slim(stream, state) {
function slimTag (line 375) | function slimTag(stream, state) {
function slimTagExtras (line 386) | function slimTagExtras(stream, state) {
function slimClass (line 393) | function slimClass(stream, state) {
function slimAttribute (line 404) | function slimAttribute(stream, state) {
function slimAttributeAssign (line 419) | function slimAttributeAssign(stream, state) {
function slimAttributeValue (line 428) | function slimAttributeValue(stream, state) {
function slimAttributeSymbols (line 447) | function slimAttributeSymbols(stream, state) {
function readQuoted (line 456) | function readQuoted(quote, style, embed, unescaped, nextTokenize) {
function slimContent (line 490) | function slimContent(stream, state) {
FILE: third_party/CodeMirror/mode/slim/test.js
function MT (line 8) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/smarty/smarty.js
function cont (line 32) | function cont(style, lastType) {
function chain (line 37) | function chain(stream, state, parser) {
function doesNotCount (line 43) | function doesNotCount(stream, pos) {
function tokenTop (line 49) | function tokenTop(stream, state) {
function tokenSmarty (line 75) | function tokenSmarty(stream, state) {
function tokenAttribute (line 158) | function tokenAttribute(quote) {
function tokenBlock (line 174) | function tokenBlock(style, terminator) {
FILE: third_party/CodeMirror/mode/solr/solr.js
function isNumber (line 21) | function isNumber(word) {
function tokenString (line 25) | function tokenString(quote) {
function tokenOperator (line 38) | function tokenOperator(operator) {
function tokenWord (line 57) | function tokenWord(ch) {
function tokenBase (line 76) | function tokenBase(stream, state) {
FILE: third_party/CodeMirror/mode/soy/soy.js
function last (line 30) | function last(array) {
function tokenUntil (line 34) | function tokenUntil(stream, state, untilRegExp) {
function contains (line 56) | function contains(list, element) {
function prepend (line 64) | function prepend(list, element) {
function ref (line 73) | function ref(list, name, loose) {
function popscope (line 77) | function popscope(state) {
FILE: third_party/CodeMirror/mode/soy/test.js
function MT (line 6) | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(argu...
FILE: third_party/CodeMirror/mode/sparql/sparql.js
function wordRegexp (line 18) | function wordRegexp(words) {
function tokenBase (line 37) | function tokenBase(stream, state) {
function tokenLiteral (line 91) | function tokenLiteral(quote) {
function pushContext (line 105) | function pushContext(state, type, col) {
function popContext (line 108) | function popContext(state) {
FILE: third_party/CodeMirror/mode/sql/sql.js
function tokenBase (line 27) | function tokenBase(stream, state) {
function tokenLiteral (line 125) | function tokenLiteral(quote) {
function tokenComment (line 138) | function tokenComment(depth) {
function pushContext (line 149) | function pushContext(stream, state, type) {
function popContext (line 158) | function popContext(state) {
function hookIdentifier (line 207) | function hookIdentifier(stream) {
function hookIdentifierDoublequote (line 219) | function hookIdentifierDoublequote(stream) {
function hookVar (line 232) | function hookVar(stream) {
function hookClient (line 259) | function hookClient(stream) {
function set (line 274) | function set(str) {
FILE: third_party/CodeMirror/mode/stex/stex.js
function pushCommand (line 22) | function pushCommand(state, command) {
function peekCommand (line 26) | function peekCommand(state) {
function popCommand (line 34) | function popCommand(state) {
function getMostPowerful (line 42) | function getMostPowerful(state) {
function addPluginPattern (line 54) | function addPluginPattern(pluginName, cmdStyle, styles) {
function setState (line 96) | function setState(state, f) {
function normal (line 101) | function normal(source, state) {
function inMathMode (line 172) | function inMathMode(source, state, endModeSeq) {
function beginParams (line 217) | function beginParams(source, state) {
FILE: third_party/CodeMirror/mode/stex/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/stylus/stylus.js
function tokenBase (line 47) | function tokenBase(stream, state) {
function tokenCComment (line 164) | function tokenCComment(stream, state) {
function tokenString (line 179) | function tokenString(quote) {
function tokenParenthesized (line 197) | function tokenParenthesized(stream, state) {
function Context (line 209) | function Context(type, indent, prev, line) {
function pushContext (line 216) | function pushContext(state, stream, type, indent) {
function popContext (line 222) | function popContext(state, currentIndent) {
function pass (line 230) | function pass(type, stream, state) {
function popAndPass (line 234) | function popAndPass(type, stream, state, n) {
function wordIsTag (line 244) | function wordIsTag(word) {
function wordIsProperty (line 248) | function wordIsProperty(word) {
function wordIsBlock (line 253) | function wordIsBlock(word) {
function wordIsVendorPrefix (line 257) | function wordIsVendorPrefix(word) {
function wordAsValue (line 261) | function wordAsValue(word) {
function typeIsBlock (line 275) | function typeIsBlock(type, stream) {
function typeIsInterpolation (line 279) | function typeIsInterpolation(type, stream) {
function typeIsPseudo (line 283) | function typeIsPseudo(type, stream) {
function startOfLine (line 287) | function startOfLine(stream) {
function endOfLine (line 291) | function endOfLine(stream) {
function firstWordOfLine (line 295) | function firstWordOfLine(line) {
function wordRegexp (line 754) | function wordRegexp(words) {
function keySet (line 759) | function keySet(array) {
function escapeRegExp (line 765) | function escapeRegExp(text) {
FILE: third_party/CodeMirror/mode/swift/swift.js
function wordSet (line 16) | function wordSet(words) {
function tokenBase (line 45) | function tokenBase(stream, state, prev) {
function tokenUntilClosingParen (line 99) | function tokenUntilClosingParen() {
function tokenString (line 118) | function tokenString(quote) {
function tokenComment (line 143) | function tokenComment(stream, state) {
function Context (line 158) | function Context(prev, align, indented) {
function pushContext (line 164) | function pushContext(state, stream) {
function popContext (line 169) | function popContext(state) {
FILE: third_party/CodeMirror/mode/swift/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/tcl/tcl.js
function parseWords (line 17) | function parseWords(str) {
function chain (line 37) | function chain(stream, state, f) {
function tokenBase (line 41) | function tokenBase(stream, state) {
function tokenString (line 84) | function tokenString(quote) {
function tokenComment (line 98) | function tokenComment(stream, state) {
function tokenUnparsed (line 109) | function tokenUnparsed(stream, state) {
FILE: third_party/CodeMirror/mode/textile/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/textile/textile.js
function startNewLine (line 49) | function startNewLine(stream, state) {
function handlePhraseModifier (line 58) | function handlePhraseModifier(stream, state, ch) {
function togglePhraseModifier (line 119) | function togglePhraseModifier(stream, state, phraseModifier, closeRE, op...
function tokenStyles (line 136) | function tokenStyles(state) {
function textileDisabled (line 153) | function textileDisabled(state) {
function tokenStylesWith (line 168) | function tokenStylesWith(state, extraStyles) {
function activeStyles (line 179) | function activeStyles(state) {
function blankLine (line 188) | function blankLine(state) {
function RE (line 288) | function RE(name) {
FILE: third_party/CodeMirror/mode/tiddlywiki/tiddlywiki.js
function chain (line 61) | function chain(stream, state, f) {
function tokenBase (line 66) | function tokenBase(stream, state) {
function twTokenComment (line 179) | function twTokenComment(stream, state) {
function twTokenStrong (line 192) | function twTokenStrong(stream, state) {
function twTokenCode (line 206) | function twTokenCode(stream, state) {
function twTokenEm (line 228) | function twTokenEm(stream, state) {
function twTokenUnderline (line 242) | function twTokenUnderline(stream, state) {
function twTokenStrike (line 257) | function twTokenStrike(stream, state) {
function twTokenMacro (line 271) | function twTokenMacro(stream, state) {
FILE: third_party/CodeMirror/mode/tiki/tiki.js
function inBlock (line 15) | function inBlock(style, terminator, returnTokenizer) {
function inLine (line 31) | function inLine(style) {
function inText (line 41) | function inText(stream, state) {
function inPlugin (line 133) | function inPlugin(stream, state) {
function inAttribute (line 167) | function inAttribute(quote) {
function inAttributeNoQuote (line 179) | function inAttributeNoQuote() {
function pass (line 194) | function pass() {
function cont (line 198) | function cont() {
function pushContext (line 203) | function pushContext(pluginName, startOfLine) {
function popContext (line 214) | function popContext() {
function element (line 218) | function element(type) {
function endplugin (line 239) | function endplugin(startOfLine) {
function endcloseplugin (line 251) | function endcloseplugin(err) {
function attributes (line 259) | function attributes(type) {
function attvalue (line 264) | function attvalue(type) {
function attvaluemaybe (line 269) | function attvaluemaybe(type) {
FILE: third_party/CodeMirror/mode/tornado/tornado.js
function tokenBase (line 25) | function tokenBase (stream, state) {
function inTag (line 35) | function inTag (close) {
FILE: third_party/CodeMirror/mode/troff/troff.js
function tokenBase (line 18) | function tokenBase(stream) {
function tokenize (line 68) | function tokenize(stream, state) {
FILE: third_party/CodeMirror/mode/ttcn-cfg/ttcn-cfg.js
function tokenBase (line 24) | function tokenBase(stream, state) {
function tokenString (line 61) | function tokenString(quote) {
function Context (line 83) | function Context(indented, column, type, align, prev) {
function pushContext (line 90) | function pushContext(state, col, type) {
function popContext (line 96) | function popContext(state) {
function words (line 154) | function words(str) {
FILE: third_party/CodeMirror/mode/ttcn/ttcn.js
function tokenBase (line 37) | function tokenBase(stream, state) {
function tokenString (line 105) | function tokenString(quote) {
function tokenComment (line 127) | function tokenComment(stream, state) {
function Context (line 139) | function Context(indented, column, type, align, prev) {
function pushContext (line 147) | function pushContext(state, col, type) {
function popContext (line 154) | function popContext(state) {
function words (line 216) | function words(str) {
function def (line 222) | function def(mimes, mode) {
FILE: third_party/CodeMirror/mode/turtle/turtle.js
function wordRegexp (line 18) | function wordRegexp(words) {
function tokenBase (line 25) | function tokenBase(stream, state) {
function tokenLiteral (line 77) | function tokenLiteral(quote) {
function pushContext (line 91) | function pushContext(state, type, col) {
function popContext (line 94) | function popContext(state) {
FILE: third_party/CodeMirror/mode/twig/twig.js
function tokenBase (line 24) | function tokenBase (stream, state) {
FILE: third_party/CodeMirror/mode/vb/vb.js
function wordRegexp (line 17) | function wordRegexp(words) {
function indent (line 54) | function indent(_stream, state) {
function dedent (line 58) | function dedent(_stream, state) {
function tokenBase (line 62) | function tokenBase(stream, state) {
function tokenStringFactory (line 172) | function tokenStringFactory(delimiter) {
function tokenLexer (line 198) | function tokenLexer(stream, state) {
FILE: third_party/CodeMirror/mode/vbscript/vbscript.js
function wordRegexp (line 28) | function wordRegexp(words) {
function indent (line 108) | function indent(_stream, state) {
function dedent (line 112) | function dedent(_stream, state) {
function tokenBase (line 116) | function tokenBase(stream, state) {
function tokenStringFactory (line 259) | function tokenStringFactory(delimiter) {
function tokenLexer (line 285) | function tokenLexer(stream, state) {
FILE: third_party/CodeMirror/mode/velocity/velocity.js
function parseWords (line 15) | function parseWords(str) {
function chain (line 28) | function chain(stream, state, f) {
function tokenBase (line 32) | function tokenBase(stream, state) {
function tokenString (line 129) | function tokenString(quote) {
function tokenComment (line 149) | function tokenComment(stream, state) {
function tokenUnparsed (line 161) | function tokenUnparsed(stream, state) {
FILE: third_party/CodeMirror/mode/verilog/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/verilog/verilog.js
function words (line 23) | function words(str) {
function tokenBase (line 110) | function tokenBase(stream, state) {
function tokenString (line 204) | function tokenString(quote) {
function tokenComment (line 217) | function tokenComment(stream, state) {
function Context (line 229) | function Context(indented, column, type, align, prev) {
function pushContext (line 236) | function pushContext(state, col, type) {
function popContext (line 241) | function popContext(state) {
function isClosing (line 249) | function isClosing(text, contextClosing) {
function buildElectricInputRegEx (line 264) | function buildElectricInputRegEx() {
function tlvScopeStyle (line 448) | function tlvScopeStyle(state, indentation, type) {
function tlvIdentNext (line 455) | function tlvIdentNext(stream) {
FILE: third_party/CodeMirror/mode/vhdl/vhdl.js
function words (line 15) | function words(str) {
function metaHook (line 27) | function metaHook(stream) {
function tokenBase (line 51) | function tokenBase(stream, state) {
function tokenString (line 93) | function tokenString(quote) {
function tokenString2 (line 105) | function tokenString2(quote) {
function Context (line 118) | function Context(indented, column, type, align, prev) {
function pushContext (line 125) | function pushContext(state, col, type) {
function popContext (line 128) | function popContext(state) {
FILE: third_party/CodeMirror/mode/webidl/webidl.js
function wordRegexp (line 14) | function wordRegexp(words) {
function readToken (line 94) | function readToken(stream, state) {
FILE: third_party/CodeMirror/mode/xml/test.js
function MT (line 6) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/xml/xml.js
function inText (line 69) | function inText(stream, state) {
function inTag (line 117) | function inTag(stream, state) {
function inAttribute (line 142) | function inAttribute(quote) {
function inBlock (line 156) | function inBlock(style, terminator) {
function doctype (line 169) | function doctype(depth) {
function Context (line 190) | function Context(state, tagName, startOfLine) {
function popContext (line 198) | function popContext(state) {
function maybePopContext (line 201) | function maybePopContext(state, nextTagName) {
function baseState (line 216) | function baseState(type, stream, state) {
function tagNameState (line 226) | function tagNameState(type, stream, state) {
function closeTagNameState (line 239) | function closeTagNameState(type, stream, state) {
function closeState (line 261) | function closeState(type, _stream, state) {
function closeStateErr (line 269) | function closeStateErr(type, stream, state) {
function attrState (line 274) | function attrState(type, _stream, state) {
function attrEqState (line 293) | function attrEqState(type, stream, state) {
function attrValueState (line 298) | function attrValueState(type, stream, state) {
function attrContinuedState (line 304) | function attrContinuedState(type, stream, state) {
FILE: third_party/CodeMirror/mode/xquery/test.js
function MT (line 11) | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arg...
FILE: third_party/CodeMirror/mode/xquery/xquery.js
function kw (line 21) | function kw(type) {return {type: type, style: "keyword"};}
function chain (line 82) | function chain(stream, state, f) {
function tokenBase (line 88) | function tokenBase(stream, state) {
function tokenComment (line 221) | function tokenComment(stream, state) {
function tokenString (line 244) | function tokenString(quote, f) {
function tokenVariable (line 284) | function tokenVariable(stream, state) {
function tokenTag (line 301) | function tokenTag(name, isclose) {
function tokenAttribute (line 324) | function tokenAttribute(stream, state) {
function tokenXMLComment (line 359) | function tokenXMLComment(stream, state) {
function tokenCDATA (line 371) | function tokenCDATA(stream, state) {
function tokenPreProcessing (line 382) | function tokenPreProcessing(stream, state) {
function isInXmlBlock (line 394) | function isInXmlBlock(state) { return isIn(state, "tag"); }
function isInXmlAttributeBlock (line 395) | function isInXmlAttributeBlock(state) { return isIn(state, "attribute"); }
function isInXmlConstructor (line 396) | function isInXmlConstructor(state) { return isIn(state, "xmlconstructor"...
function isInString (line 397) | function isInString(state) { return isIn(state, "string"); }
function isEQNameAhead (line 399) | function isEQNameAhead(stream) {
function isIn (line 409) | function isIn(state, type) {
function pushStateStack (line 413) | function pushStateStack(state, newState) {
function popStateStack (line 417) | function popStateStack(state) {
FILE: third_party/CodeMirror/mode/yacas/yacas.js
function words (line 19) | function words(str) {
function tokenBase (line 42) | function tokenBase(stream, state) {
function tokenString (line 136) | function tokenString(stream, state) {
function tokenComment (line 151) | function tokenComment(stream, state) {
function currentScope (line 163) | function currentScope(state) {
FILE: third_party/CodeMirror/mode/yaml-frontmatter/yaml-frontmatter.js
function curMode (line 20) | function curMode(state) {
FILE: third_party/CodeMirror/src/display/Display.js
function Display (line 9) | function Display(place, doc, input) {
FILE: third_party/CodeMirror/src/display/focus.js
function ensureFocus (line 6) | function ensureFocus(cm) {
function delayBlurEvent (line 10) | function delayBlurEvent(cm) {
function onFocus (line 18) | function onFocus(cm, e) {
function onBlur (line 37) | function onBlur(cm, e) {
FILE: third_party/CodeMirror/src/display/gutters.js
function updateGutters (line 8) | function updateGutters(cm) {
function setGuttersForLineNumbers (line 26) | function setGuttersForLineNumbers(options) {
FILE: third_party/CodeMirror/src/display/highlight_worker.js
function startWorker (line 10) | function startWorker(cm, time) {
function highlightWorker (line 15) | function highlightWorker(cm) {
FILE: third_party/CodeMirror/src/display/line_numbers.js
function alignHorizontally (line 9) | function alignHorizontally(cm) {
function maybeUpdateLineNumberWidth (line 32) | function maybeUpdateLineNumberWidth(cm) {
FILE: third_party/CodeMirror/src/display/mode_state.js
function loadMode (line 8) | function loadMode(cm) {
function resetModeState (line 13) | function resetModeState(cm) {
FILE: third_party/CodeMirror/src/display/operations.js
function startOperation (line 23) | function startOperation(cm) {
function endOperation (line 45) | function endOperation(cm) {
function endOperations (line 56) | function endOperations(group) {
function endOperation_R1 (line 70) | function endOperation_R1(op) {
function endOperation_W1 (line 83) | function endOperation_W1(op) {
function endOperation_R2 (line 87) | function endOperation_R2(op) {
function endOperation_W2 (line 108) | function endOperation_W2(op) {
function endOperation_finish (line 133) | function endOperation_finish(op) {
function runInOp (line 172) | function runInOp(cm, f) {
function operation (line 179) | function operation(cm, f) {
function methodOp (line 189) | function methodOp(f) {
function docMethodOp (line 197) | function docMethodOp(f) {
FILE: third_party/CodeMirror/src/display/scroll_events.js
function wheelEventDelta (line 28) | function wheelEventDelta(e) {
function wheelEventPixels (line 35) | function wheelEventPixels(e) {
function onScrollWheel (line 42) | function onScrollWheel(cm, e) {
FILE: third_party/CodeMirror/src/display/scrollbars.js
function measureForScrollbars (line 14) | function measureForScrollbars(cm) {
class NativeScrollbars (line 30) | class NativeScrollbars {
method constructor (line 31) | constructor(place, scroll, cm) {
method update (line 50) | update(measure) {
method setScrollLeft (line 87) | setScrollLeft(pos) {
method setScrollTop (line 92) | setScrollTop(pos) {
method zeroWidthHack (line 97) | zeroWidthHack() {
method enableZeroWidthBar (line 105) | enableZeroWidthBar(bar, delay, type) {
method clear (line 123) | clear() {
class NullScrollbars (line 130) | class NullScrollbars {
method update (line 131) | update() { return {bottom: 0, right: 0} }
method setScrollLeft (line 132) | setScrollLeft() {}
method setScrollTop (line 133) | setScrollTop() {}
method clear (line 134) | clear() {}
function updateScrollbars (line 137) | function updateScrollbars(cm, measure) {
function updateScrollbarsInner (line 151) | function updateScrollbarsInner(cm, measure) {
function initScrollbars (line 173) | function initScrollbars(cm) {
FILE: third_party/CodeMirror/src/display/scrolling.js
function maybeScrollWindow (line 15) | function maybeScrollWindow(cm, rect) {
function scrollPosIntoView (line 35) | function scrollPosIntoView(cm, pos, end, margin) {
function scrollIntoView (line 69) | function scrollIntoView(cm, rect) {
function calculateScrollPos (line 79) | function calculateScrollPos(cm, rect) {
function addToScrollTop (line 109) | function addToScrollTop(cm, top) {
function ensureCursorVisible (line 117) | function ensureCursorVisible(cm) {
function scrollToCoords (line 123) | function scrollToCoords(cm, x, y) {
function scrollToRange (line 129) | function scrollToRange(cm, range) {
function resolveScrollToPos (line 138) | function resolveScrollToPos(cm) {
function scrollToCoordsRange (line 147) | function scrollToCoordsRange(cm, from, to, margin) {
function updateScrollTop (line 159) | function updateScrollTop(cm, val) {
function setScrollTop (line 167) | function setScrollTop(cm, val, forceScroll) {
function setScrollLeft (line 177) | function setScrollLeft(cm, val, isScroller, forceScroll) {
FILE: third_party/CodeMirror/src/display/selection.js
function updateSelection (line 8) | function updateSelection(cm) {
function prepareSelection (line 12) | function prepareSelection(cm, primary = true) {
function drawSelectionCursor (line 31) | function drawSelectionCursor(cm, head, output) {
function cmpCoords (line 49) | function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
function drawSelectionRange (line 52) | function drawSelectionRange(cm, range, output) {
function restartBlink (line 147) | function restartBlink(cm) {
FILE: third_party/CodeMirror/src/display/update_display.js
class DisplayUpdate (line 20) | class DisplayUpdate {
method constructor (line 21) | constructor(cm, viewport, force) {
method signal (line 36) | signal(emitter, type) {
method finish (line 40) | finish() {
function maybeClipScrollbars (line 46) | function maybeClipScrollbars(cm) {
function selectionSnapshot (line 57) | function selectionSnapshot(cm) {
function restoreSelection (line 74) | function restoreSelection(snapshot) {
function updateDisplayIfNeeded (line 90) | function updateDisplayIfNeeded(cm, update) {
function postUpdateDisplay (line 162) | function postUpdateDisplay(cm, update) {
function updateDisplaySimple (line 192) | function updateDisplaySimple(cm, viewport) {
function patchDisplay (line 209) | function patchDisplay(cm, updateNumbersFrom, dims) {
function updateGutterSpace (line 251) | function updateGutterSpace(cm) {
function setDocumentHeight (line 256) | function setDocumentHeight(cm, measure) {
FILE: third_party/CodeMirror/src/display/update_line.js
function updateLineForChanges (line 10) | function updateLineForChanges(cm, lineView, lineN, dims) {
function ensureLineWrapped (line 23) | function ensureLineWrapped(lineView) {
function updateLineBackground (line 34) | function updateLineBackground(cm, lineView) {
function getLineContent (line 49) | function getLineContent(cm, lineView) {
function updateLineText (line 62) | function updateLineText(cm, lineView) {
function updateLineClasses (line 77) | function updateLineClasses(cm, lineView) {
function updateLineGutter (line 87) | function updateLineGutter(cm, lineView, lineN, dims) {
function updateLineWidgets (line 125) | function updateLineWidgets(cm, lineView, dims) {
function buildLineElement (line 136) | function buildLineElement(cm, lineView, lineN, dims) {
function insertLineWidgets (line 150) | function insertLineWidgets(cm, lineView, dims) {
function insertLineWidgetsFor (line 156) | function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
function positionLineWidget (line 172) | function positionLineWidget(widget, node, lineView, dims) {
FILE: third_party/CodeMirror/src/display/update_lines.js
function updateHeightsInViewport (line 8) | function updateHeightsInViewport(cm) {
function updateWidgetHeight (line 48) | function updateWidgetHeight(line) {
function visibleLines (line 58) | function visibleLines(display, doc, viewport) {
FILE: third_party/CodeMirror/src/display/view_tracking.js
function regChange (line 13) | function regChange(cm, from, to, lendiff) {
function regLineChange (line 78) | function regLineChange(cm, line, type) {
function resetView (line 92) | function resetView(cm) {
function viewCuttingPoint (line 98) | function viewCuttingPoint(cm, oldN, newN, dir) {
function adjustView (line 125) | function adjustView(cm, from, to) {
function countDirtyView (line 146) | function countDirtyView(cm) {
FILE: third_party/CodeMirror/src/edit/CodeMirror.js
function CodeMirror (line 30) | function CodeMirror(place, options) {
function registerEventHandlers (line 107) | function registerEventHandlers(cm) {
FILE: third_party/CodeMirror/src/edit/commands.js
function lineStart (line 156) | function lineStart(cm, lineN) {
function lineEnd (line 162) | function lineEnd(cm, lineN) {
function lineStartSmart (line 168) | function lineStartSmart(cm, pos) {
FILE: third_party/CodeMirror/src/edit/deleteNearSelection.js
function deleteNearSelection (line 9) | function deleteNearSelection(cm, compute) {
FILE: third_party/CodeMirror/src/edit/drop_events.js
function onDrop (line 19) | function onDrop(e) {
function onDragStart (line 79) | function onDragStart(cm, e) {
function onDragOver (line 102) | function onDragOver(cm, e) {
function clearDragCursor (line 114) | function clearDragCursor(cm) {
FILE: third_party/CodeMirror/src/edit/fromTextArea.js
function fromTextArea (line 6) | function fromTextArea(textarea, options) {
FILE: third_party/CodeMirror/src/edit/global_events.js
function forEachCodeMirror (line 8) | function forEachCodeMirror(f) {
function ensureGlobalHandlers (line 21) | function ensureGlobalHandlers() {
function registerGlobalHandlers (line 26) | function registerGlobalHandlers() {
function onResize (line 39) | function onResize(cm) {
FILE: third_party/CodeMirror/src/edit/key_events.js
function doHandleBinding (line 14) | function doHandleBinding(cm, bound, dropShift) {
function lookupKeyForEditor (line 34) | function lookupKeyForEditor(cm, name, handle) {
function dispatchKey (line 48) | function dispatchKey(cm, name, e, handle) {
function dispatchKeyInner (line 66) | function dispatchKeyInner(cm, name, e, handle) {
function handleKeyBinding (line 83) | function handleKeyBinding(cm, e) {
function handleCharBinding (line 102) | function handleCharBinding(cm, e, ch) {
function onKeyDown (line 107) | function onKeyDown(e) {
function showCrossHair (line 128) | function showCrossHair(cm) {
function onKeyUp (line 143) | function onKeyUp(e) {
function onKeyPress (line 148) | function onKeyPress(e) {
FILE: third_party/CodeMirror/src/edit/legacy.js
function addLegacyProps (line 20) | function addLegacyProps(CodeMirror) {
FILE: third_party/CodeMirror/src/edit/methods.js
function findPosH (line 466) | function findPosH(doc, pos, dir, unit, visually) {
function findPosV (line 526) | function findPosV(cm, pos, dir, unit) {
FILE: third_party/CodeMirror/src/edit/mouse_events.js
constant DOUBLECLICK_DELAY (line 22) | const DOUBLECLICK_DELAY = 400
class PastClick (line 24) | class PastClick {
method constructor (line 25) | constructor(time, pos, button) {
method compare (line 31) | compare(time, pos, button) {
function clickRepeat (line 38) | function clickRepeat(pos, button) {
function onMouseDown (line 59) | function onMouseDown(e) {
function handleMappedButton (line 96) | function handleMappedButton(cm, button, pos, repeat, event) {
function configureMouse (line 116) | function configureMouse(cm, repeat, event) {
function leftButtonDown (line 129) | function leftButtonDown(cm, pos, repeat, event) {
function leftButtonStartDrag (line 147) | function leftButtonStartDrag(cm, event, pos, behavior) {
function rangeForUnit (line 186) | function rangeForUnit(cm, pos, unit) {
function leftButtonSelect (line 195) | function leftButtonSelect(cm, event, start, behavior) {
function bidiSimplify (line 327) | function bidiSimplify(cm, range) {
function gutterEvent (line 360) | function gutterEvent(cm, e, type, prevent) {
function clickInGutter (line 389) | function clickInGutter(cm, e) {
function onContextMenu (line 398) | function onContextMenu(cm, e) {
function contextMenuInGutter (line 404) | function contextMenuInGutter(cm, e) {
FILE: third_party/CodeMirror/src/edit/options.js
function defineOptions (line 25) | function defineOptions(CodeMirror) {
function guttersChanged (line 163) | function guttersChanged(cm) {
function dragDropChanged (line 169) | function dragDropChanged(cm, value, old) {
function wrappingChanged (line 182) | function wrappingChanged(cm) {
FILE: third_party/CodeMirror/src/edit/utils.js
function themeChanged (line 3) | function themeChanged(cm) {
FILE: third_party/CodeMirror/src/input/ContentEditableInput.js
class ContentEditableInput (line 19) | class ContentEditableInput {
method constructor (line 20) | constructor(cm) {
method init (line 29) | init(display) {
method prepareSelection (line 102) | prepareSelection() {
method showSelection (line 108) | showSelection(info, takeFocus) {
method getSelection (line 114) | getSelection() {
method showPrimarySelection (line 118) | showPrimarySelection() {
method startGracePeriod (line 169) | startGracePeriod() {
method showMultipleSelections (line 178) | showMultipleSelections(info) {
method rememberSelection (line 183) | rememberSelection() {
method selectionInEditor (line 189) | selectionInEditor() {
method focus (line 196) | focus() {
method blur (line 203) | blur() { this.div.blur() }
method getField (line 204) | getField() { return this.div }
method supportsTouch (line 206) | supportsTouch() { return true }
method receivedFocus (line 208) | receivedFocus() {
method selectionChanged (line 224) | selectionChanged() {
method pollSelection (line 230) | pollSelection() {
method pollContent (line 255) | pollContent() {
method ensurePolled (line 326) | ensurePolled() {
method reset (line 329) | reset() {
method forceCompositionEnd (line 332) | forceCompositionEnd() {
method readFromDOMSoon (line 340) | readFromDOMSoon() {
method updateFromDOM (line 352) | updateFromDOM() {
method setUneditable (line 357) | setUneditable(node) {
method onKeyPress (line 361) | onKeyPress(e) {
method readOnlyChanged (line 368) | readOnlyChanged(val) {
method onContextMenu (line 372) | onContextMenu() {}
method resetPosition (line 373) | resetPosition() {}
function posToDOM (line 378) | function posToDOM(cm, pos) {
function isInGutter (line 394) | function isInGutter(node) {
function badPos (line 400) | function badPos(pos, bad) { if (bad) pos.bad = true; return pos }
function domTextBetween (line 402) | function domTextBetween(cm, from, to, fromLine, toLine) {
function domToPos (line 455) | function domToPos(cm, node, offset) {
function locateNodeInLineView (line 474) | function locateNodeInLineView(lineView, node, offset) {
FILE: third_party/CodeMirror/src/input/TextareaInput.js
class TextareaInput (line 16) | class TextareaInput {
method constructor (line 17) | constructor(cm) {
method init (line 33) | init(display) {
method createField (line 105) | createField(_display) {
method prepareSelection (line 113) | prepareSelection() {
method showSelection (line 131) | showSelection(drawn) {
method reset (line 143) | reset(typing) {
method getField (line 158) | getField() { return this.textarea }
method supportsTouch (line 160) | supportsTouch() { return false }
method focus (line 162) | focus() {
method blur (line 169) | blur() { this.textarea.blur() }
method resetPosition (line 171) | resetPosition() {
method receivedFocus (line 175) | receivedFocus() { this.slowPoll() }
method slowPoll (line 179) | slowPoll() {
method fastPoll (line 190) | fastPoll() {
method poll (line 207) | poll() {
method ensurePolled (line 256) | ensurePolled() {
method onKeyPress (line 260) | onKeyPress() {
method onContextMenu (line 265) | onContextMenu(e) {
method readOnlyChanged (line 349) | readOnlyChanged(val) {
method setUneditable (line 354) | setUneditable() {}
FILE: third_party/CodeMirror/src/input/indent.js
function indentLine (line 14) | function indentLine(cm, n, how, aggressive) {
FILE: third_party/CodeMirror/src/input/input.js
function setLastCopied (line 19) | function setLastCopied(newLastCopied) {
function applyTextInput (line 23) | function applyTextInput(cm, inserted, deleted, sel, origin) {
function handlePaste (line 70) | function handlePaste(e, cm) {
function triggerElectric (line 80) | function triggerElectric(cm, inserted) {
function copyableRanges (line 104) | function copyableRanges(cm) {
function disableBrowserMagic (line 115) | function disableBrowserMagic(field, spellcheck, autocorrect, autocapital...
function hiddenTextarea (line 121) | function hiddenTextarea() {
FILE: third_party/CodeMirror/src/input/keymap.js
function normalizeKeyName (line 51) | function normalizeKeyName(name) {
function normalizeKeyMap (line 75) | function normalizeKeyMap(keymap) {
function lookupKey (line 102) | function lookupKey(key, map, handle, context) {
function isModifierKey (line 121) | function isModifierKey(value) {
function addModifierNames (line 126) | function addModifierNames(name, event, noShift) {
function keyName (line 136) | function keyName(event, noShift) {
function getKeyMap (line 146) | function getKeyMap(val) {
FILE: third_party/CodeMirror/src/input/movement.js
function moveCharLogically (line 6) | function moveCharLogically(line, ch, dir) {
function moveLogically (line 11) | function moveLogically(line, start, dir) {
function endOfLine (line 16) | function endOfLine(visually, cm, lineObj, lineNo, dir) {
function moveVisually (line 43) | function moveVisually(cm, line, start, dir) {
FILE: third_party/CodeMirror/src/line/highlight.js
class SavedContext (line 8) | class SavedContext {
method constructor (line 9) | constructor(state, lookAhead) {
class Context (line 15) | class Context {
method constructor (line 16) | constructor(doc, state, line, lookAhead) {
method lookAhead (line 25) | lookAhead(n) {
method baseToken (line 31) | baseToken(n) {
method nextLine (line 40) | nextLine() {
method fromSaved (line 45) | static fromSaved(doc, saved, line) {
method save (line 52) | save(copy) {
function highlightLine (line 63) | function highlightLine(cm, line, context, forceToEnd) {
function getLineStyles (line 106) | function getLineStyles(cm, line, updateFrontier) {
function getContextBefore (line 122) | function getContextBefore(cm, n, precise) {
function processLine (line 142) | function processLine(cm, text, context, startAt) {
function callBlankLine (line 153) | function callBlankLine(mode, state) {
function readToken (line 160) | function readToken(mode, stream, state, inner) {
class Token (line 169) | class Token {
method constructor (line 170) | constructor(stream, type, state) {
function takeToken (line 179) | function takeToken(cm, pos, precise, asArray) {
function extractLineClasses (line 193) | function extractLineClasses(type, output) {
function runMode (line 208) | function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
function findStartLine (line 252) | function findStartLine(cm, n, precise) {
function retreatFrontier (line 269) | function retreatFrontier(doc, n) {
FILE: third_party/CodeMirror/src/line/line_data.js
class Line (line 16) | class Line {
method constructor (line 17) | constructor(text, markedSpans, estimateHeight) {
method lineNo (line 23) | lineNo() { return lineNo(this) }
function updateLine (line 30) | function updateLine(line, text, markedSpans, estimateHeight) {
function cleanUpLine (line 42) | function cleanUpLine(line) {
function interpretTokenStyle (line 51) | function interpretTokenStyle(style, options) {
function buildLineContent (line 63) | function buildLineContent(cm, lineView) {
function defaultSpecialCharPlaceholder (line 121) | function defaultSpecialCharPlaceholder(ch) {
function buildToken (line 130) | function buildToken(builder, text, style, startStyle, endStyle, css, att...
function splitSpaces (line 197) | function splitSpaces(text, trailingBefore) {
function buildTokenBadBidi (line 212) | function buildTokenBadBidi(inner, order) {
function buildCollapsedSpan (line 232) | function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
function insertLineContent (line 250) | function insertLineContent(line, builder, styles) {
function LineView (line 329) | function LineView(doc, line, lineN) {
function buildViewArray (line 341) | function buildViewArray(cm, from, to) {
FILE: third_party/CodeMirror/src/line/pos.js
function Pos (line 4) | function Pos(line, ch, sticky = null) {
function cmp (line 13) | function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
function equalCursorPos (line 15) | function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b)...
function copyPos (line 17) | function copyPos(x) {return Pos(x.line, x.ch)}
function maxPos (line 18) | function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
function minPos (line 19) | function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
function clipLine (line 23) | function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.fi...
function clipPos (line 24) | function clipPos(doc, pos) {
function clipToLen (line 30) | function clipToLen(pos, linelen) {
function clipPosArray (line 36) | function clipPosArray(doc, array) {
FILE: third_party/CodeMirror/src/line/saw_special_spans.js
function seeReadOnlySpans (line 4) | function seeReadOnlySpans() {
function seeCollapsedSpans (line 8) | function seeCollapsedSpans() {
FILE: third_party/CodeMirror/src/line/spans.js
function MarkedSpan (line 9) | function MarkedSpan(marker, from, to) {
function getMarkedSpanFor (line 15) | function getMarkedSpanFor(spans, marker) {
function removeMarkedSpan (line 23) | function removeMarkedSpan(spans, span) {
function addMarkedSpan (line 30) | function addMarkedSpan(line, span) {
function markedSpansBefore (line 39) | function markedSpansBefore(old, startCh, isInsert) {
function markedSpansAfter (line 51) | function markedSpansAfter(old, endCh, isInsert) {
function stretchSpansOverChange (line 71) | function stretchSpansOverChange(doc, change) {
function clearEmptySpans (line 133) | function clearEmptySpans(spans) {
function removeReadOnlyRanges (line 144) | function removeReadOnlyRanges(doc, from, to) {
function detachMarkedSpans (line 173) | function detachMarkedSpans(line) {
function attachMarkedSpans (line 180) | function attachMarkedSpans(line, spans) {
function extraLeft (line 189) | function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
function extraRight (line 190) | function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
function compareCollapsedMarkers (line 195) | function compareCollapsedMarkers(a, b) {
function collapsedSpanAtSide (line 208) | function collapsedSpanAtSide(line, start) {
function collapsedSpanAtStart (line 218) | function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, t...
function collapsedSpanAtEnd (line 219) | function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, fal...
function collapsedSpanAround (line 221) | function collapsedSpanAround(line, ch) {
function conflictingCollapsedRange (line 234) | function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
function visualLine (line 254) | function visualLine(line) {
function visualLineEnd (line 261) | function visualLineEnd(line) {
function visualLineContinued (line 270) | function visualLineContinued(line) {
function visualLineNo (line 281) | function visualLineNo(doc, lineN) {
function visualLineEndNo (line 289) | function visualLineEndNo(doc, lineN) {
function lineIsHidden (line 301) | function lineIsHidden(doc, line) {
function lineIsHiddenInner (line 312) | function lineIsHiddenInner(doc, line, span) {
function heightAtLine (line 329) | function heightAtLine(lineObj) {
function lineLength (line 351) | function lineLength(line) {
function findMaxLine (line 370) | function findMaxLine(cm) {
FILE: third_party/CodeMirror/src/line/utils_line.js
function getLine (line 4) | function getLine(doc, n) {
function getBetween (line 20) | function getBetween(doc, start, end) {
function getLines (line 32) | function getLines(doc, from, to) {
function updateLineHeight (line 40) | function updateLineHeight(line, height) {
function lineNo (line 47) | function lineNo(line) {
function lineAtHeight (line 61) | function lineAtHeight(chunk, h) {
function isLine (line 81) | function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
function lineNumberFor (line 83) | function lineNumberFor(options, i) {
FILE: third_party/CodeMirror/src/measurement/position_measurement.js
function paddingTop (line 17) | function paddingTop(display) {return display.lineSpace.offsetTop}
function paddingVert (line 18) | function paddingVert(display) {return display.mover.offsetHeight - displ...
function paddingH (line 19) | function paddingH(display) {
function scrollGap (line 28) | function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
function displayWidth (line 29) | function displayWidth(cm) {
function displayHeight (line 32) | function displayHeight(cm) {
function ensureLineHeights (line 40) | function ensureLineHeights(cm, lineView, rect) {
function mapFromLineView (line 61) | function mapFromLineView(lineView, line, lineN) {
function updateExternalMeasurement (line 74) | function updateExternalMeasurement(cm, line) {
function measureChar (line 87) | function measureChar(cm, line, ch, bias) {
function findViewForLine (line 92) | function findViewForLine(cm, lineN) {
function prepareMeasureForLine (line 105) | function prepareMeasureForLine(cm, line) {
function measureCharPrepared (line 127) | function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
function nodeAndOffsetInLineMap (line 149) | function nodeAndOffsetInLineMap(map, ch, bias) {
function getUsefulRect (line 187) | function getUsefulRect(rects, bias) {
function measureCharInner (line 197) | function measureCharInner(cm, prepared, ch, bias) {
function maybeUpdateRectForZooming (line 250) | function maybeUpdateRectForZooming(measure, rect) {
function clearLineMeasurementCacheFor (line 260) | function clearLineMeasurementCacheFor(lineView) {
function clearLineMeasurementCache (line 269) | function clearLineMeasurementCache(cm) {
function clearCaches (line 276) | function clearCaches(cm) {
function pageScrollX (line 283) | function pageScrollX() {
function pageScrollY (line 290) | function pageScrollY() {
function widgetTopHeight (line 295) | function widgetTopHeight(lineObj) {
function intoCoordSystem (line 306) | function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
function fromCoordSystem (line 328) | function fromCoordSystem(cm, coords, context) {
function charCoords (line 345) | function charCoords(cm, pos, context, lineObj, bias) {
function cursorCoords (line 366) | function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHei...
function estimateCoords (line 397) | function estimateCoords(cm, pos) {
function PosWithInfo (line 412) | function PosWithInfo(line, ch, sticky, outside, xRel) {
function coordsChar (line 421) | function coordsChar(cm, x, y) {
function wrappedLineExtent (line 441) | function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
function wrappedLineExtentChar (line 449) | function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
function boxIsAfter (line 457) | function boxIsAfter(box, x, y, left) {
function coordsCharInner (line 461) | function coordsCharInner(cm, lineObj, lineNo, x, y) {
function coordsBidiPart (line 528) | function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, ...
function coordsBidiPartWrapped (line 552) | function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, or...
function textHeight (line 585) | function textHeight(display) {
function charWidth (line 605) | function charWidth(display) {
function getDimensions (line 617) | function getDimensions(cm) {
function compensateForHScroll (line 634) | function compensateForHScroll(display) {
function estimateHeight (line 641) | function estimateHeight(cm) {
function estimateLineHeights (line 659) | function estimateLineHeights(cm) {
function posFromMouse (line 672) | function posFromMouse(cm, e, liberal, forRect) {
function findViewIndex (line 690) | function findViewIndex(cm, n) {
FILE: third_party/CodeMirror/src/measurement/widgets.js
function widgetHeight (line 4) | function widgetHeight(widget) {
function eventInWidget (line 20) | function eventInWidget(display, e) {
FILE: third_party/CodeMirror/src/model/change_measurement.js
function changeEnd (line 8) | function changeEnd(change) {
function adjustForChange (line 16) | function adjustForChange(pos, change) {
function computeSelAfterChange (line 25) | function computeSelAfterChange(doc, change) {
function offsetPos (line 35) | function offsetPos(pos, old, nw) {
function computeReplacedSel (line 44) | function computeReplacedSel(doc, changes, hint) {
FILE: third_party/CodeMirror/src/model/changes.js
function filterChange (line 23) | function filterChange(doc, change, update) {
function makeChange (line 50) | function makeChange(doc, change, ignoreReadOnly) {
function makeChangeInner (line 72) | function makeChangeInner(doc, change) {
function makeChangeFromHistory (line 90) | function makeChangeFromHistory(doc, type, allowSelectionOnly) {
function shiftDoc (line 160) | function shiftDoc(doc, distance) {
function makeChangeSingleDoc (line 176) | function makeChangeSingleDoc(doc, change, selAfter, spans) {
function makeChangeSingleDocInEditor (line 209) | function makeChangeSingleDocInEditor(cm, change, spans) {
function replaceRange (line 267) | function replaceRange(doc, code, from, to, origin) {
function rebaseHistSelSingle (line 276) | function rebaseHistSelSingle(pos, from, to, diff) {
function rebaseHistArray (line 292) | function rebaseHistArray(array, from, to, diff) {
function rebaseHist (line 320) | function rebaseHist(hist, change) {
function changeLine (line 329) | function changeLine(doc, handle, changeType, op) {
FILE: third_party/CodeMirror/src/model/chunk.js
function LeafChunk (line 18) | function LeafChunk(lines) {
method chunkSize (line 30) | chunkSize() { return this.lines.length }
method removeInner (line 33) | removeInner(at, n) {
method collapse (line 44) | collapse(lines) {
method insertInner (line 50) | insertInner(at, lines, height) {
method iterN (line 57) | iterN(at, n, op) {
function BranchChunk (line 63) | function BranchChunk(children) {
method chunkSize (line 77) | chunkSize() { return this.size }
method removeInner (line 79) | removeInner(at, n) {
method collapse (line 103) | collapse(lines) {
method insertInner (line 107) | insertInner(at, lines, height) {
method maybeSpill (line 134) | maybeSpill() {
method iterN (line 156) | iterN(at, n, op) {
FILE: third_party/CodeMirror/src/model/document_data.js
function isWholeLineUpdate (line 17) | function isWholeLineUpdate(doc, change) {
function updateDoc (line 23) | function updateDoc(doc, change, markedSpans, estimateHeight) {
function linkedDocs (line 75) | function linkedDocs(doc, f, sharedHistOnly) {
function attachDoc (line 90) | function attachDoc(cm, doc) {
function setDirectionClass (line 102) | function setDirectionClass(cm) {
function directionChanged (line 106) | function directionChanged(cm) {
FILE: third_party/CodeMirror/src/model/history.js
function History (line 11) | function History(startGen) {
function historyChangeFromChange (line 28) | function historyChangeFromChange(doc, change) {
function clearSelectionEvents (line 37) | function clearSelectionEvents(array) {
function lastChangeEvent (line 47) | function lastChangeEvent(hist, force) {
function addChangeToHistory (line 62) | function addChangeToHistory(doc, change, selAfter, opId) {
function selectionEventCanBeMerged (line 105) | function selectionEventCanBeMerged(doc, origin, prev, sel) {
function addSelectionToHistory (line 118) | function addSelectionToHistory(doc, sel, opId, options) {
function pushSelectionToHistory (line 140) | function pushSelectionToHistory(sel, dest) {
function attachLocalSpans (line 147) | function attachLocalSpans(doc, change, from, to) {
function removeClearedSpans (line 158) | function removeClearedSpans(spans) {
function getOldSpans (line 169) | function getOldSpans(doc, change) {
function mergeOldSpans (line 182) | function mergeOldSpans(doc, change) {
function copyHistoryArray (line 206) | function copyHistoryArray(events, newGroup, instantiateSel) {
FILE: third_party/CodeMirror/src/model/line_widget.js
class LineWidget (line 13) | class LineWidget {
method constructor (line 14) | constructor(doc, node, options) {
method clear (line 21) | clear() {
method changed (line 37) | changed() {
function adjustScrollWhenAboveVisible (line 54) | function adjustScrollWhenAboveVisible(cm, line, diff) {
function addLineWidget (line 59) | function addLineWidget(doc, handle, node, options) {
FILE: third_party/CodeMirror/src/model/mark_text.js
class TextMarker (line 35) | class TextMarker {
method constructor (line 36) | constructor(doc, type) {
method clear (line 44) | clear() {
method find (line 91) | find(side, lineObj) {
method changed (line 111) | changed() {
method attachLine (line 133) | attachLine(line) {
method detachLine (line 142) | detachLine(line) {
function markText (line 153) | function markText(doc, from, to, options, type) {
class SharedTextMarker (line 228) | class SharedTextMarker {
method constructor (line 229) | constructor(markers, primary) {
method clear (line 236) | clear() {
method find (line 244) | find(side, lineObj) {
function markTextShared (line 250) | function markTextShared(doc, from, to, options, type) {
function findSharedMarkers (line 265) | function findSharedMarkers(doc) {
function copySharedMarkers (line 269) | function copySharedMarkers(doc, markers) {
function detachSharedMarkers (line 281) | function detachSharedMarkers(markers) {
FILE: third_party/CodeMirror/src/model/selection.js
class Selection (line 9) | class Selection {
method constructor (line 10) | constructor(ranges, primIndex) {
method primary (line 15) | primary() { return this.ranges[this.primIndex] }
method equals (line 17) | equals(other) {
method deepCopy (line 27) | deepCopy() {
method somethingSelected (line 34) | somethingSelected() {
method contains (line 40) | contains(pos, end) {
class Range (line 51) | class Range {
method constructor (line 52) | constructor(anchor, head) {
method from (line 56) | from() { return minPos(this.anchor, this.head) }
method to (line 57) | to() { return maxPos(this.anchor, this.head) }
method empty (line 58) | empty() { return this.head.line == this.anchor.line && this.head.ch ==...
function normalizeSelection (line 64) | function normalizeSelection(cm, ranges, primIndex) {
function simpleSelection (line 82) | function simpleSelection(anchor, head) {
FILE: third_party/CodeMirror/src/model/selection_updates.js
function extendRange (line 19) | function extendRange(range, head, other, extend) {
function extendSelection (line 38) | function extendSelection(doc, head, other, options, extend) {
function extendSelections (line 45) | function extendSelections(doc, heads, options) {
function replaceOneSelection (line 55) | function replaceOneSelection(doc, i, range, options) {
function setSimpleSelection (line 62) | function setSimpleSelection(doc, anchor, head, options) {
function filterSelectionChange (line 68) | function filterSelectionChange(doc, sel, options) {
function setSelectionReplaceHistory (line 85) | function setSelectionReplaceHistory(doc, sel, options) {
function setSelection (line 96) | function setSelection(doc, sel, options) {
function setSelectionNoUndo (line 101) | function setSelectionNoUndo(doc, sel, options) {
function setSelectionInner (line 113) | function setSelectionInner(doc, sel) {
function reCheckSelection (line 128) | function reCheckSelection(doc) {
function skipAtomicInSelection (line 134) | function skipAtomicInSelection(doc, sel, bias, mayClear) {
function skipAtomicInner (line 149) | function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
function skipAtomic (line 182) | function skipAtomic(doc, pos, oldPos, bias, mayClear) {
function movePos (line 195) | function movePos(doc, pos, dir, line) {
function selectAll (line 207) | function selectAll(cm) {
FILE: third_party/CodeMirror/src/modes.js
function defineMode (line 9) | function defineMode(name, mode) {
function defineMIME (line 15) | function defineMIME(mime, spec) {
function resolveMode (line 21) | function resolveMode(spec) {
function getMode (line 40) | function getMode(options, spec) {
function extendMode (line 64) | function extendMode(mode, properties) {
function copyState (line 69) | function copyState(mode, state) {
function innerMode (line 83) | function innerMode(mode, state) {
function startState (line 94) | function startState(mode, a1, a2) {
FILE: third_party/CodeMirror/src/util/StringStream.js
class StringStream (line 8) | class StringStream {
method constructor (line 9) | constructor(string, tabSize, lineOracle) {
method eol (line 18) | eol() {return this.pos >= this.string.length}
method sol (line 19) | sol() {return this.pos == this.lineStart}
method peek (line 20) | peek() {return this.string.charAt(this.pos) || undefined}
method next (line 21) | next() {
method eat (line 25) | eat(match) {
method eatWhile (line 32) | eatWhile(match) {
method eatSpace (line 37) | eatSpace() {
method skipToEnd (line 42) | skipToEnd() {this.pos = this.string.length}
method skipTo (line 43) | skipTo(ch) {
method backUp (line 47) | backUp(n) {this.pos -= n}
method column (line 48) | column() {
method indentation (line 55) | indentation() {
method match (line 59) | match(pattern, consume, caseInsensitive) {
method current (line 74) | current(){return this.string.slice(this.start, this.pos)}
method hideFirstChars (line 75) | hideFirstChars(n, inner) {
method lookAhead (line 80) | lookAhead(n) {
method baseToken (line 84) | baseToken() {
FILE: third_party/CodeMirror/src/util/bidi.js
function iterateBidiSections (line 5) | function iterateBidiSections(order, from, to, f) {
function getBidiPartAt (line 19) | function getBidiPartAt(order, ch, sticky) {
function charType (line 65) | function charType(code) {
function BidiSpan (line 78) | function BidiSpan(level, from, to) {
function getOrder (line 210) | function getOrder(line, direction) {
FILE: third_party/CodeMirror/src/util/dom.js
function classTest (line 3) | function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)...
function removeChildren (line 14) | function removeChildren(e) {
function removeChildrenAndAdd (line 20) | function removeChildrenAndAdd(parent, e) {
function elt (line 24) | function elt(tag, content, className, style) {
function eltP (line 33) | function eltP(tag, content, className, style) {
function contains (line 56) | function contains(parent, child) {
function activeElt (line 67) | function activeElt() {
function addClass (line 82) | function addClass(node, cls) {
function joinClasses (line 86) | function joinClasses(a, b) {
FILE: third_party/CodeMirror/src/util/event.js
function getHandlers (line 22) | function getHandlers(emitter, type) {
function off (line 26) | function off(emitter, type, f) {
function signal (line 41) | function signal(emitter, type /*, values...*/) {
function signalDOMEvent (line 51) | function signalDOMEvent(cm, e, override) {
function signalCursorActivity (line 58) | function signalCursorActivity(cm) {
function hasHandler (line 66) | function hasHandler(emitter, type) {
function eventMixin (line 72) | function eventMixin(ctor) {
function e_preventDefault (line 80) | function e_preventDefault(e) {
function e_stopPropagation (line 84) | function e_stopPropagation(e) {
function e_defaultPrevented (line 88) | function e_defaultPrevented(e) {
function e_stop (line 91) | function e_stop(e) {e_preventDefault(e); e_stopPropagation(e)}
function e_target (line 93) | function e_target(e) {return e.target || e.srcElement}
function e_button (line 94) | function e_button(e) {
FILE: third_party/CodeMirror/src/util/feature_detection.js
function zeroWidthElement (line 14) | function zeroWidthElement(measure) {
function hasBadBidiRects (line 29) | function hasBadBidiRects(measure) {
function hasBadZoomedRects (line 78) | function hasBadZoomedRects(measure) {
FILE: third_party/CodeMirror/src/util/misc.js
function bind (line 1) | function bind(f) {
function copyObj (line 6) | function copyObj(obj, target, overwrite) {
function countColumn (line 16) | function countColumn(string, end, tabSize, startIndex, startValue) {
class Delayed (line 31) | class Delayed {
method constructor (line 32) | constructor() {this.id = null}
method set (line 33) | set(ms, f) {
function indexOf (line 39) | function indexOf(array, elt) {
function findColumn (line 57) | function findColumn(string, goal, tabSize) {
function spaceStr (line 72) | function spaceStr(n) {
function lst (line 78) | function lst(arr) { return arr[arr.length-1] }
function map (line 80) | function map(array, f) {
function insertSorted (line 86) | function insertSorted(array, value, score) {
function nothing (line 92) | function nothing() {}
function createObj (line 94) | function createObj(base, props) {
function isWordCharBasic (line 107) | function isWordCharBasic(ch) {
function isWordChar (line 111) | function isWordChar(ch, helper) {
function isEmpty (line 117) | function isEmpty(obj) {
function isExtendingChar (line 128) | function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendi...
function skipExtendingChars (line 131) | function skipExtendingChars(str, pos, dir) {
function findFirst (line 139) | function findFirst(pred, from, to) {
FILE: third_party/CodeMirror/src/util/operation_group.js
function pushOperation (line 5) | function pushOperation(op) {
function fireCallbacksForOps (line 16) | function fireCallbacksForOps(group) {
function finishOperation (line 32) | function finishOperation(op, endCb) {
function signalLater (line 52) | function signalLater(emitter, type /*, values...*/) {
function fireOrphanDelayed (line 68) | function fireOrphanDelayed() {
FILE: third_party/CodeMirror/test/comment_test.js
function test (line 4) | function test(name, mode, run, before, after) {
FILE: third_party/CodeMirror/test/contenteditable_test.js
function findTextNode (line 7) | function findTextNode(dom, text) {
function lineElt (line 19) | function lineElt(node) {
FILE: third_party/CodeMirror/test/doc_test.js
function instantiateSpec (line 3) | function instantiateSpec(spec, place, opts) {
function clone (line 30) | function clone(obj, props) {
function eqAll (line 39) | function eqAll(val) {
function testDoc (line 48) | function testDoc(name, spec, run, opts, expectFail) {
function testBasic (line 73) | function testBasic(a, b) {
FILE: third_party/CodeMirror/test/driver.js
function Failure (line 3) | function Failure(why) {this.message = why;}
function indexOf (li
Condensed preview — 780 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,570K chars).
[
{
"path": ".clang-format",
"chars": 72,
"preview": "Language: JavaScript\nBasedOnStyle: Google\nColumnLimit: 80\n"
},
{
"path": ".gitignore",
"chars": 166,
"preview": ".DS_Store\nnohup.out\n*~\n\nlogin/loginServer.cfg\nlogin/node_modules\nconnect/connectServer.cfg\nconnect/node_modules\nserver/n"
},
{
"path": "CONTRIBUTING.md",
"chars": 1101,
"preview": "# How to Contribute\n\nWe'd love to accept your patches and contributions to this project. There are\njust a few small guid"
},
{
"path": "LICENSE",
"chars": 10174,
"preview": "\n Apache License\n Version 2.0, January 2011\n "
},
{
"path": "README.md",
"chars": 275,
"preview": "# Code City\n\nGoogle's Code City is a social programming environment designed mainly for\neducation. It offers a comic bo"
},
{
"path": "bin/dump-core",
"chars": 1499,
"preview": "#!/bin/bash\n\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n"
},
{
"path": "bin/nginx-dev",
"chars": 2831,
"preview": "#!/bin/bash\n\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n"
},
{
"path": "bin/startup.command",
"chars": 564,
"preview": "#!/usr/bin/osascript\n# Script to open four terminal windows that execute all the Code City servers\n# with one double-cli"
},
{
"path": "connect/connect.html",
"chars": 2019,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <title>Code City</title>\n <link href=\"https://fonts.go"
},
{
"path": "connect/connectServer",
"chars": 12722,
"preview": "#!/usr/bin/env node\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "connect/log.html",
"chars": 1693,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <title>Code City: Log frame</title>\n <link rel=\"styles"
},
{
"path": "connect/world.html",
"chars": 1207,
"preview": "<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <title>Code City: World frame</title>\n <link rel=\"styl"
},
{
"path": "core/README",
"chars": 831,
"preview": "This database contains the latest release of the official Code City\nCore. Normally, when creating a new instance, the d"
},
{
"path": "core/core_10_base.js",
"chars": 3499,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_11_$.utils.js",
"chars": 13490,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_12_$.utils.code.js",
"chars": 27642,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_13_$.Selector.js",
"chars": 24659,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_20_$.utils.html.js",
"chars": 1688,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_21_$.jssp.js",
"chars": 7371,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_22_$.connection.js",
"chars": 2554,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_23_$.servers.http.js",
"chars": 53481,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_24_$.hosts.js",
"chars": 7558,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_25_$.db.tempId.js",
"chars": 2621,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_25_$.userDatabase.js",
"chars": 2172,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_26_inline_editor.js",
"chars": 7835,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_27_editor.js",
"chars": 43176,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_28_$.servers.eval.js",
"chars": 2430,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_30_$.utils.command.js",
"chars": 13023,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_31_$.utils_world.js",
"chars": 1958,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_32_physical.js",
"chars": 23390,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_33_world.js",
"chars": 37270,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_34_$.servers.login.js",
"chars": 3335,
"preview": "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_34_$.servers.telnet.js",
"chars": 4680,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_40_$.startRoom.js",
"chars": 4998,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_41_deutsche_zimmer.js",
"chars": 14048,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_42_plant.js",
"chars": 29326,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_43_genetics_lab.js",
"chars": 42477,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_44_$.assistant.js",
"chars": 6390,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_45_Challenge_Room.js",
"chars": 41944,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_46_$.secuityCourse.js",
"chars": 11688,
"preview": "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/core_99_startup.js",
"chars": 2679,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "core/dump_spec.json",
"chars": 17432,
"preview": "[\n {\n \"options\": {\"skipBindings\": [\"lastModifiedTime\", \"lastModifiedUser\"]}\n }, {\n \"header\": [\n \"/**\",\n "
},
{
"path": "database/README",
"chars": 352,
"preview": "On startup, if no .city database file exists, the server will read and\nexecute all .js files in this directory in asciib"
},
{
"path": "database/codecity.cfg",
"chars": 158,
"preview": "{\n \"databaseDirectory\": \"./\",\n \"checkpointInterval\": 60,\n \"checkpointAtShutdown\": true,\n \"checkpointMinFiles\": 10,\n "
},
{
"path": "docs/setup.md",
"chars": 38813,
"preview": "# Setting up a Code City Instance\n\nThis document describes how to recreate a Code City server from bare\nmetal. For refe"
},
{
"path": "etc/apache.conf",
"chars": 2300,
"preview": "# Template for Apache configuration.\n\n<VirtualHost *:80>\n\t# HTTP should redirect to HTTPS.\n\tRewriteEngine On\n\tRewriteRul"
},
{
"path": "etc/cc-localhost.conf",
"chars": 3276,
"preview": "# Nginx configuration for Code City on localhost.\n# Warning: This configuration is insecure, users can hijack each other"
},
{
"path": "etc/cc-onedomain.conf",
"chars": 4430,
"preview": "# Nginx configuration for Code City using a single domain.\n# Warning: This configuration is insecure, users can hijack e"
},
{
"path": "etc/cc-subdomain.conf",
"chars": 5484,
"preview": "# Nginx configuration for Code City using multiple subdomains.\n\n# Configuration applying to all servers.\n# Replace INSTA"
},
{
"path": "etc/codecity-connect.service",
"chars": 318,
"preview": "[Unit]\nDescription=Code City Connect Server\nDocumentation=https://github.com/google/CodeCity\nAfter=network.target\n\n[Serv"
},
{
"path": "etc/codecity-login.service",
"chars": 307,
"preview": "[Unit]\nDescription=Code City Login Server\nDocumentation=https://github.com/google/CodeCity\nAfter=network.target\n\n[Servic"
},
{
"path": "etc/codecity-mobwrite.service",
"chars": 342,
"preview": "[Unit]\nDescription=Code City Login Server\nDocumentation=https://github.com/google/CodeCity\nAfter=network.target\n\n[Servic"
},
{
"path": "etc/codecity.service",
"chars": 425,
"preview": "[Unit]\nDescription=Code City\nDocumentation=https://github.com/google/CodeCity\nAfter=network.target\nWants=codecity-login."
},
{
"path": "etc/gcloud-snapshot",
"chars": 325,
"preview": "#!/bin/bash\n\n# Put this file in /etc/cron.daily/ to effect automatic daily snapshots.\n#\n# Must also have installed gclou"
},
{
"path": "login/login.html",
"chars": 1007,
"preview": "<!doctype html>\n\n<html lang=\"en\">\n<head>\n <title>Code City Login</title>\n <link href=\"<<<STATIC_URL>>>style/jfk.css\" r"
},
{
"path": "login/loginServer",
"chars": 11346,
"preview": "#!/usr/bin/env node\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "login/package.json",
"chars": 607,
"preview": "{\n \"name\": \"codecity-login\",\n \"version\": \"0.0.0\",\n \"description\": \"Login server for the Code City project\",\n \"main\":"
},
{
"path": "minimal/core_01_minimal.js",
"chars": 7897,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "minimal/minimal.cfg",
"chars": 92,
"preview": "{\n \"databaseDirectory\": \"./\",\n \"checkpointInterval\": 0,\n \"checkpointAtShutdown\": false\n}\n"
},
{
"path": "minimal/readme.txt",
"chars": 452,
"preview": "Minimal Database.\n\nThis database demonstrates a very minimal Code City instance. It contains:\n\n* Two users (Alpha and B"
},
{
"path": "mobwrite/mobwrite.cfg",
"chars": 1015,
"preview": "; ---------------------\n; Settings for MobWrite\n; ---------------------\n\n; How long (in seconds) to compute a diff befor"
},
{
"path": "mobwrite/mobwrite_core.py",
"chars": 9886,
"preview": "# Copyright 2009 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this f"
},
{
"path": "mobwrite/mobwrite_core_test.py",
"chars": 1978,
"preview": "#!/usr/bin/python2\n\n# Copyright 2006 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# yo"
},
{
"path": "mobwrite/mobwrite_server.py",
"chars": 16988,
"preview": "#!/usr/bin/python2\n\n# Copyright 2006 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# yo"
},
{
"path": "server/code.js",
"chars": 6542,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/codecity",
"chars": 15474,
"preview": "#!/usr/bin/env node\n/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "server/compile",
"chars": 2628,
"preview": "#!/bin/bash\n\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n"
},
{
"path": "server/config.txt",
"chars": 1081,
"preview": "Documentation for config file options:\n\n \"databaseDirectory\": string\n Relative path from this config file to the dat"
},
{
"path": "server/dump",
"chars": 14222,
"preview": "#!/usr/bin/env node\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "server/dumper.js",
"chars": 86900,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/WeakRef.js",
"chars": 1638,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/buffer/buffer.js",
"chars": 1035,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/buffer/package.json",
"chars": 107,
"preview": "{\n \"description\": \"Fake package.json for require('buffer')\",\n \"main\": \"buffer.js\",\n \"name\": \"buffer\",\n}\n"
},
{
"path": "server/externs/crypto/crypto.js",
"chars": 1703,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/crypto/package.json",
"chars": 107,
"preview": "{\n \"description\": \"Fake package.json for require('crypto')\",\n \"main\": \"crypto.js\",\n \"name\": \"crypto\",\n}\n"
},
{
"path": "server/externs/events/events.js",
"chars": 1482,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/events/package.json",
"chars": 107,
"preview": "{\n \"description\": \"Fake package.json for require('events')\",\n \"main\": \"events.js\",\n \"name\": \"events\",\n}\n"
},
{
"path": "server/externs/fs/fs.js",
"chars": 4294,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/fs/package.json",
"chars": 95,
"preview": "{\n \"description\": \"Fake package.json for require('fs')\",\n \"main\": \"fs.js\",\n \"name\": \"fs\",\n}\n"
},
{
"path": "server/externs/http/http.js",
"chars": 5018,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/http/package.json",
"chars": 101,
"preview": "{\n \"description\": \"Fake package.json for require('http')\",\n \"main\": \"http.js\",\n \"name\": \"http\",\n}\n"
},
{
"path": "server/externs/https/https.js",
"chars": 2597,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/https/package.json",
"chars": 104,
"preview": "{\n \"description\": \"Fake package.json for require('https')\",\n \"main\": \"https.js\",\n \"name\": \"https\",\n}\n"
},
{
"path": "server/externs/net/net.js",
"chars": 3006,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/net/package.json",
"chars": 98,
"preview": "{\n \"description\": \"Fake package.json for require('net')\",\n \"main\": \"net.js\",\n \"name\": \"net\",\n}\n"
},
{
"path": "server/externs/node.js",
"chars": 2585,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/path/package.json",
"chars": 101,
"preview": "{\n \"description\": \"Fake package.json for require('path')\",\n \"main\": \"path.js\",\n \"name\": \"path\",\n}\n"
},
{
"path": "server/externs/path/path.js",
"chars": 1436,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/stream/package.json",
"chars": 107,
"preview": "{\n \"description\": \"Fake package.json for require('stream')\",\n \"main\": \"stream.js\",\n \"name\": \"stream\",\n}\n"
},
{
"path": "server/externs/stream/stream.js",
"chars": 4756,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/tls/package.json",
"chars": 98,
"preview": "{\n \"description\": \"Fake package.json for require('tls')\",\n \"main\": \"tls.js\",\n \"name\": \"tls\",\n}\n"
},
{
"path": "server/externs/tls/tls.js",
"chars": 3707,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/externs/util/package.json",
"chars": 101,
"preview": "{\n \"description\": \"Fake package.json for require('util')\",\n \"main\": \"util.js\",\n \"name\": \"util\",\n}\n"
},
{
"path": "server/externs/util/util.js",
"chars": 1827,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/interpreter.js",
"chars": 259229,
"preview": "/**\n * @license\n * Copyright 2013 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/iterable_weakmap.js",
"chars": 5385,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/iterable_weakset.js",
"chars": 4577,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/package.json",
"chars": 604,
"preview": "{\n \"name\": \"codecity-server\",\n \"version\": \"0.0.0\",\n \"description\": \"Server for the Code City project\",\n \"main\": \"cod"
},
{
"path": "server/parser.js",
"chars": 4590,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/priorityqueue.js",
"chars": 5179,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/registry.js",
"chars": 3479,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/repl",
"chars": 1964,
"preview": "#!/usr/bin/env node\n/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (t"
},
{
"path": "server/selector.js",
"chars": 12010,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/serialize.js",
"chars": 17188,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/cc.js",
"chars": 1443,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/es5.js",
"chars": 29353,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/es6.js",
"chars": 11066,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/es7.js",
"chars": 1115,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/es8.js",
"chars": 1470,
"preview": "/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/startup/esx.js",
"chars": 7284,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/code_test.js",
"chars": 2995,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/core_01_$.js",
"chars": 728,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/core_01_$.system.js",
"chars": 848,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test.cfg",
"chars": 91,
"preview": "{\n \"databaseDirectory\": \"./\",\n \"checkpointInterval\": 0,\n \"checkpointAtShutdown\": true\n}\n"
},
{
"path": "server/tests/db/test_00_start.js",
"chars": 1010,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_01_es5.js",
"chars": 86171,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_01_es6.js",
"chars": 22185,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_01_es7.js",
"chars": 1474,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_02_errors.js",
"chars": 1874,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_02_perms.js",
"chars": 1652,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_09_end.js",
"chars": 1111,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_10_fibonacci.js",
"chars": 1364,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/db/test_20_reboot.js",
"chars": 837,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/dump_test.js",
"chars": 5267,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/dumper_test.js",
"chars": 55705,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/interpreter_bench.js",
"chars": 2668,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/interpreter_common.js",
"chars": 1615,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/interpreter_test.js",
"chars": 47306,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/interpreter_unit_test.js",
"chars": 9363,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/iterable_weakmap_test.js",
"chars": 6172,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/iterable_weakset_test.js",
"chars": 3965,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/priorityqueue_test.js",
"chars": 4605,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/registry_test.js",
"chars": 2989,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/run",
"chars": 394,
"preview": "#!/bin/bash\n\n# Run unit tests in Node.\nnode --expose-gc tests/run.js\n\n# Delete any existing checkpoint files.\nrm tests/d"
},
{
"path": "server/tests/run.js",
"chars": 3509,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/selector_test.js",
"chars": 6675,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/serialize_bench.js",
"chars": 5897,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/serialize_test.js",
"chars": 16628,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/testcases.js",
"chars": 84899,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/testing.js",
"chars": 5351,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/tinycore/README",
"chars": 60,
"preview": "A very tiny database, just big enough to run an eval server."
},
{
"path": "server/tests/tinycore/core_00_es_minimal.js",
"chars": 12494,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/tinycore/core_10_base.js",
"chars": 1823,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/tinycore/core_13_$.utils.code.js",
"chars": 5542,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/tinycore/core_35_$.servers.eval.js",
"chars": 1640,
"preview": "/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * yo"
},
{
"path": "server/tests/tinycore/dump_spec.json",
"chars": 1044,
"preview": "[\n {\n \"filename\": \"core_00_es_minimal.js\",\n \"contents\": [\n {\"path\": \"Object\", \"do\": \"SET\"},\n {\"path\": \""
},
{
"path": "server/tests/tinycore/tiny.cfg",
"chars": 154,
"preview": "{\n \"databaseDirectory\": \"./\",\n \"checkpointInterval\": 0,\n \"checkpointAtShutdown\": false,\n \"checkpointMinFiles\": 0,\n "
},
{
"path": "static/503.html",
"chars": 1166,
"preview": "<!doctype html>\n<html lang=\"en\">\n<head>\n <title>503 - Code City</title>\n <style>\n body {\n font-family: \"Roboto"
},
{
"path": "static/code/code.js",
"chars": 4037,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Integrated"
},
{
"path": "static/code/common.js",
"chars": 14359,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Integrated"
},
{
"path": "static/code/diff.css",
"chars": 98,
"preview": "body {\n white-space: pre-wrap;\n}\n\nins {\n background: #e6ffe6;\n}\n\ndel {\n background: #ffe6e6;\n}\n"
},
{
"path": "static/code/diff.js",
"chars": 2045,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Diff Edito"
},
{
"path": "static/code/editor.css",
"chars": 783,
"preview": "#editorButter {\n display: none;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n pointer-events: none;\n z-inde"
},
{
"path": "static/code/editor.js",
"chars": 42599,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Integrated"
},
{
"path": "static/code/explorer.js",
"chars": 24305,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Integrated"
},
{
"path": "static/code/mobwrite/demo/editor.html",
"chars": 825,
"preview": "<HTML>\n<HEAD>\n<TITLE>MobWrite as a Collaborative Editor</TITLE>\n<STYLE type=\"text/css\">\nBODY {\n background-color: white"
},
{
"path": "static/code/mobwrite/demo/form.html",
"chars": 2466,
"preview": "<HTML>\n<HEAD>\n<TITLE>MobWrite as a Collaborative Form</TITLE>\n<STYLE type=\"text/css\">\nBODY {\n background-color: white;\n"
},
{
"path": "static/code/mobwrite/demo/mobwrite_form.js",
"chars": 24087,
"preview": "/**\n * @license\n * Copyright 2008 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview This clien"
},
{
"path": "static/code/mobwrite/demo/test.html",
"chars": 377,
"preview": "<HTML>\n<HEAD>\n<TITLE>Manual test of MobWrite's client-server Protocol</TITLE>\n</HEAD>\n<BODY>\n<H1>Manual test of MobWrite"
},
{
"path": "static/code/mobwrite/mobwrite_cc.js",
"chars": 2100,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Realtime c"
},
{
"path": "static/code/mobwrite/mobwrite_core.js",
"chars": 22464,
"preview": "/**\n * @license\n * Copyright 2006 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview This clien"
},
{
"path": "static/code/objectPanel.js",
"chars": 7979,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Integrated"
},
{
"path": "static/code/style.css",
"chars": 3994,
"preview": "body {\n background: #fff;\n color: #444;\n font-family: \"Roboto Mono\", monospace;\n font-size: 11pt;\n}\n\ninput,\ntextarea"
},
{
"path": "static/code/svg.css",
"chars": 1511,
"preview": "body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n}\n\n#editorContainer {\n position: absolute;\n}\n\n#toolbox {\n paddin"
},
{
"path": "static/code/svg.js",
"chars": 14054,
"preview": "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview SVG Editor"
},
{
"path": "static/code/tests/test.html",
"chars": 2289,
"preview": "<html>\n <head>\n <title>Test harness for Code City: Code</title>\n\n <script>\n window.TEST = true;\n </script"
},
{
"path": "static/code/tests/test.js",
"chars": 2742,
"preview": "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Tests for "
},
{
"path": "static/connect/common.css",
"chars": 1323,
"preview": "body {\n color: #444;\n}\n\na {\n color: #00e;\n}\n\na:hover {\n color: #d00;\n}\n\na.command {\n cursor: pointer;\n text-decorat"
},
{
"path": "static/connect/common.js",
"chars": 11181,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Functions "
},
{
"path": "static/connect/connect.css",
"chars": 1387,
"preview": "html {\n height: 100%;\n}\n\nbody {\n color: #444;\n background-color: #fff;\n border-left: 2px dashed #fff;\n border-right"
},
{
"path": "static/connect/connect.js",
"chars": 21558,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Code City'"
},
{
"path": "static/connect/log.css",
"chars": 1091,
"preview": "body {\n font-family: 'Roboto Mono', monospace;\n}\n\n#scrollDiv {\n padding-left: 15px;\n}\n\n#scrollDiv>div:first-child {\n "
},
{
"path": "static/connect/log.js",
"chars": 18301,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Log frame "
},
{
"path": "static/connect/prettify.css",
"chars": 675,
"preview": ".pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,"
},
{
"path": "static/connect/prettify.js",
"chars": 15497,
"preview": "!function(){/*\n\n Copyright 2006 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may no"
},
{
"path": "static/connect/tests/test.html",
"chars": 2203,
"preview": "<html>\n <head>\n <title>Test harness for Code City: Client</title>\n\n <script>\n window.TEST = true;\n </scri"
},
{
"path": "static/connect/tests/test.js",
"chars": 1947,
"preview": "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Tests for "
},
{
"path": "static/connect/world.css",
"chars": 1698,
"preview": "body {\n font-family: 'Patrick Hand', 'Comic Sans MS';\n margin: 0;\n overflow: hidden;\n}\n\n.historyPanel {\n border: 2px"
},
{
"path": "static/connect/world.js",
"chars": 69271,
"preview": "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview World fram"
},
{
"path": "static/flamethrower.html",
"chars": 285,
"preview": "<html>\n <head>\n <style>\n body {\n background: #000;\n background-size: contain;\n background-"
},
{
"path": "static/login-close.html",
"chars": 721,
"preview": "<!doctype html>\n\n<html lang=\"en\">\n<head>\n <title>Code City Login</title>\n <style>\n body {\n font-family: \"Robot"
},
{
"path": "static/securitystore/style.css",
"chars": 344,
"preview": "body {\n background-color: white;\n font-family: sans-serif;\n max-width: 50em;\n margin: 1em;\n}\n\nh1, h2, h3 {\n font-we"
},
{
"path": "static/securitystore/utils.js",
"chars": 639,
"preview": "// Client-side utility functions for formatting prices according to the user's localle.\n\n// Format a number as a price. "
},
{
"path": "static/style/jfk.css",
"chars": 3541,
"preview": "body {\n background-color: #fff;\n}\n\n/* Kennedy buttons. */\n.jfk-button {\n user-select: none;\n box-shadow: none;\n back"
},
{
"path": "static/style/svg.css",
"chars": 602,
"preview": "/* Enforce a consistent drawing style on all content. */\nsvg {\n fill: none;\n stroke: #000;\n stroke-linecap: round;\n "
},
{
"path": "third_party/CodeMirror/AUTHORS",
"chars": 10261,
"preview": "List of CodeMirror contributors. Updated before every release.\n\n4oo4\n4r2r\nAaron Brooks\nAbdelouahab\nAbdussalam Abdurrahma"
},
{
"path": "third_party/CodeMirror/CHANGELOG.md",
"chars": 88431,
"preview": "## 5.43.0 (2019-01-21)\n\n### Bug fixes\n\nFix mistakes in passing through the arguments to `indent` in several wrapping mod"
},
{
"path": "third_party/CodeMirror/CONTRIBUTING.md",
"chars": 3855,
"preview": "# How to contribute\n\n- [Getting help](#getting-help)\n- [Submitting bug reports](#submitting-bug-reports)\n- [Contributing"
},
{
"path": "third_party/CodeMirror/LICENSE",
"chars": 1107,
"preview": "MIT License\n\nCopyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others\n\nPermission is hereby granted, free o"
},
{
"path": "third_party/CodeMirror/METADATA",
"chars": 350,
"preview": "name: \"CodeMirror\"\ndescription:\n \"CodeMirror is a code editor embedable in a webpage.\"\n\nthird_party {\n url {\n typ"
},
{
"path": "third_party/CodeMirror/README.md",
"chars": 2059,
"preview": "# CodeMirror\n\n[](https://travis-ci.org/codemirror/CodeMi"
},
{
"path": "third_party/CodeMirror/addon/comment/comment.js",
"chars": 8994,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/comment/continuecomment.js",
"chars": 3023,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/dialog/dialog.css",
"chars": 507,
"preview": ".CodeMirror-dialog {\n position: absolute;\n left: 0; right: 0;\n background: inherit;\n z-index: 15;\n padding: .1em .8"
},
{
"path": "third_party/CodeMirror/addon/dialog/dialog.js",
"chars": 5175,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/display/autorefresh.js",
"chars": 1544,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/display/fullscreen.css",
"chars": 116,
"preview": ".CodeMirror-fullscreen {\n position: fixed;\n top: 0; left: 0; right: 0; bottom: 0;\n height: auto;\n z-index: 9;\n}\n"
},
{
"path": "third_party/CodeMirror/addon/display/fullscreen.js",
"chars": 1495,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/display/panel.js",
"chars": 4355,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
},
{
"path": "third_party/CodeMirror/addon/display/placeholder.js",
"chars": 2193,
"preview": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/"
}
]
// ... and 580 more files (download for full content)
About this extraction
This page contains the full source code of the google/CodeCity GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 780 files (7.8 MB), approximately 2.1M tokens, and a symbol index with 3704 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.