├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── incorrect-syntax-highlighting.md └── workflows │ └── greetings.yml ├── .gitignore ├── .jshintrc ├── .travis.yml ├── AUTHORS.txt ├── CHANGES.md ├── Dockerfile ├── LICENSE ├── README.CDN.md ├── README.md ├── README.ru.md ├── VERSION_10_BREAKING.md ├── demo ├── demo.js ├── index.html ├── jquery-2.1.1.min.js ├── perfect-scrollbar.min.css ├── perfect-scrollbar.min.js ├── readme.md └── style.css ├── docs ├── Makefile ├── _build │ └── .gitkeep ├── _static │ └── .gitkeep ├── _templates │ └── .gitkeep ├── api.rst ├── building-testing.rst ├── conf.py ├── css-classes-reference.rst ├── index.rst ├── language-contribution.rst ├── language-guide.rst ├── language-requests.rst ├── line-numbers.rst ├── maintainers-guide.rst ├── plugin-api.rst ├── plugin-recipes.rst ├── reference.rst └── style-guide.rst ├── extra ├── .keep └── 3RD_PARTY_QUICK_START.md ├── package-lock.json ├── package.json ├── src ├── highlight.js ├── languages │ ├── 1c.js │ ├── abnf.js │ ├── accesslog.js │ ├── actionscript.js │ ├── ada.js │ ├── angelscript.js │ ├── apache.js │ ├── applescript.js │ ├── arcade.js │ ├── arduino.js │ ├── armasm.js │ ├── asciidoc.js │ ├── aspectj.js │ ├── autohotkey.js │ ├── autoit.js │ ├── avrasm.js │ ├── awk.js │ ├── axapta.js │ ├── bash.js │ ├── basic.js │ ├── bnf.js │ ├── brainfuck.js │ ├── c-like.js │ ├── c.js │ ├── cal.js │ ├── capnproto.js │ ├── ceylon.js │ ├── clean.js │ ├── clojure-repl.js │ ├── clojure.js │ ├── cmake.js │ ├── coffeescript.js │ ├── coq.js │ ├── cos.js │ ├── cpp.js │ ├── crmsh.js │ ├── crystal.js │ ├── csharp.js │ ├── csp.js │ ├── css.js │ ├── d.js │ ├── dart.js │ ├── delphi.js │ ├── diff.js │ ├── django.js │ ├── dns.js │ ├── dockerfile.js │ ├── dos.js │ ├── dsconfig.js │ ├── dts.js │ ├── dust.js │ ├── ebnf.js │ ├── elixir.js │ ├── elm.js │ ├── erb.js │ ├── erlang-repl.js │ ├── erlang.js │ ├── excel.js │ ├── fix.js │ ├── flix.js │ ├── fortran.js │ ├── fsharp.js │ ├── gams.js │ ├── gauss.js │ ├── gcode.js │ ├── gherkin.js │ ├── glsl.js │ ├── gml.js │ ├── go.js │ ├── golo.js │ ├── gradle.js │ ├── groovy.js │ ├── haml.js │ ├── handlebars.js │ ├── haskell.js │ ├── haxe.js │ ├── hsp.js │ ├── htmlbars.js │ ├── http.js │ ├── hy.js │ ├── inform7.js │ ├── ini.js │ ├── irpf90.js │ ├── isbl.js │ ├── java.js │ ├── javascript.js │ ├── jboss-cli.js │ ├── json.js │ ├── julia-repl.js │ ├── julia.js │ ├── kotlin.js │ ├── lasso.js │ ├── latex.js │ ├── ldif.js │ ├── leaf.js │ ├── less.js │ ├── lisp.js │ ├── livecodeserver.js │ ├── livescript.js │ ├── llvm.js │ ├── lsl.js │ ├── lua.js │ ├── makefile.js │ ├── markdown.js │ ├── mathematica.js │ ├── matlab.js │ ├── maxima.js │ ├── mel.js │ ├── mercury.js │ ├── mipsasm.js │ ├── mizar.js │ ├── mojolicious.js │ ├── monkey.js │ ├── moonscript.js │ ├── n1ql.js │ ├── nginx.js │ ├── nim.js │ ├── nix.js │ ├── nsis.js │ ├── objectivec.js │ ├── ocaml.js │ ├── openscad.js │ ├── oxygene.js │ ├── parser3.js │ ├── perl.js │ ├── pf.js │ ├── pgsql.js │ ├── php.js │ ├── plaintext.js │ ├── pony.js │ ├── powershell.js │ ├── processing.js │ ├── profile.js │ ├── prolog.js │ ├── properties.js │ ├── protobuf.js │ ├── puppet.js │ ├── purebasic.js │ ├── python-repl.js │ ├── python.js │ ├── q.js │ ├── qml.js │ ├── r.js │ ├── reasonml.js │ ├── rib.js │ ├── roboconf.js │ ├── routeros.js │ ├── rsl.js │ ├── ruby.js │ ├── ruleslanguage.js │ ├── rust.js │ ├── sas.js │ ├── scala.js │ ├── scheme.js │ ├── scilab.js │ ├── scss.js │ ├── shell.js │ ├── smali.js │ ├── smalltalk.js │ ├── sml.js │ ├── sqf.js │ ├── sql.js │ ├── stan.js │ ├── stata.js │ ├── step21.js │ ├── stylus.js │ ├── subunit.js │ ├── swift.js │ ├── taggerscript.js │ ├── tap.js │ ├── tcl.js │ ├── thrift.js │ ├── tp.js │ ├── twig.js │ ├── typescript.js │ ├── vala.js │ ├── vbnet.js │ ├── vbscript-html.js │ ├── vbscript.js │ ├── verilog.js │ ├── vhdl.js │ ├── vim.js │ ├── x86asm.js │ ├── xl.js │ ├── xml.js │ ├── xquery.js │ ├── yaml.js │ └── zephir.js ├── lib │ ├── mode_compiler.js │ ├── modes.js │ ├── regex.js │ └── utils.js ├── styles │ ├── a11y-dark.css │ ├── a11y-light.css │ ├── agate.css │ ├── an-old-hope.css │ ├── androidstudio.css │ ├── arduino-light.css │ ├── arta.css │ ├── ascetic.css │ ├── atelier-cave-dark.css │ ├── atelier-cave-light.css │ ├── atelier-dune-dark.css │ ├── atelier-dune-light.css │ ├── atelier-estuary-dark.css │ ├── atelier-estuary-light.css │ ├── atelier-forest-dark.css │ ├── atelier-forest-light.css │ ├── atelier-heath-dark.css │ ├── atelier-heath-light.css │ ├── atelier-lakeside-dark.css │ ├── atelier-lakeside-light.css │ ├── atelier-plateau-dark.css │ ├── atelier-plateau-light.css │ ├── atelier-savanna-dark.css │ ├── atelier-savanna-light.css │ ├── atelier-seaside-dark.css │ ├── atelier-seaside-light.css │ ├── atelier-sulphurpool-dark.css │ ├── atelier-sulphurpool-light.css │ ├── atom-one-dark-reasonable.css │ ├── atom-one-dark.css │ ├── atom-one-light.css │ ├── brown-paper.css │ ├── brown-papersq.png │ ├── codepen-embed.css │ ├── color-brewer.css │ ├── darcula.css │ ├── dark.css │ ├── default.css │ ├── docco.css │ ├── dracula.css │ ├── far.css │ ├── foundation.css │ ├── github-gist.css │ ├── github.css │ ├── gml.css │ ├── googlecode.css │ ├── gradient-dark.css │ ├── grayscale.css │ ├── gruvbox-dark.css │ ├── gruvbox-light.css │ ├── hopscotch.css │ ├── hybrid.css │ ├── idea.css │ ├── ir-black.css │ ├── isbl-editor-dark.css │ ├── isbl-editor-light.css │ ├── kimbie.dark.css │ ├── kimbie.light.css │ ├── lightfair.css │ ├── magula.css │ ├── mono-blue.css │ ├── monokai-sublime.css │ ├── monokai.css │ ├── night-owl.css │ ├── nord.css │ ├── obsidian.css │ ├── ocean.css │ ├── paraiso-dark.css │ ├── paraiso-light.css │ ├── pojoaque.css │ ├── pojoaque.jpg │ ├── purebasic.css │ ├── qtcreator_dark.css │ ├── qtcreator_light.css │ ├── railscasts.css │ ├── rainbow.css │ ├── routeros.css │ ├── school-book.css │ ├── school-book.png │ ├── shades-of-purple.css │ ├── solarized-dark.css │ ├── solarized-light.css │ ├── sunburst.css │ ├── tomorrow-night-blue.css │ ├── tomorrow-night-bright.css │ ├── tomorrow-night-eighties.css │ ├── tomorrow-night.css │ ├── tomorrow.css │ ├── vs.css │ ├── vs2015.css │ ├── xcode.css │ ├── xt256.css │ └── zenburn.css └── vendor │ └── deep_freeze.js ├── test ├── api │ ├── autoDetection.js │ ├── binaryNumber.js │ ├── cNumber.js │ ├── fixmarkup.js │ ├── getLanguage.js │ ├── highlight.js │ ├── ident.js │ ├── index.js │ ├── keywords.js │ ├── number.js │ ├── starters.js │ └── underscoreIdent.js ├── browser │ ├── highlight_block_callbacks.js │ ├── index.js │ ├── plain.js │ ├── test_case.js │ └── worker.js ├── builds │ ├── package.js │ └── rollup_import_via_commonjs.js ├── detect │ ├── 1c │ │ └── default.txt │ ├── abnf │ │ └── default.txt │ ├── accesslog │ │ └── default.txt │ ├── actionscript │ │ └── default.txt │ ├── ada │ │ └── default.txt │ ├── angelscript │ │ └── default.txt │ ├── apache │ │ └── default.txt │ ├── applescript │ │ └── default.txt │ ├── arcade │ │ └── default.txt │ ├── arduino │ │ └── default.txt │ ├── armasm │ │ └── default.txt │ ├── asciidoc │ │ └── default.txt │ ├── aspectj │ │ └── default.txt │ ├── autohotkey │ │ └── default.txt │ ├── autoit │ │ └── default.txt │ ├── avrasm │ │ └── default.txt │ ├── awk │ │ └── default.txt │ ├── axapta │ │ └── default.txt │ ├── bash │ │ └── default.txt │ ├── basic │ │ └── default.txt │ ├── bnf │ │ └── default.txt │ ├── brainfuck │ │ └── default.txt │ ├── cal │ │ └── default.txt │ ├── capnproto │ │ └── default.txt │ ├── ceylon │ │ └── default.txt │ ├── clean │ │ └── default.txt │ ├── clojure-repl │ │ └── default.txt │ ├── clojure │ │ └── default.txt │ ├── cmake │ │ └── default.txt │ ├── coffeescript │ │ └── default.txt │ ├── coq │ │ └── default.txt │ ├── cos │ │ └── default.txt │ ├── cpp │ │ ├── comment.txt │ │ └── default.txt │ ├── crmsh │ │ └── default.txt │ ├── crystal │ │ └── default.txt │ ├── csharp │ │ └── default.txt │ ├── csp │ │ └── default.txt │ ├── css │ │ └── default.txt │ ├── d │ │ └── default.txt │ ├── dart │ │ └── default.txt │ ├── delphi │ │ └── default.txt │ ├── diff │ │ └── default.txt │ ├── django │ │ └── default.txt │ ├── dns │ │ └── default.txt │ ├── dockerfile │ │ └── default.txt │ ├── dos │ │ └── default.txt │ ├── dsconfig │ │ └── default.txt │ ├── dts │ │ └── default.txt │ ├── dust │ │ └── default.txt │ ├── ebnf │ │ └── default.txt │ ├── elixir │ │ └── default.txt │ ├── elm │ │ └── default.txt │ ├── erb │ │ └── default.txt │ ├── erlang-repl │ │ └── default.txt │ ├── erlang │ │ └── default.txt │ ├── excel │ │ └── default.txt │ ├── fix │ │ └── default.txt │ ├── flix │ │ └── default.txt │ ├── fortran │ │ └── default.txt │ ├── fsharp │ │ └── default.txt │ ├── gams │ │ └── default.txt │ ├── gauss │ │ └── default.txt │ ├── gcode │ │ └── default.txt │ ├── gherkin │ │ └── default.txt │ ├── glsl │ │ └── default.txt │ ├── gml │ │ └── default.txt │ ├── go │ │ ├── default.txt │ │ └── swift-like.txt │ ├── golo │ │ └── default.txt │ ├── gradle │ │ └── default.txt │ ├── groovy │ │ └── default.txt │ ├── haml │ │ └── default.txt │ ├── handlebars │ │ └── default.txt │ ├── haskell │ │ └── default.txt │ ├── haxe │ │ └── default.txt │ ├── hsp │ │ └── default.txt │ ├── htmlbars │ │ └── default.txt │ ├── http │ │ └── default.txt │ ├── hy │ │ └── default.txt │ ├── index.js │ ├── inform7 │ │ └── default.txt │ ├── ini │ │ └── default.txt │ ├── irpf90 │ │ └── default.txt │ ├── isbl │ │ └── default.txt │ ├── java │ │ └── default.txt │ ├── javascript │ │ ├── default.txt │ │ ├── sample1.txt │ │ └── short-plain.txt │ ├── jboss-cli │ │ └── default.txt │ ├── json │ │ └── default.txt │ ├── julia-repl │ │ └── default.txt │ ├── julia │ │ └── default.txt │ ├── kotlin │ │ └── default.txt │ ├── lasso │ │ └── default.txt │ ├── latex │ │ └── default.txt │ ├── ldif │ │ └── default.txt │ ├── leaf │ │ └── default.txt │ ├── less │ │ └── default.txt │ ├── lisp │ │ └── default.txt │ ├── livecodeserver │ │ └── default.txt │ ├── livescript │ │ └── default.txt │ ├── llvm │ │ └── default.txt │ ├── lsl │ │ └── default.txt │ ├── lua │ │ └── default.txt │ ├── makefile │ │ └── default.txt │ ├── markdown │ │ └── default.txt │ ├── mathematica │ │ └── default.txt │ ├── matlab │ │ └── default.txt │ ├── maxima │ │ └── default.txt │ ├── mel │ │ └── default.txt │ ├── mercury │ │ └── default.txt │ ├── mipsasm │ │ └── default.txt │ ├── mizar │ │ └── default.txt │ ├── mojolicious │ │ └── default.txt │ ├── monkey │ │ └── default.txt │ ├── moonscript │ │ └── default.txt │ ├── n1ql │ │ └── default.txt │ ├── nginx │ │ └── default.txt │ ├── nim │ │ └── default.txt │ ├── nix │ │ └── default.txt │ ├── nsis │ │ └── default.txt │ ├── objectivec │ │ └── default.txt │ ├── ocaml │ │ └── default.txt │ ├── openscad │ │ └── default.txt │ ├── oxygene │ │ └── default.txt │ ├── parser3 │ │ └── default.txt │ ├── perl │ │ └── default.txt │ ├── pf │ │ └── default.txt │ ├── pgsql │ │ └── default.txt │ ├── php │ │ └── default.txt │ ├── plaintext │ │ └── default.txt │ ├── pony │ │ └── default.txt │ ├── powershell │ │ └── default.txt │ ├── processing │ │ └── default.txt │ ├── profile │ │ └── default.txt │ ├── prolog │ │ └── default.txt │ ├── properties │ │ └── default.txt │ ├── protobuf │ │ └── default.txt │ ├── puppet │ │ └── default.txt │ ├── purebasic │ │ └── default.txt │ ├── python-repl │ │ └── default.txt │ ├── python │ │ └── default.txt │ ├── q │ │ └── default.txt │ ├── qml │ │ └── default.txt │ ├── r │ │ └── default.txt │ ├── reasonml │ │ └── default.txt │ ├── rib │ │ └── default.txt │ ├── roboconf │ │ └── default.txt │ ├── routeros │ │ └── default.txt │ ├── rsl │ │ └── default.txt │ ├── ruby │ │ ├── default.txt │ │ └── double-colon.txt │ ├── ruleslanguage │ │ └── default.txt │ ├── rust │ │ └── default.txt │ ├── sas │ │ └── default.txt │ ├── scala │ │ └── default.txt │ ├── scheme │ │ └── default.txt │ ├── scilab │ │ └── default.txt │ ├── scss │ │ └── default.txt │ ├── shell │ │ └── default.txt │ ├── smali │ │ └── default.txt │ ├── smalltalk │ │ └── default.txt │ ├── sml │ │ └── default.txt │ ├── sqf │ │ └── default.txt │ ├── sql │ │ └── default.txt │ ├── stan │ │ └── default.txt │ ├── stata │ │ └── default.txt │ ├── step21 │ │ └── default.txt │ ├── stylus │ │ └── default.txt │ ├── subunit │ │ └── default.txt │ ├── swift │ │ └── default.txt │ ├── taggerscript │ │ └── default.txt │ ├── tap │ │ └── default.txt │ ├── tcl │ │ └── default.txt │ ├── thrift │ │ └── default.txt │ ├── tp │ │ └── default.txt │ ├── twig │ │ └── default.txt │ ├── typescript │ │ └── default.txt │ ├── vala │ │ └── default.txt │ ├── vbnet │ │ └── default.txt │ ├── vbscript-html │ │ └── default.txt │ ├── vbscript │ │ └── default.txt │ ├── verilog │ │ └── default.txt │ ├── vhdl │ │ └── default.txt │ ├── vim │ │ └── default.txt │ ├── x86asm │ │ └── default.txt │ ├── xl │ │ └── default.txt │ ├── xml │ │ ├── default.txt │ │ ├── groovy-julia.txt │ │ └── js.txt │ ├── xquery │ │ └── default.txt │ ├── yaml │ │ └── default.txt │ └── zephir │ │ └── default.txt ├── fixtures │ ├── expect │ │ ├── brInPre.txt │ │ ├── custommarkup.txt │ │ ├── customtabreplace.txt │ │ ├── endsWithParentVariants.txt │ │ ├── explicit1.txt │ │ ├── explicit2.txt │ │ ├── languagealias.txt │ │ ├── sublanguages.txt │ │ ├── tabreplace.txt │ │ └── useBr.txt │ ├── index.html │ └── nested.js ├── index.js ├── markup │ ├── abnf │ │ ├── default.expect.txt │ │ └── default.txt │ ├── accesslog │ │ ├── default.expect.txt │ │ └── default.txt │ ├── actionscript │ │ ├── method-call.expect.txt │ │ └── method-call.txt │ ├── arcade │ │ ├── profile.expect.txt │ │ └── profile.txt │ ├── arduino │ │ ├── default.expect.txt │ │ └── default.txt │ ├── armasm │ │ ├── default.expect.txt │ │ └── default.txt │ ├── aspectj │ │ ├── intertype-constructor.expect.txt │ │ ├── intertype-constructor.txt │ │ ├── intertype-method.expect.txt │ │ └── intertype-method.txt │ ├── bash │ │ ├── escaped-quote.expect.txt │ │ ├── escaped-quote.txt │ │ ├── no-numbers.expect.txt │ │ └── no-numbers.txt │ ├── ceylon │ │ ├── nested-comments.expect.txt │ │ └── nested-comments.txt │ ├── clojure-repl │ │ ├── prompt.expect.txt │ │ └── prompt.txt │ ├── clojure │ │ ├── hint_col.expect.txt │ │ ├── hint_col.txt │ │ ├── symbols-numbers.expect.txt │ │ └── symbols-numbers.txt │ ├── coffeescript │ │ ├── division.expect.txt │ │ ├── division.txt │ │ ├── freeze_bug.expect.txt │ │ ├── freeze_bug.txt │ │ ├── function.expect.txt │ │ ├── function.txt │ │ ├── regex.expect.txt │ │ └── regex.txt │ ├── cos │ │ ├── basic.expect.txt │ │ ├── basic.txt │ │ ├── embedded.expect.txt │ │ └── embedded.txt │ ├── cpp │ │ ├── expression-keywords.expect.txt │ │ ├── expression-keywords.txt │ │ ├── function-declarations.expect.txt │ │ ├── function-declarations.txt │ │ ├── function-params.expect.txt │ │ ├── function-params.txt │ │ ├── function-title.expect.txt │ │ ├── function-title.txt │ │ ├── number-literals.expect.txt │ │ ├── number-literals.txt │ │ ├── pointers-returns.expect.txt │ │ ├── pointers-returns.txt │ │ ├── preprocessor.expect.txt │ │ ├── preprocessor.txt │ │ ├── primitive-types.expect.txt │ │ ├── primitive-types.txt │ │ ├── string-literals.expect.txt │ │ └── string-literals.txt │ ├── crystal │ │ ├── defs.expect.txt │ │ ├── defs.txt │ │ ├── literals.expect.txt │ │ ├── literals.txt │ │ ├── macro.expect.txt │ │ ├── macro.txt │ │ ├── operators.expect.txt │ │ ├── operators.txt │ │ ├── regexes.expect.txt │ │ ├── regexes.txt │ │ ├── toplevel-keywords.expect.txt │ │ └── toplevel-keywords.txt │ ├── csharp │ │ ├── dotted-namespace.expect.txt │ │ ├── dotted-namespace.txt │ │ ├── floats.expect.txt │ │ ├── floats.txt │ │ ├── functions.expect.txt │ │ ├── functions.txt │ │ ├── generic_modifiers.expect.txt │ │ ├── generic_modifiers.txt │ │ ├── identifiers.expect.txt │ │ ├── identifiers.txt │ │ ├── string-interpolation.expect.txt │ │ ├── string-interpolation.txt │ │ ├── titles.expect.txt │ │ └── titles.txt │ ├── css │ │ ├── pseudo-selector.expect.txt │ │ ├── pseudo-selector.txt │ │ ├── sample.expect.txt │ │ ├── sample.txt │ │ ├── url.expect.txt │ │ └── url.txt │ ├── dart │ │ ├── comment-markdown.expect.txt │ │ ├── comment-markdown.txt │ │ ├── string-interpolation.expect.txt │ │ └── string-interpolation.txt │ ├── delphi │ │ ├── compiler-directive.expect.txt │ │ └── compiler-directive.txt │ ├── diff │ │ ├── comments.expect.txt │ │ └── comments.txt │ ├── dockerfile │ │ ├── default.expect.txt │ │ └── default.txt │ ├── dos │ │ ├── comments.expect.txt │ │ └── comments.txt │ ├── dsconfig │ │ ├── default.expect.txt │ │ └── default.txt │ ├── ebnf │ │ ├── quote-symbols.expect.txt │ │ ├── quote-symbols.txt │ │ ├── terminators.expect.txt │ │ ├── terminators.txt │ │ ├── underscore-production.expect.txt │ │ └── underscore-production.txt │ ├── elixir │ │ ├── function-not-regex.expect.txt │ │ ├── function-not-regex.txt │ │ ├── function-title.expect.txt │ │ ├── function-title.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── sigils.expect.txt │ │ ├── sigils.txt │ │ ├── strings.expect.txt │ │ ├── strings.txt │ │ ├── uppercase-string-sigil.expect.txt │ │ └── uppercase-string-sigil.txt │ ├── excel │ │ ├── comments.expect.txt │ │ └── comments.txt │ ├── fortran │ │ ├── comments.expect.txt │ │ ├── comments.txt │ │ ├── numbers.expect.txt │ │ └── numbers.txt │ ├── fsharp │ │ ├── bang-keywords.expect.txt │ │ └── bang-keywords.txt │ ├── gauss │ │ ├── function_defs.expect.txt │ │ ├── function_defs.txt │ │ ├── function_refs.expect.txt │ │ ├── function_refs.txt │ │ ├── keywords.expect.txt │ │ └── keywords.txt │ ├── go │ │ ├── functions.expect.txt │ │ ├── functions.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── strings.expect.txt │ │ └── strings.txt │ ├── golo │ │ ├── default.expect.txt │ │ └── default.txt │ ├── handlebars │ │ ├── block-expression-variants-as-path-segment.expect.txt │ │ ├── block-expression-variants-as-path-segment.txt │ │ ├── block-expression-variants-in-helper-name.expect.txt │ │ ├── block-expression-variants-in-helper-name.txt │ │ ├── block-expression-variants-in-param.expect.txt │ │ ├── block-expression-variants-in-param.txt │ │ ├── block-with-param.expect.txt │ │ ├── block-with-param.txt │ │ ├── block.expect.txt │ │ ├── block.txt │ │ ├── built-ins.expect.txt │ │ ├── built-ins.txt │ │ ├── comments.expect.txt │ │ ├── comments.txt │ │ ├── escaped-mustaches.expect.txt │ │ ├── escaped-mustaches.txt │ │ ├── expression-variants.expect.txt │ │ ├── expression-variants.txt │ │ ├── partial-call.expect.txt │ │ ├── partial-call.txt │ │ ├── raw-block.expect.txt │ │ ├── raw-block.txt │ │ ├── simple-expression.expect.txt │ │ ├── simple-expression.txt │ │ ├── sub-expressions.expect.txt │ │ ├── sub-expressions.txt │ │ ├── triple-mustache.expect.txt │ │ └── triple-mustache.txt │ ├── haskell │ │ ├── infix.expect.txt │ │ ├── infix.txt │ │ ├── nested-comments.expect.txt │ │ └── nested-comments.txt │ ├── http │ │ ├── default.expect.txt │ │ └── default.txt │ ├── index.js │ ├── ini │ │ ├── array.expect.txt │ │ ├── array.txt │ │ ├── comments.expect.txt │ │ ├── comments.txt │ │ ├── tables.expect.txt │ │ ├── tables.txt │ │ ├── types.expect.txt │ │ ├── types.txt │ │ ├── variable.expect.txt │ │ └── variable.txt │ ├── java │ │ ├── annotations.expect.txt │ │ ├── annotations.txt │ │ ├── gh1031.expect.txt │ │ ├── gh1031.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── titles.expect.txt │ │ └── titles.txt │ ├── javascript │ │ ├── arrow-function.expect.txt │ │ ├── arrow-function.txt │ │ ├── class.expect.txt │ │ ├── class.txt │ │ ├── default-parameters.expect.txt │ │ ├── default-parameters.txt │ │ ├── inline-languages.expect.txt │ │ ├── inline-languages.txt │ │ ├── jsdoc.expect.txt │ │ ├── jsdoc.txt │ │ ├── jsx-fragment.expect.txt │ │ ├── jsx-fragment.txt │ │ ├── jsx.expect.txt │ │ ├── jsx.txt │ │ ├── keywords.expect.txt │ │ ├── keywords.txt │ │ ├── method-call.expect.txt │ │ ├── method-call.txt │ │ ├── modules.expect.txt │ │ ├── modules.txt │ │ ├── object-attr.expect.txt │ │ ├── object-attr.txt │ │ ├── regex.expect.txt │ │ ├── regex.txt │ │ ├── shebang.expect.txt │ │ ├── shebang.txt │ │ ├── template-strings.expect.txt │ │ └── template-strings.txt │ ├── json │ │ ├── comments.expect.txt │ │ └── comments.txt │ ├── kotlin │ │ ├── class.expect.txt │ │ ├── class.txt │ │ ├── function.expect.txt │ │ ├── function.txt │ │ ├── nested_comment.expect.txt │ │ ├── nested_comment.txt │ │ ├── string.expect.txt │ │ └── string.txt │ ├── lasso │ │ ├── delimiters.expect.txt │ │ └── delimiters.txt │ ├── ldif │ │ ├── ldapmodify.expect.txt │ │ ├── ldapmodify.txt │ │ ├── schema.expect.txt │ │ └── schema.txt │ ├── less │ │ ├── selectors.expect.txt │ │ └── selectors.txt │ ├── lisp │ │ ├── mec.expect.txt │ │ └── mec.txt │ ├── markdown │ │ ├── bold_italics.expect.txt │ │ ├── bold_italics.txt │ │ ├── code.expect.txt │ │ ├── code.txt │ │ ├── list.expect.txt │ │ ├── list.txt │ │ ├── sections.expect.txt │ │ └── sections.txt │ ├── matlab │ │ ├── block_comment.expect.txt │ │ ├── block_comment.txt │ │ ├── transpose.expect.txt │ │ └── transpose.txt │ ├── maxima │ │ ├── example.expect.txt │ │ ├── example.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── symbols.expect.txt │ │ └── symbols.txt │ ├── objectivec │ │ ├── preprocessor.expect.txt │ │ ├── preprocessor.txt │ │ ├── string-literals.expect.txt │ │ └── string-literals.txt │ ├── ocaml │ │ ├── literals.expect.txt │ │ ├── literals.txt │ │ ├── types.expect.txt │ │ └── types.txt │ ├── pgsql │ │ ├── clauses.expect.txt │ │ ├── clauses.txt │ │ ├── clauses2.expect.txt │ │ ├── clauses2.txt │ │ ├── constraints.expect.txt │ │ ├── constraints.txt │ │ ├── options.expect.txt │ │ ├── options.txt │ │ ├── plpgsql.expect.txt │ │ ├── plpgsql.txt │ │ ├── sql-commands.expect.txt │ │ ├── sql-commands.txt │ │ ├── window-functions.expect.txt │ │ ├── window-functions.txt │ │ ├── xml.expect.txt │ │ └── xml.txt │ ├── php │ │ ├── comments.expect.txt │ │ ├── comments.txt │ │ ├── heredoc.expect.txt │ │ └── heredoc.txt │ ├── pony │ │ ├── control-flow.expect.txt │ │ ├── control-flow.txt │ │ ├── creator.expect.txt │ │ ├── creator.txt │ │ ├── iterface-trait.expect.txt │ │ ├── iterface-trait.txt │ │ ├── lambda.expect.txt │ │ ├── lambda.txt │ │ ├── match.expect.txt │ │ ├── match.txt │ │ ├── method.expect.txt │ │ ├── method.txt │ │ ├── number-literals.expect.txt │ │ ├── number-literals.txt │ │ ├── objects.expect.txt │ │ ├── objects.txt │ │ ├── prime.expect.txt │ │ ├── prime.txt │ │ ├── triple-quote.expect.txt │ │ └── triple-quote.txt │ ├── powershell │ │ ├── apos-herestring.expect.txt │ │ ├── apos-herestring.txt │ │ ├── classes.expect.txt │ │ ├── classes.txt │ │ ├── misc.expect.txt │ │ ├── misc.txt │ │ ├── quote-herestring.expect.txt │ │ └── quote-herestring.txt │ ├── properties │ │ ├── syntax.expect.txt │ │ └── syntax.txt │ ├── protobuf │ │ ├── message-message.expect.txt │ │ ├── message-message.txt │ │ ├── rpc.expect.txt │ │ └── rpc.txt │ ├── python-repl │ │ ├── sample.expect.txt │ │ └── sample.txt │ ├── python │ │ ├── escaped-quotes.expect.txt │ │ ├── escaped-quotes.txt │ │ ├── f-strings.expect.txt │ │ ├── f-strings.txt │ │ ├── function-header-comments.expect.txt │ │ ├── function-header-comments.txt │ │ ├── function-header.expect.txt │ │ ├── function-header.txt │ │ ├── matrix-multiplication.expect.txt │ │ └── matrix-multiplication.txt │ ├── reasonml │ │ ├── functions.expect.txt │ │ ├── functions.txt │ │ ├── literals.expect.txt │ │ ├── literals.txt │ │ ├── modules.expect.txt │ │ ├── modules.txt │ │ ├── pattern-matching.expect.txt │ │ └── pattern-matching.txt │ ├── ruby │ │ ├── gemfile.expect.txt │ │ ├── gemfile.txt │ │ ├── heredoc.expect.txt │ │ ├── heredoc.txt │ │ ├── prompt.expect.txt │ │ ├── prompt.txt │ │ ├── regexes.expect.txt │ │ └── regexes.txt │ ├── rust │ │ ├── comments.expect.txt │ │ ├── comments.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── strings.expect.txt │ │ ├── strings.txt │ │ ├── traits.expect.txt │ │ ├── traits.txt │ │ ├── types.expect.txt │ │ ├── types.txt │ │ ├── variables.expect.txt │ │ └── variables.txt │ ├── scala │ │ ├── case-classes.expect.txt │ │ └── case-classes.txt │ ├── scheme │ │ ├── lambda.expect.txt │ │ ├── lambda.txt │ │ ├── quoted.expect.txt │ │ └── quoted.txt │ ├── shell │ │ ├── plain-prompt.expect.txt │ │ ├── plain-prompt.txt │ │ ├── prompt-with-slash.expect.txt │ │ └── prompt-with-slash.txt │ ├── sql │ │ ├── interval.expect.txt │ │ ├── interval.txt │ │ ├── join.expect.txt │ │ ├── join.txt │ │ ├── keywords.expect.txt │ │ ├── keywords.txt │ │ ├── lateral-view.expect.txt │ │ ├── lateral-view.txt │ │ ├── numeric-types.expect.txt │ │ ├── numeric-types.txt │ │ ├── set-operator.expect.txt │ │ ├── set-operator.txt │ │ ├── string-types.expect.txt │ │ ├── string-types.txt │ │ ├── tablesample.expect.txt │ │ ├── tablesample.txt │ │ ├── values-statement.expect.txt │ │ ├── values-statement.txt │ │ ├── window-function.expect.txt │ │ └── window-function.txt │ ├── stata │ │ ├── built_ins.expect.txt │ │ └── built_ins.txt │ ├── subunit │ │ ├── subunit-errorline.expect.txt │ │ ├── subunit-errorline.txt │ │ ├── subunit-failureline.expect.txt │ │ ├── subunit-failureline.txt │ │ ├── subunit-progressline.expect.txt │ │ ├── subunit-progressline.txt │ │ ├── subunit-skipline.expect.txt │ │ ├── subunit-skipline.txt │ │ ├── subunit-successline.expect.txt │ │ ├── subunit-successline.txt │ │ ├── subunit-tagline.expect.txt │ │ ├── subunit-tagline.txt │ │ ├── subunit-testline.expect.txt │ │ ├── subunit-testline.txt │ │ ├── subunit-timeline.expect.txt │ │ ├── subunit-timeline.txt │ │ ├── subunit-uxsuccessline.expect.txt │ │ ├── subunit-uxsuccessline.txt │ │ ├── subunit-xfailline.expect.txt │ │ └── subunit-xfailline.txt │ ├── swift │ │ ├── functions.expect.txt │ │ ├── functions.txt │ │ ├── multiline-string.expect.txt │ │ └── multiline-string.txt │ ├── tap │ │ ├── basic.expect.txt │ │ ├── basic.txt │ │ ├── without-numbers.expect.txt │ │ ├── without-numbers.txt │ │ ├── yaml-block.expect.txt │ │ └── yaml-block.txt │ ├── twig │ │ ├── filter_with_underscore.expect.txt │ │ ├── filter_with_underscore.txt │ │ ├── template_tags.expect.txt │ │ └── template_tags.txt │ ├── typescript │ │ ├── class.expect.txt │ │ ├── class.txt │ │ ├── declares.expect.txt │ │ ├── declares.txt │ │ ├── decorator-factories.expect.txt │ │ ├── decorator-factories.txt │ │ ├── functions.expect.txt │ │ ├── functions.txt │ │ ├── inline-languages.expect.txt │ │ ├── inline-languages.txt │ │ ├── jsx.expect.txt │ │ ├── jsx.txt │ │ ├── module-id.expect.txt │ │ ├── module-id.txt │ │ ├── nested-templates.expect.txt │ │ └── nested-templates.txt │ ├── verilog │ │ ├── misc.expect.txt │ │ ├── misc.txt │ │ ├── numbers.expect.txt │ │ └── numbers.txt │ ├── vim │ │ ├── strings-comments.expect.txt │ │ └── strings-comments.txt │ ├── x86asm │ │ ├── labels-directives.expect.txt │ │ └── labels-directives.txt │ ├── xml │ │ ├── document-type-variations.expect.txt │ │ ├── document-type-variations.txt │ │ ├── space-attributes.expect.txt │ │ ├── space-attributes.txt │ │ ├── unquoted-attributes.expect.txt │ │ └── unquoted-attributes.txt │ ├── xquery │ │ ├── computed_inbuilt.expect.txt │ │ ├── computed_inbuilt.txt │ │ ├── direct_method.expect.txt │ │ ├── direct_method.txt │ │ ├── function_body.expect.txt │ │ ├── function_body.txt │ │ ├── prolog_declarations.expect.txt │ │ └── prolog_declarations.txt │ ├── yaml │ │ ├── block.expect.txt │ │ ├── block.txt │ │ ├── keys.expect.txt │ │ ├── keys.txt │ │ ├── numbers.expect.txt │ │ ├── numbers.txt │ │ ├── string.expect.txt │ │ ├── string.txt │ │ ├── tag.expect.txt │ │ └── tag.txt │ └── zephir │ │ ├── default.expect.txt │ │ └── default.txt ├── mocha.opts ├── parser │ ├── index.js │ ├── look-ahead-end-matchers.js │ ├── reuse-endsWithParent.js │ └── should-not-destroyData.js ├── special │ ├── buildClassName.js │ ├── customMarkup.js │ ├── endsWithParentVariants.js │ ├── explicitLanguage.js │ ├── index.js │ ├── languageAlias.js │ ├── noHighlight.js │ ├── subLanguages.js │ └── useBr.js └── utility.js └── tools ├── build.js ├── build_browser.js ├── build_cdn.js ├── build_config.js ├── build_node.js ├── checkAutoDetect.js ├── codeformat.js ├── developer.html ├── keywordsformat.js └── lib ├── bundling.js ├── dependencies.js ├── external_language.js ├── language.js └── makestuff.js /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | end_of_line = lf 3 | insert_final_newline = true 4 | 5 | [*.{js,css}] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # The build script and some tests use `\n` as markers, so we need to make sure 2 | # that all javascript files are checked out using UNIX line endings (not `\r\n`) 3 | *.js eol=lf 4 | *.txt eol=lf -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build 3 | docs/_build 4 | __pycache__ 5 | *.swp 6 | node_modules 7 | .project 8 | yarn.lock 9 | extra/ 10 | 11 | # editors 12 | .idea/ 13 | .vscode/ 14 | .Rproj.user 15 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | // whole codebase isn't ES8/9 yet, but our tests and some things are 2 | { 3 | "esversion": 9, 4 | "node": true 5 | } 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12 2 | # docker build -t highlight-js . 3 | RUN apt-get update && apt-get install -y nginx 4 | WORKDIR /var/www/html 5 | COPY ./package*.json /var/www/html/ 6 | RUN npm install 7 | COPY . /var/www/html 8 | RUN node tools/build.js :common 9 | EXPOSE 80 10 | CMD ["nginx", "-g", "daemon off;"] 11 | -------------------------------------------------------------------------------- /demo/readme.md: -------------------------------------------------------------------------------- 1 | To view this demo in browser, please follow the [build instructions](http://highlightjs.readthedocs.io/en/latest/building-testing.html#building) with browser as the target, and then open the generated build/demo/index.html. 2 | -------------------------------------------------------------------------------- /docs/_build/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/docs/_build/.gitkeep -------------------------------------------------------------------------------- /docs/_static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/docs/_static/.gitkeep -------------------------------------------------------------------------------- /docs/_templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/docs/_templates/.gitkeep -------------------------------------------------------------------------------- /extra/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/extra/.keep -------------------------------------------------------------------------------- /src/languages/c.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: C 3 | Category: common, system 4 | Website: https://en.wikipedia.org/wiki/C_(programming_language) 5 | Requires: c-like.js 6 | */ 7 | 8 | export default function(hljs) { 9 | 10 | var lang = hljs.getLanguage('c-like').rawDefinition(); 11 | // Until C is actually different than C++ there is no reason to auto-detect C 12 | // as it's own language since it would just fail auto-detect testing or 13 | // simply match with C++. 14 | // 15 | // See further comments in c-like.js. 16 | 17 | // lang.disableAutodetect = false; 18 | lang.name = 'C'; 19 | lang.aliases = ['c', 'h']; 20 | return lang; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/languages/clojure-repl.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: Clojure REPL 3 | Description: Clojure REPL sessions 4 | Author: Ivan Sagalaev 5 | Requires: clojure.js 6 | Website: https://clojure.org 7 | Category: lisp 8 | */ 9 | 10 | export default function(hljs) { 11 | return { 12 | name: 'Clojure REPL', 13 | contains: [ 14 | { 15 | className: 'meta', 16 | begin: /^([\w.-]+|\s*#_)?=>/, 17 | starts: { 18 | end: /$/, 19 | subLanguage: 'clojure' 20 | } 21 | } 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/languages/cpp.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: C++ 3 | Category: common, system 4 | Website: https://isocpp.org 5 | Requires: c-like.js 6 | */ 7 | 8 | export default function(hljs) { 9 | 10 | var lang = hljs.getLanguage('c-like').rawDefinition(); 11 | // return auto-detection back on 12 | lang.disableAutodetect = false; 13 | lang.name = 'C++'; 14 | lang.aliases = ['cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx']; 15 | return lang; 16 | } 17 | -------------------------------------------------------------------------------- /src/languages/erb.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: ERB (Embedded Ruby) 3 | Requires: xml.js, ruby.js 4 | Author: Lucas Mazza 5 | Contributors: Kassio Borges 6 | Description: "Bridge" language defining fragments of Ruby in HTML within <% .. %> 7 | Website: https://ruby-doc.org/stdlib-2.6.5/libdoc/erb/rdoc/ERB.html 8 | Category: template 9 | */ 10 | 11 | export default function(hljs) { 12 | return { 13 | name: 'ERB', 14 | subLanguage: 'xml', 15 | contains: [ 16 | hljs.COMMENT('<%#', '%>'), 17 | { 18 | begin: '<%[%=-]?', end: '[%-]?%>', 19 | subLanguage: 'ruby', 20 | excludeBegin: true, 21 | excludeEnd: true 22 | } 23 | ] 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /src/languages/plaintext.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: Plain text 3 | Author: Egor Rogov (e.rogov@postgrespro.ru) 4 | Description: Plain text without any highlighting. 5 | Category: common 6 | */ 7 | 8 | export default function(hljs) { 9 | return { 10 | name: 'Plain text', 11 | aliases: ['text', 'txt'], 12 | disableAutodetect: true 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /src/languages/shell.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: Shell Session 3 | Requires: bash.js 4 | Author: TSUYUSATO Kitsune 5 | Category: common 6 | */ 7 | 8 | export default function(hljs) { 9 | return { 10 | name: 'Shell Session', 11 | aliases: ['console'], 12 | contains: [ 13 | { 14 | className: 'meta', 15 | begin: '^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]', 16 | starts: { 17 | end: '$', subLanguage: 'bash' 18 | } 19 | } 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/languages/vbscript-html.js: -------------------------------------------------------------------------------- 1 | /* 2 | Language: VBScript in HTML 3 | Requires: xml.js, vbscript.js 4 | Author: Ivan Sagalaev 5 | Description: "Bridge" language defining fragments of VBScript in HTML within <% .. %> 6 | Website: https://en.wikipedia.org/wiki/VBScript 7 | Category: scripting 8 | */ 9 | 10 | export default function(hljs) { 11 | return { 12 | name: 'VBScript in HTML', 13 | subLanguage: 'xml', 14 | contains: [ 15 | { 16 | begin: '<%', end: '%>', 17 | subLanguage: 'vbscript' 18 | } 19 | ] 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /src/styles/brown-papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/src/styles/brown-papersq.png -------------------------------------------------------------------------------- /src/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/src/styles/pojoaque.jpg -------------------------------------------------------------------------------- /src/styles/school-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/losinggeneration/highlight.js/36e1e330bcd32ab7009fb89ac23cddeed4425ab2/src/styles/school-book.png -------------------------------------------------------------------------------- /test/api/fixmarkup.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const should = require('should'); 4 | const hljs = require('../../build'); 5 | 6 | describe('.fixmarkup()', () => { 7 | after(() => { 8 | hljs.configure({ useBR: false }) 9 | }) 10 | 11 | it('should not add "undefined" to the beginning of the result (#1452)', () => { 12 | hljs.configure({ useBR: true }) 13 | const value = '{ "some": \n "json" }'; 14 | const result = hljs.fixMarkup(value); 15 | 16 | 17 | result.should.equal( 18 | '{ "some":
"json" }' 19 | ); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /test/api/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('hljs', function() { 4 | require('./ident'); 5 | require('./underscoreIdent'); 6 | require('./number'); 7 | require('./cNumber'); 8 | require('./binaryNumber'); 9 | require('./starters'); 10 | require('./getLanguage'); 11 | require('./autoDetection'); 12 | require('./highlight'); 13 | require('./fixmarkup'); 14 | require('./keywords'); 15 | }); 16 | -------------------------------------------------------------------------------- /test/browser/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('./plain'); 4 | require('./worker'); 5 | require('./highlight_block_callbacks'); 6 | -------------------------------------------------------------------------------- /test/builds/package.js: -------------------------------------------------------------------------------- 1 | /* 2 | This file is used by import_via_commonjs.js to build a single "package" 3 | and acts as a sanity check that all our code is "use strict" safe 4 | 5 | See .travis.yml 6 | */ 7 | 8 | import hljs from '../../build/lib/index.js'; 9 | 10 | hljs.highlight("cpp","/* test */") 11 | console.log("Rollup built package works.") 12 | -------------------------------------------------------------------------------- /test/builds/rollup_import_via_commonjs.js: -------------------------------------------------------------------------------- 1 | // rollup.config.js 2 | import commonjs from 'rollup-plugin-commonjs'; 3 | 4 | export default { 5 | input: 'test/builds/package.js', 6 | output: { 7 | file: 'build/bundle.js', 8 | format: 'iife' 9 | }, 10 | plugins: [ 11 | commonjs({ 12 | include: 'build/**', // Default: undefined 13 | exclude: [ 'node_modules/**' ], // Default: undefined 14 | }) 15 | ] 16 | }; 17 | -------------------------------------------------------------------------------- /test/detect/abnf/default.txt: -------------------------------------------------------------------------------- 1 | ; line comment 2 | 3 | ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment 4 | 5 | group1 = alt1 6 | group1 =/ alt2 7 | 8 | alt1 = %x41-4D / %d78-90 9 | 10 | alt2 = %b00100001 11 | 12 | group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET 13 | 14 | optional = hex-codes 15 | / literal 16 | / sensitive 17 | / insensitive 18 | 19 | hex-codes = %x68.65.6C.6C.6F 20 | literal = "string literal" 21 | sensitive = %s"case-sensitive string" 22 | insensitive = %i"case-insensitive string" 23 | -------------------------------------------------------------------------------- /test/detect/accesslog/default.txt: -------------------------------------------------------------------------------- 1 | 20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" 2 | -------------------------------------------------------------------------------- /test/detect/actionscript/default.txt: -------------------------------------------------------------------------------- 1 | package org.example.dummy { 2 | import org.dummy.*; 3 | 4 | /*define package inline interface*/ 5 | public interface IFooBarzable { 6 | public function foo(... pairs):Array; 7 | } 8 | 9 | public class FooBar implements IFooBarzable { 10 | static private var cnt:uint = 0; 11 | private var bar:String; 12 | 13 | //constructor 14 | public function TestBar(bar:String):void { 15 | bar = bar; 16 | ++cnt; 17 | } 18 | 19 | public function foo(... pairs):Array { 20 | pairs.push(bar); 21 | return pairs; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /test/detect/ada/default.txt: -------------------------------------------------------------------------------- 1 | package body Sqlite.Simple is 2 | 3 | Foo : int := int'Size; 4 | Bar : int := long'Size; 5 | 6 | Error_Message_C : chars_ptr := Sqlite_Errstr (Error); 7 | Error_Message : String := Null_Ignore_Value (Error_Message_C); 8 | begin 9 | 10 | Named : for Index in Foo..Bar loop 11 | Put ("Hi[]{}"); 12 | end loop Named; 13 | 14 | Foo := Bar; 15 | end Message; 16 | 17 | end Sqlite.Simple; 18 | -------------------------------------------------------------------------------- /test/detect/apache/default.txt: -------------------------------------------------------------------------------- 1 | # rewrite`s rules for wordpress pretty url 2 | LoadModule rewrite_module modules/mod_rewrite.so 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule . index.php [NC,L] 6 | 7 | ExpiresActive On 8 | ExpiresByType application/x-javascript "access plus 1 days" 9 | 10 | Order Deny,Allow 11 | Allow from All 12 | 13 | 14 | RewriteMap map txt:map.txt 15 | RewriteMap lower int:tolower 16 | RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC] 17 | RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND 18 | RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L] 19 | 20 | -------------------------------------------------------------------------------- /test/detect/applescript/default.txt: -------------------------------------------------------------------------------- 1 | repeat 5 times 2 | if foo is greater than bar then 3 | display dialog "Hello there" 4 | else 5 | beep 6 | end if 7 | end repeat 8 | 9 | (* comment (*nested comment*) *) 10 | on do_something(s, y) 11 | return {s + pi, y mod 4} 12 | end do_something 13 | 14 | do shell script "/bin/echo 'hello'" 15 | -------------------------------------------------------------------------------- /test/detect/arcade/default.txt: -------------------------------------------------------------------------------- 1 | /* Highlight.js est for Arcade */ 2 | function testGeometry(element, point) { 3 | if (point.y != -1) 4 | return point; 5 | for (var i = 0 / 2; i < element.length; i++) { 6 | if (checkCondition($map.element[i]) === Infinity) { 7 | return DistanceGeodetic(element[i]); 8 | } 9 | } 10 | return element; 11 | } 12 | var filePath = "literal " + TextFormatting.BackSlash + TextFormatting.SingleQuote + ".ext" 13 | var d = Dictionary("field1", 1, "field2",2); 14 | return FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); 15 | -------------------------------------------------------------------------------- /test/detect/autohotkey/default.txt: -------------------------------------------------------------------------------- 1 | ; hotkeys and hotstrings 2 | #a::WinSet, AlwaysOnTop, Toggle, A 3 | #Space:: 4 | MsgBox, Percent sign (`%) need to be escaped. 5 | Run "C:\Program Files\some\program.exe" 6 | Gosub, label1 7 | return 8 | ::btw::by the way 9 | ; volume 10 | #Numpad8::Send {Volume_Up} 11 | #Numpad5::Send {Volume_Mute} 12 | #Numpad2::Send {Volume_Down} 13 | 14 | label1: 15 | if (Clipboard = "") 16 | { 17 | MsgBox, , Clipboard, Empty! 18 | } 19 | else 20 | { 21 | StringReplace, temp, Clipboard, old, new, All 22 | MsgBox, , Clipboard, %temp% 23 | } 24 | return 25 | -------------------------------------------------------------------------------- /test/detect/autoit/default.txt: -------------------------------------------------------------------------------- 1 | #NoTrayIcon 2 | #AutoIt3Wrapper_Run_Tidy=Y 3 | #include 4 | 5 | _Singleton(@ScriptName) ; Allow only one instance 6 | example(0, 10) 7 | 8 | Func example($min, $max) 9 | For $i = $min To $max 10 | If Mod($i, 2) == 0 Then 11 | MsgBox(64, "Message", $i & ' is even number!') 12 | Else 13 | MsgBox(64, "Message", $i & ' is odd number!') 14 | EndIf 15 | Next 16 | EndFunc ;==>example -------------------------------------------------------------------------------- /test/detect/avrasm/default.txt: -------------------------------------------------------------------------------- 1 | ;* Title: Block Copy Routines 2 | ;* Version: 1.1 3 | 4 | .include "8515def.inc" 5 | 6 | rjmp RESET ;reset handle 7 | 8 | .def flashsize=r16 ;size of block to be copied 9 | 10 | flash2ram: 11 | lpm ;get constant 12 | st Y+,r0 ;store in SRAM and increment Y-pointer 13 | adiw ZL,1 ;increment Z-pointer 14 | dec flashsize 15 | brne flash2ram ;if not end of table, loop more 16 | ret 17 | 18 | .def ramtemp =r1 ;temporary storage register 19 | .def ramsize =r16 ;size of block to be copied 20 | -------------------------------------------------------------------------------- /test/detect/awk/default.txt: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | POPService = "/inet/tcp/0/emailhost/pop3" 3 | RS = ORS = "\r\n" 4 | print "user name" |& POPService 5 | POPService |& getline 6 | print "pass password" |& POPService 7 | POPService |& getline 8 | print "retr 1" |& POPService 9 | POPService |& getline 10 | if ($1 != "+OK") exit 11 | print "quit" |& POPService 12 | RS = "\r\n\\.\r\n" 13 | POPService |& getline 14 | print $0 15 | close(POPService) 16 | } 17 | -------------------------------------------------------------------------------- /test/detect/bash/default.txt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###### CONFIG 4 | ACCEPTED_HOSTS="/root/.hag_accepted.conf" 5 | BE_VERBOSE=false 6 | 7 | if [ "$UID" -ne 0 ] 8 | then 9 | echo "Superuser rights required" 10 | exit 2 11 | fi 12 | 13 | genApacheConf(){ 14 | echo -e "# Host ${HOME_DIR}$1/$2 :" 15 | } 16 | 17 | echo '"quoted"' | tr -d \" > text.txt 18 | -------------------------------------------------------------------------------- /test/detect/basic/default.txt: -------------------------------------------------------------------------------- 1 | 10 CLS 2 | 20 FOR I = 0 TO 15 3 | 22 FOR J = 0 TO 7 4 | 30 COLOR I,J 5 | 40 PRINT " ** "; 6 | 45 NEXT J 7 | 46 COLOR I,0 8 | 47 GOSUB 100 9 | 48 PRINT 10 | 50 NEXT I 11 | 60 COLOR 15,0 12 | 99 END 13 | 100 FOR T = 65 TO 90 14 | 101 PRINT CHR$(T); 15 | 102 NEXT T 16 | 103 RETURN 17 | 200 REM Data types test 18 | 201 TOTAL# = 3.30# 'Double precision variable 19 | 202 BALANCE! = 3! 'Single precision variable 20 | 203 B2! = 12e5 '120000 21 | 204 ITEMS% = 10 'Integer variable 22 | 205 HEXTEST = &H12DB 'Hex value 23 | -------------------------------------------------------------------------------- /test/detect/bnf/default.txt: -------------------------------------------------------------------------------- 1 | ::= | 2 | ::= "<" ">" "::=" 3 | ::= " " | "" 4 | ::= | "|" 5 | ::= | 6 | ::= | 7 | ::= | "<" ">" 8 | ::= '"' '"' | "'" "'" 9 | -------------------------------------------------------------------------------- /test/detect/brainfuck/default.txt: -------------------------------------------------------------------------------- 1 | ++++++++++ 2 | [ 3*10 and 10*10 3 | ->+++>++++++++++<< 4 | ]>> 5 | [ filling cells 6 | ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[> 7 | ]< 8 | +++++++++<< 9 | [ rough codes correction loop 10 | ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< 11 | ] 12 | more accurate сodes correction 13 | >>>++> 14 | -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> 15 | ++>+++++++++++>++++++++++++>------>+++ 16 | rewind and output 17 | [<]>[.>] 18 | -------------------------------------------------------------------------------- /test/detect/ceylon/default.txt: -------------------------------------------------------------------------------- 1 | shared void run() { 2 | print("Hello, `` process.arguments.first else "World" ``!"); 3 | } 4 | class Counter(count=0) { 5 | variable Integer count; 6 | shared Integer currentValue => count; 7 | shared void increment() => count++; 8 | } 9 | -------------------------------------------------------------------------------- /test/detect/clojure-repl/default.txt: -------------------------------------------------------------------------------- 1 | user=> (defn f [x y] 2 | #_=> (+ x y)) 3 | #'user/f 4 | user=> (f 5 7) 5 | 12 6 | user=> nil 7 | nil 8 | -------------------------------------------------------------------------------- /test/detect/clojure/default.txt: -------------------------------------------------------------------------------- 1 | (def ^:dynamic chunk-size 17) 2 | 3 | (defn next-chunk [rdr] 4 | (let [buf (char-array chunk-size) 5 | s (.read rdr buf)] 6 | (when (pos? s) 7 | (java.nio.CharBuffer/wrap buf 0 s)))) 8 | 9 | (defn chunk-seq [rdr] 10 | (when-let [chunk (next-chunk rdr)] 11 | (cons chunk (lazy-seq (chunk-seq rdr))))) 12 | -------------------------------------------------------------------------------- /test/detect/cmake/default.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.8) 2 | project(cmake_example) 3 | 4 | # Show message on Linux platform 5 | if (${CMAKE_SYSTEM_NAME} MATCHES Linux) 6 | message("Good choice, bro!") 7 | endif() 8 | 9 | # Tell CMake to run moc when necessary: 10 | set(CMAKE_AUTOMOC ON) 11 | # As moc files are generated in the binary dir, 12 | # tell CMake to always look for includes there: 13 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 14 | 15 | # Widgets finds its own dependencies. 16 | find_package(Qt5Widgets REQUIRED) 17 | 18 | add_executable(myproject main.cpp mainwindow.cpp) 19 | qt5_use_modules(myproject Widgets) 20 | -------------------------------------------------------------------------------- /test/detect/coffeescript/default.txt: -------------------------------------------------------------------------------- 1 | grade = (student, period=(if b? then 7 else 6)) -> 2 | if student.excellentWork 3 | "A+" 4 | else if student.okayStuff 5 | if student.triedHard then "B" else "B-" 6 | else 7 | "C" 8 | 9 | class Animal extends Being 10 | constructor: (@name) -> 11 | 12 | move: (meters) -> 13 | alert @name + " moved #{meters}m." 14 | -------------------------------------------------------------------------------- /test/detect/cos/default.txt: -------------------------------------------------------------------------------- 1 | #dim test as %Library.Integer 2 | SET test = 123.099 3 | set ^global = %request.Content 4 | Write "Current date """, $ztimestamp, """, result: ", test + ^global = 125.099 5 | do ##class(Cinema.Utils).AddShow("test") // class method call 6 | do ##super() ; another one-line comment 7 | d:(^global = 2) ..thisClassMethod(1, 2, "test") 8 | /* 9 | * Sub-languages support: 10 | */ 11 | &sql( SELECT * FROM Cinema.Film WHERE Length > 2 ) 12 | &js 15 | &html< 16 | 17 | 18 | Test 19 | > 20 | 21 | quit $$$OK 22 | -------------------------------------------------------------------------------- /test/detect/cpp/comment.txt: -------------------------------------------------------------------------------- 1 | /* 2 | To use this program, compile it -- if you can -- and then type something like: 3 | 4 | chan -n 5000 -d 2 < input.txt 5 | 6 | In this case, it will produce 5000 words of output, checking two-word groups. 7 | (The explanation above describes two-word generation. If you type "-d 3", 8 | the program will find three-word groups, and so on. Greater depths make more 9 | sense, but they require more input text and take more time to process.) 10 | 11 | http://www.eblong.com/zarf/markov/ 12 | */ 13 | 14 | 15 | /* make cpp win deterministically over others with C block comments */ 16 | cout << endl; 17 | -------------------------------------------------------------------------------- /test/detect/cpp/default.txt: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) { 4 | 5 | /* An annoying "Hello World" example */ 6 | for (auto i = 0; i < 0xFFFF; i++) 7 | cout << "Hello, World!" << endl; 8 | 9 | char c = '\n'; 10 | unordered_map > m; 11 | m["key"] = "\\\\"; // this is an error 12 | 13 | return -2e3 + 12l; 14 | } 15 | -------------------------------------------------------------------------------- /test/detect/crystal/default.txt: -------------------------------------------------------------------------------- 1 | class Person 2 | def initialize(@name : String) 3 | end 4 | 5 | def greet 6 | puts "Hi, I'm #{@name}" 7 | end 8 | end 9 | 10 | class Employee < Person 11 | end 12 | 13 | employee = Employee.new "John" 14 | employee.greet # => "Hi, I'm John" 15 | employee.is_a?(Person) # => true 16 | 17 | @[Link("m")] 18 | lib C 19 | # In C: double cos(double x) 20 | fun cos(value : Float64) : Float64 21 | end 22 | 23 | C.cos(1.5_f64) # => 0.0707372 24 | 25 | s = uninitialized String 26 | s = <<-'STR' 27 | \hello\world 28 | \hello\world 29 | STR 30 | -------------------------------------------------------------------------------- /test/detect/csharp/default.txt: -------------------------------------------------------------------------------- 1 | using System.IO.Compression; 2 | 3 | #pragma warning disable 414, 3021 4 | 5 | namespace MyApplication 6 | { 7 | [Obsolete("...")] 8 | class Program : IInterface 9 | { 10 | public static List JustDoIt(int count) 11 | { 12 | Console.WriteLine($"Hello {Name}!"); 13 | return new List(new int[] { 1, 2, 3 }) 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/detect/csp/default.txt: -------------------------------------------------------------------------------- 1 | Content-Security-Policy: 2 | default-src 'self'; 3 | style-src 'self' css.example.com; 4 | img-src *.example.com; 5 | script-src 'unsafe-eval' 'self' js.example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3' 6 | -------------------------------------------------------------------------------- /test/detect/css/default.txt: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: Chunkfive; src: url('Chunkfive.otf'); 3 | } 4 | 5 | body, .usertext { 6 | color: #F0F0F0; background: #600; 7 | font-family: Chunkfive, sans; 8 | --heading-1: 30px/32px Helvetica, sans-serif; 9 | } 10 | 11 | @import url(print.css); 12 | @media print { 13 | a[href^=http]::after { 14 | content: attr(href) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/detect/django/default.txt: -------------------------------------------------------------------------------- 1 | {% if articles|length %} 2 | {% for article in articles %} 3 | 4 | {% custom %} 5 | 6 | {# Striped table #} 7 | 8 | {{ article|default:"Hi... " }} 9 | 10 | Published on {{ article.date }} 11 | 12 | 13 | 14 | {% endfor %} 15 | {% endif %} 16 | -------------------------------------------------------------------------------- /test/detect/dos/default.txt: -------------------------------------------------------------------------------- 1 | cd \ 2 | copy a b 3 | ping 192.168.0.1 4 | @rem ping 192.168.0.1 5 | net stop sharedaccess 6 | del %tmp% /f /s /q 7 | del %temp% /f /s /q 8 | ipconfig /flushdns 9 | taskkill /F /IM JAVA.EXE /T 10 | 11 | cd Photoshop/Adobe Photoshop CS3/AMT/ 12 | if exist application.sif ( 13 | ren application.sif _application.sif 14 | ) else ( 15 | ren _application.sif application.sif 16 | ) 17 | 18 | taskkill /F /IM proquota.exe /T 19 | 20 | sfc /SCANNOW 21 | 22 | set path = test 23 | 24 | xcopy %1\*.* %2 25 | -------------------------------------------------------------------------------- /test/detect/dust/default.txt: -------------------------------------------------------------------------------- 1 |

Hours

2 | 3 |
    4 | {#users} 5 |
  • {firstName}
  • {~n} 6 | {/users} 7 |
8 | -------------------------------------------------------------------------------- /test/detect/ebnf/default.txt: -------------------------------------------------------------------------------- 1 | (* line comment *) 2 | 3 | rule = [optional] , symbol , { letters } , ( digit | symbol ) ; 4 | 5 | optional = ? something unnecessary ? ; (* trailing comment *) 6 | 7 | symbol = '!' | '@' | '#' | '$' | '%' | '&' | '*' ; 8 | digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; 9 | letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" 10 | | "H" | "I" | "J" | "K" | "L" | "M" | "N" 11 | | "O" | "P" | "Q" | "R" | "S" | "T" | "U" 12 | | "V" | "W" | "X" | "Y" | "Z" ; 13 | -------------------------------------------------------------------------------- /test/detect/elm/default.txt: -------------------------------------------------------------------------------- 1 | import Browser 2 | import Html exposing (div, button, text) 3 | import Html.Events exposing (onClick) 4 | 5 | type Msg 6 | = Increment 7 | 8 | main = 9 | Browser.sandbox 10 | { init = 0 11 | , update = \msg model -> model + 1 12 | , view = view 13 | } 14 | 15 | view model = 16 | div [] 17 | [ div [] [ text (String.fromInt model) ] 18 | , button [ onClick Increment ] [ text "+" ] 19 | ] 20 | 21 | chars = 22 | String.cons 'C' <| String.cons 'h' <| "ars" 23 | -------------------------------------------------------------------------------- /test/detect/erb/default.txt: -------------------------------------------------------------------------------- 1 | <%# this is a comment %> 2 | 3 | <% @posts.each do |post| %> 4 |

<%= link_to post.title, post %>

5 | <% end %> 6 | 7 | <%- available_things = things.select(&:available?) -%> 8 | <%%- x = 1 + 2 -%%> 9 | <%% value = 'real string #{@value}' %%> 10 | <%%= available_things.inspect %%> 11 | -------------------------------------------------------------------------------- /test/detect/erlang-repl/default.txt: -------------------------------------------------------------------------------- 1 | 1> Str = "abcd". 2 | "abcd" 3 | 2> L = test:length(Str). 4 | 4 5 | 3> Descriptor = {L, list_to_atom(Str)}. 6 | {4,abcd} 7 | 4> L. 8 | 4 9 | 5> b(). 10 | Descriptor = {4,abcd} 11 | L = 4 12 | Str = "abcd" 13 | ok 14 | 6> f(L). 15 | ok 16 | 7> b(). 17 | Descriptor = {4,abcd} 18 | Str = "abcd" 19 | ok 20 | 8> {L, _} = Descriptor. 21 | {4,abcd} 22 | 9> L. 23 | 4 24 | 10> 2#101. 25 | 5 26 | 11> 1.85e+3. 27 | 1850 28 | -------------------------------------------------------------------------------- /test/detect/excel/default.txt: -------------------------------------------------------------------------------- 1 | =IF(C10 <= 275.5, "Unprofitable", "Profitable") -------------------------------------------------------------------------------- /test/detect/fix/default.txt: -------------------------------------------------------------------------------- 1 | 8=FIX.4.2␁9=0␁35=8␁49=SENDERTEST␁56=TARGETTEST␁34=00000001526␁52=20120429-13:30:08.137␁1=ABC12345␁11=2012abc1234␁14=100␁17=201254321␁20=0␁30=NYSE␁31=108.20␁32=100␁38=100␁39=2␁40=1␁47=A␁54=5␁55=BRK␁59=2␁60=20120429-13:30:08.000␁65=B␁76=BROKER␁84=0␁100=NYSE␁111=100␁150=2␁151=0␁167=CS␁377=N␁10000=SampleCustomTag␁10=123␁ 2 | 3 | 8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123 4 |  -------------------------------------------------------------------------------- /test/detect/fortran/default.txt: -------------------------------------------------------------------------------- 1 | subroutine test_sub(k) 2 | implicit none 3 | 4 | !=============================== 5 | ! This is a test subroutine 6 | !=============================== 7 | 8 | integer, intent(in) :: k 9 | double precision, allocatable :: a(:) 10 | integer, parameter :: nmax=10 11 | integer :: i 12 | 13 | allocate (a(nmax)) 14 | 15 | do i=1,nmax 16 | a(i) = dble(i)*5.d0 17 | enddo 18 | 19 | print *, 'Hello world' 20 | write (*,*) a(:) 21 | 22 | end subroutine test_sub 23 | -------------------------------------------------------------------------------- /test/detect/gauss/default.txt: -------------------------------------------------------------------------------- 1 | // This is a test 2 | #include pv.sdf 3 | 4 | proc (1) = calc(local__row, fin); 5 | if local__row; 6 | nr = local__row; 7 | else; 8 | k = colsf(fin); 9 | nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); 10 | endif; 11 | retp(nr); 12 | endp; 13 | 14 | s = "{% test string %}"; 15 | 16 | fn twopi=pi*2; 17 | 18 | /* Takes in multiple numbers. 19 | Output sum */ 20 | keyword add(str); 21 | local tok,sum; 22 | sum = 0; 23 | do until str $== ""; 24 | { tok, str } = token(str); 25 | sum = sum + stof(tok); 26 | endo; 27 | print "Sum is: " sum; 28 | endp; 29 | -------------------------------------------------------------------------------- /test/detect/gcode/default.txt: -------------------------------------------------------------------------------- 1 | O003 (DIAMOND SQUARE) 2 | N2 G54 G90 G49 G80 3 | N3 M6 T1 (1.ENDMILL) 4 | N4 M3 S1800 5 | N5 G0 X-.6 Y2.050 6 | N6 G43 H1 Z.1 7 | N7 G1 Z-.3 F50. 8 | N8 G41 D1 Y1.45 9 | N9 G1 X0 F20. 10 | N10 G2 J-1.45 11 | (CUTTER COMP CANCEL) 12 | N11 G1 Z-.2 F50. 13 | N12 Y-.990 14 | N13 G40 15 | N14 G0 X-.6 Y1.590 16 | N15 G0 Z.1 17 | N16 M5 G49 G28 G91 Z0 18 | N17 CALL O9456 19 | N18 #500=0.004 20 | N19 #503=[#500+#501] 21 | N20 VC45=0.0006 22 | VS4=0.0007 23 | N21 G90 G10 L20 P3 X5.Y4. Z6.567 24 | N22 G0 X5000 25 | N23 IF [#1 LT 0.370] GOTO 49 26 | N24 X-0.678 Y+.990 27 | N25 G84.3 X-0.1 28 | N26 #4=#5*COS[45] 29 | N27 #4=#5*SIN[45] 30 | N28 VZOFZ=652.9658 31 | % 32 | -------------------------------------------------------------------------------- /test/detect/gml/default.txt: -------------------------------------------------------------------------------- 1 | /// @description Collision code 2 | // standard collision handling 3 | 4 | // Horizontal collisions 5 | if(place_meeting(x+hspd, y, obj_wall)) { 6 | while(!place_meeting(x+sign(hspd), y, obj_wall)) { 7 | x += sign(hspd); 8 | } 9 | hspd = 0; 10 | } 11 | x += hspd; 12 | 13 | // Vertical collisions 14 | if(place_meeting(x, y+vspd, collide_obj)) { 15 | while(!place_meeting(x, y+sign(vspd), collide_obj)) { 16 | y += sign(vspd); 17 | } 18 | vspd = 0; 19 | } 20 | y += vspd; 21 | 22 | show_debug_message("This is a test"); -------------------------------------------------------------------------------- /test/detect/go/default.txt: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | ch := make(chan float64) 7 | ch <- 1.0e10 // magic number 8 | x, ok := <- ch 9 | defer fmt.Println(`exitting now\`) 10 | go println(len("hello world!")) 11 | return 12 | } 13 | -------------------------------------------------------------------------------- /test/detect/go/swift-like.txt: -------------------------------------------------------------------------------- 1 | func makeRequest(method string, url string, cb func(error, io.ReadCloser)) { 2 | req, _ := http.NewRequest(method, url, nil) 3 | resp, err := http.DefaultClient.Do(req) 4 | if err != nil { 5 | cb(err, nil) 6 | } else { 7 | cb(err, resp.Body) 8 | } 9 | } 10 | func main() { 11 | makeRequest("GET", "http://ipinfo.io/json", func(err error, body io.ReadCloser) { 12 | defer body.Close() 13 | io.Copy(os.Stdout, body) 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /test/detect/golo/default.txt: -------------------------------------------------------------------------------- 1 | module hello 2 | 3 | function dyno = -> DynamicObject() 4 | 5 | struct human = { name } 6 | 7 | @annotated 8 | function main = |args| { 9 | let a = 1 10 | var b = 2 11 | 12 | println("hello") 13 | 14 | let john = human("John Doe") 15 | } 16 | -------------------------------------------------------------------------------- /test/detect/haml/default.txt: -------------------------------------------------------------------------------- 1 | !!! XML 2 | %html 3 | %body 4 | %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js 5 | /html comment 6 | -# ignore this line 7 | %ul(style='margin: 0') 8 | -items.each do |i| 9 | %i= i 10 | = variable 11 | =variable2 12 | ~ variable3 13 | ~variable4 14 | The current year is #{DataTime.now.year}. 15 | -------------------------------------------------------------------------------- /test/detect/handlebars/default.txt: -------------------------------------------------------------------------------- 1 |
2 | {{!-- only show if author exists --}} 3 | {{#if author}} 4 |

{{firstName}} {{lastName}}

5 | {{/if}} 6 |
7 | -------------------------------------------------------------------------------- /test/detect/hsp/default.txt: -------------------------------------------------------------------------------- 1 | #include "foo.hsp" 2 | 3 | // line comment 4 | message = "Hello, World!" 5 | message2 = {"Multi 6 | line 7 | string"} 8 | num = 0 9 | mes message 10 | 11 | input num : button "sqrt", *label 12 | stop 13 | 14 | *label 15 | /* 16 | block comment 17 | */ 18 | if(num >= 0) { 19 | dialog "sqrt(" + num + ") = " + sqrt(num) 20 | } else { 21 | dialog "error", 1 22 | } 23 | stop 24 | -------------------------------------------------------------------------------- /test/detect/htmlbars/default.txt: -------------------------------------------------------------------------------- 1 |
2 | {{!-- only output this author names if an author exists --}} 3 | {{#if author}} 4 | {{#playwright-wrapper playwright=author action=(mut author) as |playwright|}} 5 |

{{playwright.firstName}} {{playwright.lastName}}

6 | {{/playwright-wrapper}} 7 | {{/if}} 8 | {{yield}} 9 |
10 | -------------------------------------------------------------------------------- /test/detect/http/default.txt: -------------------------------------------------------------------------------- 1 | POST /task?id=1 HTTP/1.1 2 | Host: example.org 3 | Content-Type: application/json; charset=utf-8 4 | Content-Length: 137 5 | 6 | { 7 | "status": "ok", 8 | "extended": true, 9 | "results": [ 10 | {"value": 0, "type": "int64"}, 11 | {"value": 1.0e+3, "type": "decimal"} 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /test/detect/ini/default.txt: -------------------------------------------------------------------------------- 1 | ; boilerplate 2 | [package] 3 | name = "some_name" 4 | authors = ["Author"] 5 | description = "This is \ 6 | a description" 7 | 8 | [[lib]] 9 | name = ${NAME} 10 | default = True 11 | auto = no 12 | counter = 1_000 13 | -------------------------------------------------------------------------------- /test/detect/java/default.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @author John Smith 3 | */ 4 | package l2f.gameserver.model; 5 | 6 | public abstract strictfp class L2Char extends L2Object { 7 | public static final Short ERROR = 0x0001; 8 | 9 | public void moveTo(int x, int y, int z) { 10 | _ai = null; 11 | log("Should not be called"); 12 | if (1 > 5) { // wtf!? 13 | return; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/detect/javascript/default.txt: -------------------------------------------------------------------------------- 1 | function $initHighlight(block, cls) { 2 | try { 3 | if (cls.search(/\bno\-highlight\b/) != -1) 4 | return process(block, true, 0x0F) + 5 | ` class="${cls}"`; 6 | } catch (e) { 7 | /* handle exception */ 8 | } 9 | for (var i = 0 / 2; i < classes.length; i++) { 10 | if (checkCondition(classes[i]) === undefined) 11 | console.log('undefined'); 12 | } 13 | 14 | return ( 15 |
16 | {block} 17 |
18 | ) 19 | } 20 | 21 | export $initHighlight; 22 | -------------------------------------------------------------------------------- /test/detect/javascript/sample1.txt: -------------------------------------------------------------------------------- 1 | // This was mis-detected as HSP and Perl because parsing of 2 | // keywords in those languages allowed adjacent dots 3 | 4 | window.requestAnimationFrame(function render() { 5 | var pos = state.pos; 6 | 7 | canvasEl.width = 500; 8 | canvasEl.height = 300; 9 | 10 | if (dpad.right) { 11 | pos.x += 3; 12 | } else if (dpad.left) { 13 | pos.x -= 3; 14 | } 15 | 16 | ctx.fillStyle = '#AF8452'; 17 | ctx.fillRect(pos.x + 5, pos.y - 10, 10, 10); 18 | 19 | window.requestAnimationFrame(render); 20 | }); 21 | -------------------------------------------------------------------------------- /test/detect/javascript/short-plain.txt: -------------------------------------------------------------------------------- 1 | const cluster = require('cluster'); 2 | const numCPUs = require('os').cpus().length; 3 | 4 | if (cluster.isMaster) { 5 | for (var i = 0; i < numCPUs; i++) { 6 | cluster.fork(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/detect/json/default.txt: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "apples", 4 | "count": [12000, 20000], 5 | "description": {"text": "...", "sensitive": false} 6 | }, 7 | { 8 | "title": "oranges", 9 | "count": [17500, null], 10 | "description": {"text": "...", "sensitive": false} 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /test/detect/kotlin/default.txt: -------------------------------------------------------------------------------- 1 | import kotlin.lang.test 2 | 3 | trait A { 4 | fun x() 5 | } 6 | 7 | fun xxx() : Int { 8 | return 888 9 | } 10 | 11 | public fun main(args : Array) { 12 | } 13 | -------------------------------------------------------------------------------- /test/detect/latex/default.txt: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage[koi8-r]{inputenc} 3 | \hoffset=0pt 4 | \voffset=.3em 5 | \tolerance=400 6 | \newcommand{\eTiX}{\TeX} 7 | \begin{document} 8 | \section*{Highlight.js} 9 | \begin{table}[c|c] 10 | $\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $ 11 | \end{table} 12 | Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b 13 | G\"otterd\"ammerung~45\%=34. 14 | $$ 15 | \int\limits_{0}^{\pi}\frac{4}{x-7}=3 16 | $$ 17 | \end{document} 18 | -------------------------------------------------------------------------------- /test/detect/leaf/default.txt: -------------------------------------------------------------------------------- 1 | #empty(friends) { 2 | Try adding some friends! 3 | } ##loop(friends, "friend") { 4 |
  • #(friend.name)
  • 5 | } 6 | 7 | #someTag(parameter.list, goes, "here") { 8 | This is an optional body here 9 | } 10 | 11 | #index(friends, "0") { 12 | Hello, #(self)! 13 | } ##else() { 14 | Nobody's there! 15 | } 16 | 17 | #() 18 | 19 | #raw() { 20 |
  • Hello
  • 21 | } 22 | -------------------------------------------------------------------------------- /test/detect/lisp/default.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env csi 2 | 3 | (defun prompt-for-cd () 4 | "Prompts 5 | for CD" 6 | (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6)) 7 | (prompt-read "Artist" &rest) 8 | (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0) 9 | (if x (format t "yes") (format t "no" nil) ;and here comment 10 | ) 11 | ;; second line comment 12 | '(+ 1 2) 13 | (defvar *lines*) ; list of all lines 14 | (position-if-not #'sys::whitespacep line :start beg)) 15 | (quote (privet 1 2 3)) 16 | '(hello world) 17 | (* 5 7) 18 | (1 2 34 5) 19 | (:use "aaaa") 20 | (let ((x 10) (y 20)) 21 | (print (+ x y)) 22 | ) -------------------------------------------------------------------------------- /test/detect/livecodeserver/default.txt: -------------------------------------------------------------------------------- 1 | 2000000000 then 21 | put "Welcome to the future!" 22 | else 23 | return "something" 24 | end if 25 | end myFunction 26 | 27 | 28 | --| END OF blog.lc 29 | --| Location: ./system/application/controllers/blog.lc 30 | ---------------------------------------------------------------------- 31 | -------------------------------------------------------------------------------- /test/detect/lsl/default.txt: -------------------------------------------------------------------------------- 1 | default 2 | { 3 | state_entry() 4 | { 5 | llSay(PUBLIC_CHANNEL, "Hello, Avatar!"); 6 | } 7 | 8 | touch_start(integer num_detected) 9 | { 10 | llSay(PUBLIC_CHANNEL, "Touched."); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/detect/makefile/default.txt: -------------------------------------------------------------------------------- 1 | # Makefile 2 | 3 | BUILDDIR = _build 4 | EXTRAS ?= $(BUILDDIR)/extras 5 | 6 | .PHONY: main clean 7 | 8 | main: 9 | @echo "Building main facility..." 10 | build_main $(BUILDDIR) 11 | 12 | clean: 13 | rm -rf $(BUILDDIR)/* 14 | -------------------------------------------------------------------------------- /test/detect/markdown/default.txt: -------------------------------------------------------------------------------- 1 | # hello world 2 | 3 | you can write text [with links](http://example.com) inline or [link references][1]. 4 | 5 | * one _thing_ has *em*phasis 6 | * two __things__ are **bold** 7 | 8 | [1]: http://example.com 9 | 10 | --- 11 | 12 | hello world 13 | =========== 14 | 15 | 16 | 17 | > markdown is so cool 18 | 19 | so are code segments 20 | 21 | 1. one thing (yeah!) 22 | 2. two thing `i can write code`, and `more` wipee! 23 | 24 | -------------------------------------------------------------------------------- /test/detect/mathematica/default.txt: -------------------------------------------------------------------------------- 1 | (* ::Package:: *) 2 | 3 | (* Mathematica Package *) 4 | 5 | BeginPackage["SomePkg`"] 6 | 7 | Begin["`Private`"] 8 | 9 | SomeFn[ns_List] := Fold[Function[{x, y}, x + y], 0, Map[# * 2 &, ns]]; 10 | Print[$ActivationKey]; 11 | 12 | End[] (* End Private Context *) 13 | 14 | EndPackage[] 15 | -------------------------------------------------------------------------------- /test/detect/mel/default.txt: -------------------------------------------------------------------------------- 1 | proc string[] getSelectedLights() 2 | 3 | { 4 | string $selectedLights[]; 5 | 6 | string $select[] = `ls -sl -dag -leaf`; 7 | 8 | for ( $shape in $select ) 9 | { 10 | // Determine if this is a light. 11 | // 12 | string $class[] = getClassification( `nodeType $shape` ); 13 | 14 | 15 | if ( ( `size $class` ) > 0 && ( "light" == $class[0] ) ) 16 | { 17 | $selectedLights[ `size $selectedLights` ] = $shape; 18 | } 19 | } 20 | 21 | // Result is an array of all lights included in 22 | 23 | // current selection list. 24 | return $selectedLights; 25 | } 26 | -------------------------------------------------------------------------------- /test/detect/mercury/default.txt: -------------------------------------------------------------------------------- 1 | % "Hello World" in Mercury. 2 | :- module hello. 3 | 4 | 5 | :- interface. 6 | :- import_module io. 7 | 8 | :- pred main(io::di, io::uo) is det. 9 | 10 | 11 | :- implementation. 12 | 13 | main(!IO) :- 14 | io.write_string("Hello, world\n", !IO). 15 | 16 | :- pred filter(pred(T), list(T), list(T), list(T) ). 17 | :- mode filter(in(pred(in) is semidet), in, out, out ) is det. 18 | 19 | filter(_, [], [], []). 20 | filter(P, [X | Xs], Ys, Zs) :- 21 | filter(P, Xs, Ys0, Zs0), 22 | ( if P(X) then Ys = [X | Ys0], Zs = Zs0 23 | else Ys = Ys0 , Zs = [X | Zs0] 24 | ). 25 | -------------------------------------------------------------------------------- /test/detect/mipsasm/default.txt: -------------------------------------------------------------------------------- 1 | .text 2 | .global AckermannFunc 3 | 4 | # Preconditions: 5 | # 1st parameter ($a0) m 6 | # 2nd parameter ($a1) n 7 | # Postconditions: 8 | # result in ($v0) = value of A(m,n) 9 | 10 | AckermannFunc: 11 | addi $sp, $sp, -8 12 | sw $s0, 4($sp) 13 | sw $ra, 0($sp) 14 | 15 | # move the parameter registers to temporary - no, only when nec. 16 | 17 | LABEL_IF: bne $a0, $zero, LABEL_ELSE_IF 18 | 19 | addi $v0, $a1, 1 20 | 21 | # jump to LABEL_DONE 22 | j LABEL_DONE 23 | -------------------------------------------------------------------------------- /test/detect/n1ql/default.txt: -------------------------------------------------------------------------------- 1 | SELECT * 2 | FROM `beer-sample` 3 | WHERE brewery_id IS NOT MISSING AND type="beer" 4 | LIMIT 1; 5 | 6 | UPSERT INTO product (KEY, VALUE) VALUES ( 7 | "odwalla-juice1", { 8 | "productId": "odwalla-juice1", 9 | "unitPrice": 5.40, 10 | "type": "product", 11 | "color":"red" 12 | } 13 | ) RETURNING *; 14 | 15 | INFER `beer-sample` WITH { 16 | "sample_size": 10000, 17 | "num_sample_values": 1, 18 | "similarity_metric": 0.0 19 | }; 20 | -------------------------------------------------------------------------------- /test/detect/nim/default.txt: -------------------------------------------------------------------------------- 1 | import module1, module2, module3 2 | from module4 import nil 3 | 4 | type 5 | TFoo = object ## Doc comment 6 | a: int32 7 | PFoo = ref TFoo 8 | 9 | proc do_stuff314(param_1: TFoo, par2am: var PFoo): PFoo {.exportc: "dostuff" .} = 10 | # Regular comment 11 | discard """ 12 | dfag 13 | sdfg"" 14 | """ 15 | result = nil 16 | 17 | method abc(a: TFoo) = discard 1u32 + 0xabcdefABCDEFi32 + 0o01234567i8 + 0b010 18 | 19 | discard rawstring"asdf""adfa" 20 | var normalstring = "asdf" 21 | let a: uint32 = 0xFFaF'u32 22 | -------------------------------------------------------------------------------- /test/detect/nix/default.txt: -------------------------------------------------------------------------------- 1 | { stdenv, foo, bar ? false, ... }: 2 | 3 | /* 4 | * foo 5 | */ 6 | 7 | let 8 | a = 1; # just a comment 9 | b = null; 10 | c = toString 10; 11 | in stdenv.mkDerivation rec { 12 | name = "foo-${version}"; 13 | version = "1.3"; 14 | 15 | configureFlags = [ "--with-foo2" ] ++ stdenv.lib.optional bar "--with-foo=${ with stdenv.lib; foo }" 16 | 17 | postInstall = '' 18 | ${ if true then "--${test}" else false } 19 | ''; 20 | 21 | meta = with stdenv.lib; { 22 | homepage = https://nixos.org; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /test/detect/objectivec/default.txt: -------------------------------------------------------------------------------- 1 | #import 2 | #import "Dependency.h" 3 | 4 | @protocol WorldDataSource 5 | @optional 6 | - (NSString*)worldName; 7 | @required 8 | - (BOOL)allowsToLive; 9 | @end 10 | 11 | @property (nonatomic, readonly) NSString *title; 12 | - (IBAction) show; 13 | @end 14 | -------------------------------------------------------------------------------- /test/detect/openscad/default.txt: -------------------------------------------------------------------------------- 1 | use 2 | include <../common/base.scad> 3 | 4 | //draw a foobar 5 | module foobar(){ 6 | translate([0,-10,0]) 7 | difference(){ 8 | cube([5,10.04,15]); 9 | sphere(r=10,$fn=100); 10 | } 11 | } 12 | 13 | foobar(); 14 | #cube ([5,5,5]); 15 | echo("done"); -------------------------------------------------------------------------------- /test/detect/pgsql/default.txt: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | SELECT sum(salary) OVER w, avg(salary) OVER w 3 | FROM empsalary 4 | WINDOW w AS (PARTITION BY depname ORDER BY salary DESC); 5 | END; 6 | 7 | CREATE FUNCTION days_of_week() RETURNS SETOF text AS $$ 8 | BEGIN 9 | FOR i IN 7 .. 13 LOOP 10 | RETURN NEXT to_char(to_date(i::text,'J'),'TMDy'); 11 | END LOOP; 12 | END; 13 | $$ STABLE LANGUAGE plpgsql; 14 | -------------------------------------------------------------------------------- /test/detect/plaintext/default.txt: -------------------------------------------------------------------------------- 1 | id | description 2 | ----+------------- 3 | 1 | one 4 | 2 | two 5 | 3 | three 6 | (3 rows) 7 | -------------------------------------------------------------------------------- /test/detect/pony/default.txt: -------------------------------------------------------------------------------- 1 | use "collections" 2 | 3 | class StopWatch 4 | """ 5 | A simple stopwatch class for performance micro-benchmarking 6 | """ 7 | var _s: U64 = 0 8 | 9 | fun delta(): U64 => 10 | Time.nanos() - _s 11 | 12 | actor LonelyPony 13 | """ 14 | A simple manifestation of the lonely pony problem 15 | """ 16 | var env: Env 17 | let sw: StopWatch = StopWatch 18 | 19 | new create(env': Env) => 20 | env = env 21 | -------------------------------------------------------------------------------- /test/detect/powershell/default.txt: -------------------------------------------------------------------------------- 1 | $initialDate = [datetime]'2013/1/8' 2 | 3 | $rollingDate = $initialDate 4 | 5 | do { 6 | $client = New-Object System.Net.WebClient 7 | $results = $client.DownloadString("http://not.a.real.url") 8 | Write-Host "$rollingDate.ToShortDateString() - $results" 9 | $rollingDate = $rollingDate.AddDays(21) 10 | $username = [System.Environment]::UserName 11 | } until ($rollingDate -ge [datetime]'2013/12/31') 12 | -------------------------------------------------------------------------------- /test/detect/processing/default.txt: -------------------------------------------------------------------------------- 1 | import java.util.LinkedList; 2 | import java.awt.Point; 3 | 4 | PGraphics pg; 5 | String load; 6 | 7 | void setup() { 8 | size(displayWidth, displayHeight, P3D); 9 | pg = createGraphics(displayWidth*2,displayHeight,P2D); 10 | pg.beginDraw(); 11 | pg.background(255,255,255); 12 | //pg.smooth(8); 13 | pg.endDraw(); 14 | } 15 | void draw(){ 16 | background(255); 17 | } 18 | -------------------------------------------------------------------------------- /test/detect/profile/default.txt: -------------------------------------------------------------------------------- 1 | 261917242 function calls in 686.251 CPU seconds 2 | 3 | ncalls tottime filename:lineno(function) 4 | 152824 513.894 {method 'sort' of 'list' objects} 5 | 129590630 83.894 rrule.py:842(__cmp__) 6 | 129590630 82.439 {cmp} 7 | 153900 1.296 rrule.py:399(_iter) 8 | 304393/151570 0.963 rrule.py:102(_iter_cached) 9 | -------------------------------------------------------------------------------- /test/detect/prolog/default.txt: -------------------------------------------------------------------------------- 1 | mergesort([],[]). % special case 2 | mergesort([A],[A]). 3 | mergesort([A,B|R],S) :- 4 | split([A,B|R],L1,L2), 5 | mergesort(L1,S1), 6 | mergesort(L2,S2), 7 | merge(S1,S2,S). 8 | 9 | split([],[],[]). 10 | split([A],[A],[]). 11 | split([A,B|R],[A|Ra],[B|Rb]) :- split(R,Ra,Rb). 12 | -------------------------------------------------------------------------------- /test/detect/properties/default.txt: -------------------------------------------------------------------------------- 1 | # .properties 2 | ! Exclamation mark = comments, too 3 | 4 | key1 = value1 5 | key2 : value2 6 | key3 value3 7 | key\ spaces multiline\ 8 | value4 9 | empty_key 10 | ! Key can contain escaped chars 11 | \:\= = value5 12 | -------------------------------------------------------------------------------- /test/detect/protobuf/default.txt: -------------------------------------------------------------------------------- 1 | package languages.protobuf; 2 | 3 | option java_package = "org.highlightjs.languages.protobuf"; 4 | 5 | message Customer { 6 | required int64 customer_id = 1; 7 | optional string name = 2; 8 | optional string real_name = 3 [default = "Anonymous"]; 9 | optional Gender gender = 4; 10 | repeated string email_addresses = 5; 11 | 12 | optional bool is_admin = 6 [default = false]; // or should this be a repeated field in Account? 13 | 14 | enum Gender { 15 | MALE = 1, 16 | FEMALE = 2 17 | } 18 | } 19 | 20 | service CustomerSearch { 21 | rpc FirstMatch(CustomerRequest) returns (CustomerResponse); 22 | rpc AllMatches(CustomerRequest) returns (CustomerResponse); 23 | } 24 | -------------------------------------------------------------------------------- /test/detect/python-repl/default.txt: -------------------------------------------------------------------------------- 1 | >>> v = "foo = 42" 2 | >>> v 3 | "foo = 42" 4 | >>> print(v) 5 | foo = 42 6 | >>> print(repr(v).rstrip('"')) 7 | "foo = 42 8 | >>> print(repr(v).lstrip('"')) 9 | foo = 42" 10 | 11 | >>> """ 12 | ... abc 13 | ... """ 14 | >>> def test(): 15 | ... pass 16 | -------------------------------------------------------------------------------- /test/detect/python/default.txt: -------------------------------------------------------------------------------- 1 | @requires_authorization 2 | def somefunc(param1='', param2=0): 3 | r'''A docstring''' 4 | if param1 > param2: # interesting 5 | print 'Gre\'ater' 6 | return (param2 - param1 + 1 + 0b10l) or None 7 | 8 | class SomeClass: 9 | pass 10 | 11 | >>> message = '''interpreter 12 | ... prompt''' 13 | -------------------------------------------------------------------------------- /test/detect/q/default.txt: -------------------------------------------------------------------------------- 1 | select time, price by date,stock from quote where price=(max;price)fby stock 2 | data:raze value flip trade 3 | select vwap:size wavg price by 5 xbar time.minute from aapl where date within (.z.d-10;.z.d) 4 | f1:{[x;y;z] show (x;y+z);sum 1 2 3} 5 | .z.pc:{[handle] show -3!(`long$.z.p;"Closed";handle)} 6 | // random normal distribution, e.g. nor 10 7 | nor:{$[x=2*n:x div 2;raze sqrt[-2*log n?1f]*/:(sin;cos)@\:(2*pi)*n?1f;-1_.z.s 1+x]} 8 | 9 | mode:{where g=max g:count each group x} // mode function -------------------------------------------------------------------------------- /test/detect/rsl/default.txt: -------------------------------------------------------------------------------- 1 | #define TEST_DEFINE 3.14 2 | /* plastic surface shader 3 | * 4 | * Pixie is: 5 | * (c) Copyright 1999-2003 Okan Arikan. All rights reserved. 6 | */ 7 | 8 | surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1; 9 | color specularcolor = 1;) { 10 | normal Nf = faceforward (normalize(N),I); 11 | Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks * 12 | specular(Nf,-normalize(I),roughness); 13 | Oi = Os; 14 | Ci *= Oi; 15 | } 16 | -------------------------------------------------------------------------------- /test/detect/ruby/default.txt: -------------------------------------------------------------------------------- 1 | # The Greeter class 2 | class Greeter 3 | def initialize(name) 4 | @name = name.capitalize 5 | end 6 | 7 | def salute 8 | puts "Hello #{@name}!" 9 | end 10 | end 11 | 12 | g = Greeter.new("world") 13 | g.salute 14 | -------------------------------------------------------------------------------- /test/detect/ruby/double-colon.txt: -------------------------------------------------------------------------------- 1 | def f(a = self.attr) 2 | A::B.new(a) 3 | end 4 | -------------------------------------------------------------------------------- /test/detect/rust/default.txt: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | pub enum State { 3 | Start, 4 | Transient, 5 | Closed, 6 | } 7 | 8 | impl From<&'a str> for State { 9 | fn from(s: &'a str) -> Self { 10 | match s { 11 | "start" => State::Start, 12 | "closed" => State::Closed, 13 | _ => unreachable!(), 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/detect/scilab/default.txt: -------------------------------------------------------------------------------- 1 | // A comment 2 | function I = foo(dims, varargin) 3 | d=[1; matrix(dims(1:$-1),-1,1)] 4 | for i=1:size(varargin) 5 | if varargin(i)==[] then 6 | I=[], 7 | return; 8 | end 9 | end 10 | endfunction 11 | 12 | b = cos(a) + cosh(a); 13 | bar_matrix = [ "Hello", "world" ]; 14 | foo_matrix = [1, 2, 3; 4, 5, 6]; 15 | -------------------------------------------------------------------------------- /test/detect/shell/default.txt: -------------------------------------------------------------------------------- 1 | $ echo $EDITOR 2 | vim 3 | $ git checkout master 4 | Switched to branch 'master' 5 | Your branch is up-to-date with 'origin/master'. 6 | $ git push 7 | Everything up-to-date 8 | $ echo 'All 9 | > done!' 10 | All 11 | done! 12 | -------------------------------------------------------------------------------- /test/detect/sml/default.txt: -------------------------------------------------------------------------------- 1 | structure List : LIST = 2 | struct 3 | 4 | val op + = InlineT.DfltInt.+ 5 | 6 | datatype list = datatype list 7 | 8 | exception Empty = Empty 9 | 10 | fun last [] = raise Empty 11 | | last [x] = x 12 | | last (_::r) = last r 13 | 14 | fun loop ([], []) = EQUAL 15 | | loop ([], _) = LESS 16 | | loop (_, []) = GREATER 17 | | loop (x :: xs, y :: ys) = 18 | (case compare (x, y) of 19 | EQUAL => loop (xs, ys) 20 | | unequal => unequal) 21 | in 22 | loop 23 | end 24 | 25 | end (* structure List *) 26 | 27 | -------------------------------------------------------------------------------- /test/detect/sqf/default.txt: -------------------------------------------------------------------------------- 1 | /*** 2 | Arma Scripting File 3 | Edition: 1.66 4 | ***/ 5 | 6 | // Enable eating to improve health. 7 | _unit addAction ["Eat Energy Bar", { 8 | if (_this getVariable ["EB_NumActivation", 0] > 0) then { 9 | _this setDamage (0 max (damage _this - 0.25)); 10 | } else { 11 | hint "You have eaten it all"; 12 | }; 13 | // 4 - means something... 14 | Z_obj_vip = nil; 15 | [_boat, ["Black", 1], true] call BIS_fnc_initVehicle; 16 | }]; 17 | -------------------------------------------------------------------------------- /test/detect/sql/default.txt: -------------------------------------------------------------------------------- 1 | CREATE TABLE "topic" ( 2 | "id" serial NOT NULL PRIMARY KEY, 3 | "forum_id" integer NOT NULL, 4 | "subject" varchar(255) NOT NULL 5 | ); 6 | ALTER TABLE "topic" 7 | ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id") 8 | REFERENCES "forum" ("id"); 9 | 10 | -- Initials 11 | insert into "topic" ("forum_id", "subject") 12 | values (2, 'D''artagnian'); 13 | -------------------------------------------------------------------------------- /test/detect/stylus/default.txt: -------------------------------------------------------------------------------- 1 | @import "nib" 2 | 3 | // variables 4 | $green = #008000 5 | $green_dark = darken($green, 10) 6 | 7 | // mixin/function 8 | container() 9 | max-width 980px 10 | 11 | // mixin/function with parameters 12 | buttonBG($color = green) 13 | if $color == green 14 | background-color #008000 15 | else if $color == red 16 | background-color #B22222 17 | 18 | button 19 | buttonBG(red) 20 | 21 | .blue-button 22 | buttonBG(blue) 23 | 24 | #content, .content 25 | font Tahoma, Chunkfive, sans-serif 26 | background url('hatch.png') 27 | color #F0F0F0 !important 28 | width 100% 29 | -------------------------------------------------------------------------------- /test/detect/swift/default.txt: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | @objc class Person: Entity { 4 | var name: String! 5 | var age: Int! 6 | 7 | init(name: String, age: Int) { 8 | /* /* ... */ */ 9 | } 10 | 11 | // Return a descriptive string for this person 12 | func description(offset: Int = 0) -> String { 13 | return "\(name) is \(age + offset) years old" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/detect/tcl/default.txt: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | source helper.tcl 4 | # randomness verified by a die throw 5 | set ::rand 4 6 | 7 | proc give::recursive::count {base p} { ; # 2 mandatory params 8 | while {$p > 0} { 9 | set result [expr $result * $base]; incr p -1 10 | } 11 | return $result 12 | } 13 | 14 | set a {a}; set b "bcdef"; set lst [list "item"] 15 | puts [llength $a$b] 16 | 17 | set ::my::tid($id) $::my::tid(def) 18 | lappend lst $arr($idx) $::my::arr($idx) $ar(key) 19 | lreplace ::my::tid($id) 4 4 20 | puts $::rand ${::rand} ${::AWESOME::component::variable} 21 | 22 | puts "$x + $y is\t [expr $x + $y]" 23 | 24 | proc isprime x { 25 | expr {$x>1 && ![regexp {^(oo+?)\1+$} [string repeat o $x]]} 26 | } 27 | -------------------------------------------------------------------------------- /test/detect/twig/default.txt: -------------------------------------------------------------------------------- 1 | {% if posts|length %} 2 | {% for article in articles %} 3 | <div> 4 | {{ article.title|upper() }} 5 | 6 | {# outputs 'WELCOME' #} 7 | </div> 8 | {% endfor %} 9 | {% endif %} 10 | 11 | {% set user = json_encode(user) %} 12 | 13 | {{ random(['apple', 'orange', 'citrus']) }} 14 | 15 | {{ include(template_from_string("Hello {{ name }}")) }} 16 | 17 | 18 | {# 19 | Comments may be long and multiline. 20 | Markup is <em>not</em> highlighted within comments. 21 | #} 22 | -------------------------------------------------------------------------------- /test/detect/typescript/default.txt: -------------------------------------------------------------------------------- 1 | class MyClass { 2 | public static myValue: string; 3 | constructor(init: string) { 4 | this.myValue = init; 5 | } 6 | } 7 | import fs = require("fs"); 8 | module MyModule { 9 | export interface MyInterface extends Other { 10 | myProperty: any; 11 | } 12 | } 13 | declare magicNumber number; 14 | myArray.forEach(() => { }); // fat arrow syntax 15 | -------------------------------------------------------------------------------- /test/detect/vbscript-html/default.txt: -------------------------------------------------------------------------------- 1 | 2 | <% 3 | If i < 10 Then 4 | response.write("Good morning!") 5 | End If 6 | %> 7 | 8 | -------------------------------------------------------------------------------- /test/detect/vim/default.txt: -------------------------------------------------------------------------------- 1 | if foo > 2 || has("gui_running") 2 | syntax on 3 | set hlsearch 4 | endif 5 | 6 | set autoindent 7 | 8 | " switch on highlighting 9 | function UnComment(fl, ll) 10 | while idx >= a:ll 11 | let srclines=getline(idx) 12 | let dstlines=substitute(srclines, b:comment, "", "") 13 | call setline(idx, dstlines) 14 | endwhile 15 | endfunction 16 | 17 | let conf = {'command': 'git'} 18 | -------------------------------------------------------------------------------- /test/detect/xml/default.txt: -------------------------------------------------------------------------------- 1 | 2 | Title 3 | 4 | 5 | 6 | 9 | 10 | 11 |

    Title

    12 | 13 | 14 | -------------------------------------------------------------------------------- /test/detect/xml/groovy-julia.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /test/detect/xml/js.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/detect/yaml/default.txt: -------------------------------------------------------------------------------- 1 | --- 2 | # comment 3 | string_1: "Bar" 4 | string_2: 'bar' 5 | string_3: bar 6 | inline_keys_ignored: sompath/name/file.jpg 7 | keywords_in_yaml: 8 | - true 9 | - false 10 | - TRUE 11 | - FALSE 12 | - 21 13 | - 21.0 14 | - !!str 123 15 | "quoted_key": &foobar 16 | bar: foo 17 | foo: 18 | "foo": bar 19 | 20 | reference: *foobar 21 | 22 | multiline_1: | 23 | Multiline 24 | String 25 | multiline_2: > 26 | Multiline 27 | String 28 | multiline_3: " 29 | Multiline string 30 | " 31 | 32 | ansible_variables: "foo {{variable}}" 33 | 34 | array_nested: 35 | - a 36 | - b: 1 37 | c: 2 38 | - b 39 | - comment 40 | -------------------------------------------------------------------------------- /test/fixtures/expect/brInPre.txt: -------------------------------------------------------------------------------- 1 | >> '\x41\x42\x43'
    'ABC'


    >> '\x61\x62\x63'
    'abc' 2 | -------------------------------------------------------------------------------- /test/fixtures/expect/custommarkup.txt: -------------------------------------------------------------------------------- 1 | <div id="contents"> 2 | <p>Hello, World!Goodbye, cruel world! 3 | </div> 4 | -------------------------------------------------------------------------------- /test/fixtures/expect/customtabreplace.txt: -------------------------------------------------------------------------------- 1 | for x in [1, 2, 3]: 2 | count(x) 3 | if x == 3: 4 | count(x + 1) -------------------------------------------------------------------------------- /test/fixtures/expect/endsWithParentVariants.txt: -------------------------------------------------------------------------------- 1 | ( [ ( ) ] ) 2 | -------------------------------------------------------------------------------- /test/fixtures/expect/explicit1.txt: -------------------------------------------------------------------------------- 1 | for x in [1, 2, 3]: 2 | count(x) -------------------------------------------------------------------------------- /test/fixtures/expect/explicit2.txt: -------------------------------------------------------------------------------- 1 | @import "compass/reset"; 2 | $colorGreenDark: darken($colorGreen, 10); 3 | -------------------------------------------------------------------------------- /test/fixtures/expect/languagealias.txt: -------------------------------------------------------------------------------- 1 | var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>'; -------------------------------------------------------------------------------- /test/fixtures/expect/sublanguages.txt: -------------------------------------------------------------------------------- 1 | <? echo 'php'; /* ?> */ ?> 2 | <body> 3 | <script>document.write('Legacy code');</script> 4 | </body> 5 | -------------------------------------------------------------------------------- /test/fixtures/expect/tabreplace.txt: -------------------------------------------------------------------------------- 1 | for x in [1, 2, 3]: 2 | count(x) -------------------------------------------------------------------------------- /test/fixtures/expect/useBr.txt: -------------------------------------------------------------------------------- 1 | <head>
    <meta charset="utf-8">
    <title></title>
    </head> 2 | -------------------------------------------------------------------------------- /test/fixtures/nested.js: -------------------------------------------------------------------------------- 1 | module.exports = function(hljs) { 2 | var BODY = { 3 | className: 'body', endsWithParent: true 4 | }; 5 | var LIST = { 6 | className: 'list', 7 | variants: [ 8 | {begin: /\(/, end: /\)/}, 9 | {begin: /\[/, end: /\]/} 10 | ], 11 | contains: [BODY] 12 | }; 13 | BODY.contains = [LIST]; 14 | return { 15 | disableAutodetect: true, 16 | contains: [LIST] 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /test/markup/abnf/default.txt: -------------------------------------------------------------------------------- 1 | ; line comment 2 | 3 | ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment 4 | 5 | group1 = alt1 6 | group1 =/ alt2 7 | 8 | alt1 = %x41-4D / %d78-90 9 | 10 | alt2 = %b00100001 11 | 12 | group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET 13 | a 14 | optional = hex-codes 15 | / literal 16 | / sensitive 17 | / insensitive 18 | 19 | hex-codes = %x68.65.6C.6C.6F 20 | literal = "string literal" 21 | sensitive = %s"case-sensitive string" 22 | insensitive = %i"case-insensitive string" 23 | -------------------------------------------------------------------------------- /test/markup/accesslog/default.txt: -------------------------------------------------------------------------------- 1 | 20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" 2 | 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 3 | 192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395 4 | 127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587 5 | 66.249.78.17 – – [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" 6 | -------------------------------------------------------------------------------- /test/markup/actionscript/method-call.expect.txt: -------------------------------------------------------------------------------- 1 | x.get(0); 2 | -------------------------------------------------------------------------------- /test/markup/actionscript/method-call.txt: -------------------------------------------------------------------------------- 1 | x.get(0); 2 | -------------------------------------------------------------------------------- /test/markup/arcade/profile.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Isolated test for the most recent version 3 | */ 4 | function offsetPopulation(offset){ 5 | var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); 6 | var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); 7 | var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); 8 | return popDensity; 9 | } 10 | -------------------------------------------------------------------------------- /test/markup/armasm/default.txt: -------------------------------------------------------------------------------- 1 | //=================== YOUR CODE GOES HERE ===================// 2 | 3 | # logical operator demo (highlight.js arm comment test) 4 | mov r0, #0x00F0 // r0 = 0x00F0 5 | mov r1, #0x000F // r1 = 0x000F 6 | mov r2, #0xFF00 // r2 = 0xFF00 7 | 8 | # and even more code, but indented 9 | orr r3, r0, r1 // r3 = r0 | r1 // r3 = 0x00FF 10 | and r4, r3, r2 // r4 = r3 & r2 // r4 = 0x0000 11 | orr r5, r3, r2 // r4 = r3 | r2 // r5 = 0xFFFF 12 | eor r6, r5, r2 // r6 = r5 ^ r2 // r6 = 0x00FF 13 | //===========================================================================// 14 | -------------------------------------------------------------------------------- /test/markup/aspectj/intertype-constructor.expect.txt: -------------------------------------------------------------------------------- 1 | public MyClass.new() throws Exception{ 2 | // intertype constructor body 3 | } 4 | -------------------------------------------------------------------------------- /test/markup/aspectj/intertype-constructor.txt: -------------------------------------------------------------------------------- 1 | public MyClass.new() throws Exception{ 2 | // intertype constructor body 3 | } 4 | -------------------------------------------------------------------------------- /test/markup/aspectj/intertype-method.expect.txt: -------------------------------------------------------------------------------- 1 | public void MyClass.doSomething() throws Exception{ 2 | // intertype method body 3 | } 4 | public void A.doSomething(int param1){ 5 | // intertype method body 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/aspectj/intertype-method.txt: -------------------------------------------------------------------------------- 1 | public void MyClass.doSomething() throws Exception{ 2 | // intertype method body 3 | } 4 | public void A.doSomething(int param1){ 5 | // intertype method body 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/bash/escaped-quote.expect.txt: -------------------------------------------------------------------------------- 1 | # Escaped double-quote is not a string 2 | echo '"quoted"' | tr -d \" > text.txt 3 | -------------------------------------------------------------------------------- /test/markup/bash/escaped-quote.txt: -------------------------------------------------------------------------------- 1 | # Escaped double-quote is not a string 2 | echo '"quoted"' | tr -d \" > text.txt 3 | -------------------------------------------------------------------------------- /test/markup/bash/no-numbers.expect.txt: -------------------------------------------------------------------------------- 1 | # numbers aren't highlighted in bash as their semantics is 2 | # not strictly defined for command line parameters 3 | $ tail -10 access.log 4 | -------------------------------------------------------------------------------- /test/markup/bash/no-numbers.txt: -------------------------------------------------------------------------------- 1 | # numbers aren't highlighted in bash as their semantics is 2 | # not strictly defined for command line parameters 3 | $ tail -10 access.log 4 | -------------------------------------------------------------------------------- /test/markup/ceylon/nested-comments.expect.txt: -------------------------------------------------------------------------------- 1 | /* 2 | /* 3 | Ceylon has nested comments. 4 | */ 5 | */ 6 | -------------------------------------------------------------------------------- /test/markup/ceylon/nested-comments.txt: -------------------------------------------------------------------------------- 1 | /* 2 | /* 3 | Ceylon has nested comments. 4 | */ 5 | */ 6 | -------------------------------------------------------------------------------- /test/markup/clojure-repl/prompt.expect.txt: -------------------------------------------------------------------------------- 1 | user=> 2 | => 3 | -------------------------------------------------------------------------------- /test/markup/clojure-repl/prompt.txt: -------------------------------------------------------------------------------- 1 | user=> 2 | => 3 | -------------------------------------------------------------------------------- /test/markup/clojure/symbols-numbers.expect.txt: -------------------------------------------------------------------------------- 1 | (def +x [(a 1) +2 -3.0 y-5]) 2 | -------------------------------------------------------------------------------- /test/markup/clojure/symbols-numbers.txt: -------------------------------------------------------------------------------- 1 | (def +x [(a 1) +2 -3.0 y-5]) 2 | -------------------------------------------------------------------------------- /test/markup/coffeescript/division.expect.txt: -------------------------------------------------------------------------------- 1 | # Divisions 2 | x = 6/foo/i 3 | x = 6 /foo 4 | x = 6 / foo 5 | x = 6 /foo * 2/gm 6 | x = f /foo 7 | x = f / foo / gm 8 | x = f /foo * 2/6 9 | -------------------------------------------------------------------------------- /test/markup/coffeescript/division.txt: -------------------------------------------------------------------------------- 1 | # Divisions 2 | x = 6/foo/i 3 | x = 6 /foo 4 | x = 6 / foo 5 | x = 6 /foo * 2/gm 6 | x = f /foo 7 | x = f / foo / gm 8 | x = f /foo * 2/6 9 | -------------------------------------------------------------------------------- /test/markup/coffeescript/function.txt: -------------------------------------------------------------------------------- 1 | returnNull = -> null 2 | returnTrue = () -> true 3 | square = (x) -> x * x 4 | 5 | npmWishlist.sha256 = (str) -> 6 | throw new Error() 7 | 8 | str.split(" ").map((m) -> m.charCodeAt(0)) 9 | 10 | fs.readFile("package.json", "utf-8", (err, content) -> 11 | data = JSON.parse(content) 12 | 13 | data.version 14 | ) 15 | -------------------------------------------------------------------------------- /test/markup/coffeescript/regex.txt: -------------------------------------------------------------------------------- 1 | # Regexps 2 | x = // 3 | x = (//) 4 | x = (/test/) 5 | x = //mig 6 | x = //gim 7 | x = /something/gim 8 | x = /\// 9 | x = /\n/ 10 | x = /ab\/ ab/ 11 | x = f /6 * 2/ - 3 12 | x = f /foo * 2/gm 13 | x = if true then /\n/ else /[.,]+/ 14 | x = ///^key-#{key}-\d+/// 15 | 16 | # not a Regexp 17 | x = //test 18 | x = /boo/test 19 | -------------------------------------------------------------------------------- /test/markup/cos/basic.txt: -------------------------------------------------------------------------------- 1 | SET test = 1 2 | set ^global = 2 3 | Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 4 | if (^global = 2) { 5 | do ##class(Cinema.Utils).AddShow("test") // line comment 6 | } 7 | d:(^global = 2) ..thisClassMethod(1, 2, "test") 8 | -------------------------------------------------------------------------------- /test/markup/cos/embedded.expect.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Multiline comment 3 | */ 4 | &sql(SELECT * FROM Cinema.Film WHERE Length > 2) 5 | &js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }> 6 | -------------------------------------------------------------------------------- /test/markup/cos/embedded.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * Multiline comment 3 | */ 4 | &sql(SELECT * FROM Cinema.Film WHERE Length > 2) 5 | &js 6 | -------------------------------------------------------------------------------- /test/markup/cpp/expression-keywords.expect.txt: -------------------------------------------------------------------------------- 1 | double x = exp(log(2)); // recognize built-ins 2 | return 0; // recognize keyword that started the expression 3 | -------------------------------------------------------------------------------- /test/markup/cpp/expression-keywords.txt: -------------------------------------------------------------------------------- 1 | double x = exp(log(2)); // recognize built-ins 2 | return 0; // recognize keyword that started the expression 3 | -------------------------------------------------------------------------------- /test/markup/cpp/function-declarations.txt: -------------------------------------------------------------------------------- 1 | decltype(auto) look_up_a_string_1() { return lookup1(); } 2 | void look_up_a_string_2() { return lookup2(); } 3 | friend void A::showB(B x) {} 4 | friend void showB(B x) {} 5 | friend void showB(B::SomeType x) {} 6 | inline int add(int a, int b) {} 7 | int8t Get_Tile_Value() {} 8 | 9 | int8_t Get_Tile_Value() {} 10 | 11 | B::type test() {}; 12 | 13 | // template 14 | boost::optional handle_key(application state, key_code key, coord size); 15 | 16 | test(); 17 | -------------------------------------------------------------------------------- /test/markup/cpp/function-params.expect.txt: -------------------------------------------------------------------------------- 1 | int f( 2 | int a = 1, 3 | char* b = "2", // Line comment 4 | double c = 3.0, /* Block comment */ 5 | ARRAY(int, 5) d, 6 | void* e __attribute__((unused)) 7 | ); 8 | -------------------------------------------------------------------------------- /test/markup/cpp/function-params.txt: -------------------------------------------------------------------------------- 1 | int f( 2 | int a = 1, 3 | char* b = "2", // Line comment 4 | double c = 3.0, /* Block comment */ 5 | ARRAY(int, 5) d, 6 | void* e __attribute__((unused)) 7 | ); 8 | -------------------------------------------------------------------------------- /test/markup/cpp/function-title.txt: -------------------------------------------------------------------------------- 1 | int main() { 2 | A a = new A(); 3 | int b = b * sum(1, 2); 4 | if (a->check1()) 5 | return 3; 6 | else if (a->check2()) 7 | return 4; 8 | return a->result(); 9 | } 10 | -------------------------------------------------------------------------------- /test/markup/cpp/number-literals.txt: -------------------------------------------------------------------------------- 1 | /* digit separators */ 2 | int number = 2'555'555'555; // digit separators 3 | float exponentFloat = .123'456e3'000; // digit separators in floats 4 | float suffixed = 3.000'001'234f // digit separators in suffixed numbers 5 | char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars 6 | float negative = -123.0f; // negative floating point numbers 7 | -------------------------------------------------------------------------------- /test/markup/cpp/pointers-returns.expect.txt: -------------------------------------------------------------------------------- 1 | // These will all work: 2 | char** foo_bar(); 3 | char ** foo_bar(); 4 | char **foo_bar(); 5 | -------------------------------------------------------------------------------- /test/markup/cpp/pointers-returns.txt: -------------------------------------------------------------------------------- 1 | // These will all work: 2 | char** foo_bar(); 3 | char ** foo_bar(); 4 | char **foo_bar(); 5 | -------------------------------------------------------------------------------- /test/markup/cpp/preprocessor.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #define foo 1<<16 3 | 4 | #ifdef DEBUG 5 | TYPE1 foo(void) 6 | #else 7 | int foo(void) 8 | #endif 9 | { } 10 | 11 | #define x(v) ((v)) 12 | # define x(v) ((v)) 13 | # define x(v) ((v)) 14 | 15 | #if MACRO_WITH_STRING_ARG("hello \"world\"") 16 | #elif MULTI_LINE /* comment */ < \ 17 | EXPRESSION 18 | int bar; 19 | #endif // comment 20 | -------------------------------------------------------------------------------- /test/markup/cpp/primitive-types.expect.txt: -------------------------------------------------------------------------------- 1 | const uint64_t MAX_INT_64; 2 | 3 | struct position_tag; 4 | -------------------------------------------------------------------------------- /test/markup/cpp/primitive-types.txt: -------------------------------------------------------------------------------- 1 | const uint64_t MAX_INT_64; 2 | 3 | struct position_tag; 4 | -------------------------------------------------------------------------------- /test/markup/crystal/defs.txt: -------------------------------------------------------------------------------- 1 | def foo 2 | end 3 | 4 | def *(other) 5 | end 6 | 7 | def **(other) 8 | end 9 | 10 | def =~(other) 11 | end 12 | 13 | def !~(other) 14 | end 15 | -------------------------------------------------------------------------------- /test/markup/crystal/macro.txt: -------------------------------------------------------------------------------- 1 | puts {{ "hello world" }} 2 | 3 | {% verbatim %}{{ "bla".id }}{% end %} 4 | 5 | macro foo 6 | {% verbatim %} 7 | {{ "bla".id }} 8 | {% end %} 9 | end 10 | -------------------------------------------------------------------------------- /test/markup/crystal/operators.expect.txt: -------------------------------------------------------------------------------- 1 | + 2 | - 3 | * 4 | % 5 | & 6 | | 7 | ^ 8 | ** 9 | << 10 | >> 11 | == 12 | != 13 | < 14 | <= 15 | > 16 | >= 17 | <=> 18 | === 19 | // 20 | //= 21 | &+ 22 | &- 23 | &* 24 | &** 25 | &+= 26 | &-= 27 | &*= 28 | ! 29 | ~ 30 | [] 31 | []? 32 | []= 33 | / 34 | 35 | -------------------------------------------------------------------------------- /test/markup/crystal/operators.txt: -------------------------------------------------------------------------------- 1 | + 2 | - 3 | * 4 | % 5 | & 6 | | 7 | ^ 8 | ** 9 | << 10 | >> 11 | == 12 | != 13 | < 14 | <= 15 | > 16 | >= 17 | <=> 18 | === 19 | // 20 | //= 21 | &+ 22 | &- 23 | &* 24 | &** 25 | &+= 26 | &-= 27 | &*= 28 | ! 29 | ~ 30 | [] 31 | []? 32 | []= 33 | / 34 | -------------------------------------------------------------------------------- /test/markup/crystal/regexes.expect.txt: -------------------------------------------------------------------------------- 1 | if /foo/ 2 | unless /foo/ 3 | case /foo/ 4 | select /foo/ 5 | when /foo/ 6 | while /foo/ 7 | until /foo/ 8 | +/foo/ 9 | 10 | # NG 11 | xif /foo/ 12 | ifx /foo/ 13 | -------------------------------------------------------------------------------- /test/markup/crystal/regexes.txt: -------------------------------------------------------------------------------- 1 | if /foo/ 2 | unless /foo/ 3 | case /foo/ 4 | select /foo/ 5 | when /foo/ 6 | while /foo/ 7 | until /foo/ 8 | +/foo/ 9 | 10 | # NG 11 | xif /foo/ 12 | ifx /foo/ 13 | -------------------------------------------------------------------------------- /test/markup/crystal/toplevel-keywords.expect.txt: -------------------------------------------------------------------------------- 1 | class Foo; end 2 | struct Bar; end 3 | 4 | annotation JSON::Field; end 5 | -------------------------------------------------------------------------------- /test/markup/crystal/toplevel-keywords.txt: -------------------------------------------------------------------------------- 1 | class Foo; end 2 | struct Bar; end 3 | 4 | annotation JSON::Field; end 5 | -------------------------------------------------------------------------------- /test/markup/csharp/dotted-namespace.expect.txt: -------------------------------------------------------------------------------- 1 | namespace Dotted.Namespace 2 | { 3 | class MyClass 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/csharp/dotted-namespace.txt: -------------------------------------------------------------------------------- 1 | namespace Dotted.Namespace 2 | { 3 | class MyClass 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/csharp/floats.expect.txt: -------------------------------------------------------------------------------- 1 | float test = 1.0f; 2 | float test2 = 1.f; 3 | float test3 = 1.0; 4 | float test4 = 1; -------------------------------------------------------------------------------- /test/markup/csharp/floats.txt: -------------------------------------------------------------------------------- 1 | float test = 1.0f; 2 | float test2 = 1.f; 3 | float test3 = 1.0; 4 | float test4 = 1; -------------------------------------------------------------------------------- /test/markup/csharp/functions.txt: -------------------------------------------------------------------------------- 1 | public void ExampleFunction1() { 2 | } 3 | 4 | public void ExampleFunction2() 5 | { 6 | } 7 | 8 | void ExampleFunctionDeclaration1(); 9 | 10 | void ExampleFunctionDeclaration2() 11 | ; 12 | 13 | public string ExampleExpressionBodiedFunction1() => "dummy"; 14 | 15 | public string ExampleExpressionBodiedFunction2() 16 | => "dummy"; -------------------------------------------------------------------------------- /test/markup/csharp/generic_modifiers.expect.txt: -------------------------------------------------------------------------------- 1 | interface IObserver<in T>; 2 | {} 3 | 4 | interface IObservable<out T>; 5 | {} 6 | 7 | public delegate void DContravariant<in A>(A argument); 8 | -------------------------------------------------------------------------------- /test/markup/csharp/generic_modifiers.txt: -------------------------------------------------------------------------------- 1 | interface IObserver; 2 | {} 3 | 4 | interface IObservable; 5 | {} 6 | 7 | public delegate void DContravariant(A argument); 8 | -------------------------------------------------------------------------------- /test/markup/csharp/identifiers.expect.txt: -------------------------------------------------------------------------------- 1 | var @class = new MyClass(); 2 | doSomething(@var, @foo); 3 | var a; 4 | -------------------------------------------------------------------------------- /test/markup/csharp/identifiers.txt: -------------------------------------------------------------------------------- 1 | var @class = new MyClass(); 2 | doSomething(@var, @foo); 3 | var a; 4 | 5 | -------------------------------------------------------------------------------- /test/markup/csharp/string-interpolation.txt: -------------------------------------------------------------------------------- 1 | var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; 2 | var ivstr = $@"{{Hello}}, 3 | { 4 | $"\"{nested}\"" + @" 5 | and 6 | " + $@" 7 | ""{nested}"" 8 | " 9 | /*comments*/ }"; 10 | -------------------------------------------------------------------------------- /test/markup/csharp/titles.txt: -------------------------------------------------------------------------------- 1 | namespace Foo // namespace 2 | { 3 | public class Greet : Base, Other, IInterface.test.path // class 4 | { 5 | public Greet(string who) // function 6 | { 7 | Who = who; 8 | } 9 | 10 | int[] f(int val = 0) 11 | { 12 | new Type(); 13 | return getType(); 14 | throw getError(); 15 | await Stuff(); 16 | } 17 | } 18 | 19 | public class TesterA where R : class where S : IComparable 20 | {} 21 | } 22 | -------------------------------------------------------------------------------- /test/markup/css/pseudo-selector.expect.txt: -------------------------------------------------------------------------------- 1 | li:not(.red){} 2 | li:not(.red):not(.green){} 3 | -------------------------------------------------------------------------------- /test/markup/css/pseudo-selector.txt: -------------------------------------------------------------------------------- 1 | li:not(.red){} 2 | li:not(.red):not(.green){} 3 | -------------------------------------------------------------------------------- /test/markup/css/url.txt: -------------------------------------------------------------------------------- 1 | div { background: url("foo/bar/baz.jpg") } 2 | div { background: url('foo/bar/baz.jpg') } 3 | div { background: url(foo/bar/baz.jpg) } 4 | div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } 5 | div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } 6 | div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } -------------------------------------------------------------------------------- /test/markup/dart/comment-markdown.expect.txt: -------------------------------------------------------------------------------- 1 | /// Comment. 2 | 3 | /// Comment 2. 4 | /// ```dart 5 | /// code; 6 | /// ``` 7 | /// text. 8 | 9 | /// Comment 3. 10 | -------------------------------------------------------------------------------- /test/markup/dart/comment-markdown.txt: -------------------------------------------------------------------------------- 1 | /// Comment. 2 | 3 | /// Comment 2. 4 | /// ```dart 5 | /// code; 6 | /// ``` 7 | /// text. 8 | 9 | /// Comment 3. 10 | -------------------------------------------------------------------------------- /test/markup/dart/string-interpolation.expect.txt: -------------------------------------------------------------------------------- 1 | '1234$identifier $true'; 2 | // comment 3 | '1234${1234 + true + 'foo'}'; 4 | -------------------------------------------------------------------------------- /test/markup/dart/string-interpolation.txt: -------------------------------------------------------------------------------- 1 | '1234$identifier $true'; 2 | // comment 3 | '1234${1234 + true + 'foo'}'; 4 | -------------------------------------------------------------------------------- /test/markup/delphi/compiler-directive.expect.txt: -------------------------------------------------------------------------------- 1 | { Compiler directives } 2 | {$I} (*$I*) 3 | procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); 4 | begin end; 5 | -------------------------------------------------------------------------------- /test/markup/delphi/compiler-directive.txt: -------------------------------------------------------------------------------- 1 | { Compiler directives } 2 | {$I} (*$I*) 3 | procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); 4 | begin end; 5 | -------------------------------------------------------------------------------- /test/markup/diff/comments.expect.txt: -------------------------------------------------------------------------------- 1 | Index: languages/demo.js 2 | =================================================================== 3 | --- languages/demo.js (revision 199) 4 | +++ languages/demo.js (revision 200) 5 | @@ -1,8 +1,7 @@ 6 | + Here we highlight correctly 7 | ==== 8 | + Here too 9 | ===== 10 | + Here we don't anymore after five '=' next to each other 11 | -------------------------------------------------------------------------------- /test/markup/diff/comments.txt: -------------------------------------------------------------------------------- 1 | Index: languages/demo.js 2 | =================================================================== 3 | --- languages/demo.js (revision 199) 4 | +++ languages/demo.js (revision 200) 5 | @@ -1,8 +1,7 @@ 6 | + Here we highlight correctly 7 | ==== 8 | + Here too 9 | ===== 10 | + Here we don't anymore after five '=' next to each other 11 | -------------------------------------------------------------------------------- /test/markup/dockerfile/default.txt: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | 3 | MAINTAINER laurent@docker.com 4 | 5 | ARG debug=0 6 | 7 | COPY www.conf /etc/php5/fpm/pool.d/ 8 | 9 | RUN apt-get update \ 10 | && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql 11 | RUN mkdir /tmp/sessions 12 | 13 | ENV APPLICATION_ENV dev 14 | 15 | USER www-data 16 | 17 | EXPOSE 80 18 | 19 | VOLUME ["/var/www/html"] 20 | 21 | WORKDIR "/var/www/html" 22 | 23 | CMD [ "/usr/sbin/php5-fpm", "-F" ] 24 | -------------------------------------------------------------------------------- /test/markup/dos/comments.expect.txt: -------------------------------------------------------------------------------- 1 | rem comment 2 | rem comment 3 | copy a.txt b.txt > rem not_a_comment 4 | -------------------------------------------------------------------------------- /test/markup/dos/comments.txt: -------------------------------------------------------------------------------- 1 | rem comment 2 | rem comment 3 | copy a.txt b.txt > rem not_a_comment 4 | -------------------------------------------------------------------------------- /test/markup/ebnf/quote-symbols.expect.txt: -------------------------------------------------------------------------------- 1 | first_quote_symbol = "'" . 2 | second_quote_symbol = '"' . 3 | 4 | (* escaped_quote_symbol tests backticks, which does not interfere 5 | * with backslashes. It has precedent in some language 6 | * specifications. 7 | *) 8 | escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) . 9 | -------------------------------------------------------------------------------- /test/markup/ebnf/quote-symbols.txt: -------------------------------------------------------------------------------- 1 | first_quote_symbol = "'" . 2 | second_quote_symbol = '"' . 3 | 4 | (* escaped_quote_symbol tests backticks, which does not interfere 5 | * with backslashes. It has precedent in some language 6 | * specifications. 7 | *) 8 | escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) . 9 | -------------------------------------------------------------------------------- /test/markup/ebnf/terminators.expect.txt: -------------------------------------------------------------------------------- 1 | full-stop = "." . 2 | semicolon = ";" ; 3 | end-test = "end" ; (* ending production to test semicolon *) 4 | -------------------------------------------------------------------------------- /test/markup/ebnf/terminators.txt: -------------------------------------------------------------------------------- 1 | full-stop = "." . 2 | semicolon = ";" ; 3 | end-test = "end" ; (* ending production to test semicolon *) 4 | -------------------------------------------------------------------------------- /test/markup/ebnf/underscore-production.expect.txt: -------------------------------------------------------------------------------- 1 | a_production = nonterminal ; 2 | -------------------------------------------------------------------------------- /test/markup/ebnf/underscore-production.txt: -------------------------------------------------------------------------------- 1 | a_production = nonterminal ; 2 | -------------------------------------------------------------------------------- /test/markup/elixir/function-not-regex.expect.txt: -------------------------------------------------------------------------------- 1 | import Kernel, except: [ 2 | spawn: 1, 3 | +: 2, 4 | /: 2, 5 | Unless: 2 6 | ] 7 | -------------------------------------------------------------------------------- /test/markup/elixir/function-not-regex.txt: -------------------------------------------------------------------------------- 1 | import Kernel, except: [ 2 | spawn: 1, 3 | +: 2, 4 | /: 2, 5 | Unless: 2 6 | ] 7 | -------------------------------------------------------------------------------- /test/markup/elixir/function-title.txt: -------------------------------------------------------------------------------- 1 | def f do 2 | :ok 3 | end 4 | 5 | def f(list) do 6 | :ok 7 | end 8 | 9 | def f :clear, list do 10 | :ok 11 | end 12 | 13 | def f!, do: IO.puts "hello world" 14 | 15 | x = 5 16 | -------------------------------------------------------------------------------- /test/markup/elixir/numbers.txt: -------------------------------------------------------------------------------- 1 | integer = 1234 2 | big_integer = 1_234_000 3 | neg_integer = -20_000 4 | float = 2.34 5 | sci_float = 2.4e23 6 | plus_sci_float = 2.4e+23 7 | small_sci_float = 2.4e-23 8 | cap_sci_float = 2.4E23 9 | binary = 0b1010 10 | strange_binary = 0b1010_1010_1010 11 | octal = 0o777 12 | strange_octal = 0o777_666_555 13 | hex = 0x1ABEF 14 | strange_hex = 0x1234_FACE_987D 15 | -------------------------------------------------------------------------------- /test/markup/elixir/sigils.txt: -------------------------------------------------------------------------------- 1 | ~R'this + i\s "a" regex too' 2 | ~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s 3 | ~W(hello #{no "123" \c\d \123 interpol} world)s 4 | ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here } 5 | ~S"No escapes \s\t\n and no #{interpolation}" 6 | 7 | ~S/hello/ 8 | ~S|hello| 9 | ~S"hello" 10 | ~S'hello' 11 | ~S(hello) 12 | ~S[hello] 13 | ~S{hello} 14 | ~S 15 | 16 | ~s/hello #{name}/ 17 | ~s|hello #{name}| 18 | ~s"hello #{name}" 19 | ~s'hello #{name}' 20 | ~s(hello #{name}) 21 | ~s[hello #{name}] 22 | ~s{hello #{name}} 23 | ~s 24 | -------------------------------------------------------------------------------- /test/markup/elixir/strings.expect.txt: -------------------------------------------------------------------------------- 1 | a = """test""" 2 | b = '''test''' 3 | c = "test" 4 | d = 'test' 5 | -------------------------------------------------------------------------------- /test/markup/elixir/strings.txt: -------------------------------------------------------------------------------- 1 | a = """test""" 2 | b = '''test''' 3 | c = "test" 4 | d = 'test' 5 | -------------------------------------------------------------------------------- /test/markup/elixir/uppercase-string-sigil.txt: -------------------------------------------------------------------------------- 1 | defmodule Long.Module.Name do 2 | @doc ~S''' 3 | No #{interpolation} of any kind. 4 | \000 \x{ff} 5 | 6 | \n #{\x{ff}} 7 | ''' 8 | def func(a, b \\ []), do: :ok 9 | 10 | @doc ~S""" 11 | No #{interpolation} of any kind. 12 | \000 \x{ff} 13 | 14 | \n #{\x{ff}} 15 | """ 16 | def func(a, b \\ []), do: :ok 17 | end 18 | -------------------------------------------------------------------------------- /test/markup/excel/comments.expect.txt: -------------------------------------------------------------------------------- 1 | =(N4 + N5)*0.055 + N("This is a comment.") 2 | -------------------------------------------------------------------------------- /test/markup/excel/comments.txt: -------------------------------------------------------------------------------- 1 | =(N4 + N5)*0.055 + N("This is a comment.") 2 | -------------------------------------------------------------------------------- /test/markup/fortran/comments.expect.txt: -------------------------------------------------------------------------------- 1 | C 2 | C This program in FORTRAN 77 outputs "Hello, World!". 3 | C ==================================================== 4 | 5 | !=============================== 6 | ! This is a test subroutine 7 | !=============================== 8 | 9 | ! another comment 10 | 11 | C=2 12 | C = 2 !correct 13 | C ='boo' 14 | -------------------------------------------------------------------------------- /test/markup/fortran/comments.txt: -------------------------------------------------------------------------------- 1 | C 2 | C This program in FORTRAN 77 outputs "Hello, World!". 3 | C ==================================================== 4 | 5 | !=============================== 6 | ! This is a test subroutine 7 | !=============================== 8 | 9 | ! another comment 10 | 11 | C=2 12 | C = 2 !correct 13 | C ='boo' 14 | -------------------------------------------------------------------------------- /test/markup/fortran/numbers.txt: -------------------------------------------------------------------------------- 1 | 1.d0 2 | -1.d0 3 | 1.d-5 4 | -1.D5 5 | 342.e+12 6 | 12. 7 | 12 8 | .23 9 | -.23 10 | 1.E4 11 | 1E4 12 | 1D-4 13 | var1 14 | va1r 15 | mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4))) 16 | 17 | 6_ikind 18 | 1_c_short 19 | 6.666666666666666_DBL 20 | -------------------------------------------------------------------------------- /test/markup/fsharp/bang-keywords.expect.txt: -------------------------------------------------------------------------------- 1 | let! (result2 : byte[]) = stream.AsyncRead(bufferSize) 2 | -------------------------------------------------------------------------------- /test/markup/fsharp/bang-keywords.txt: -------------------------------------------------------------------------------- 1 | let! (result2 : byte[]) = stream.AsyncRead(bufferSize) 2 | -------------------------------------------------------------------------------- /test/markup/gauss/function_defs.txt: -------------------------------------------------------------------------------- 1 | proc (1) = foo(if, endif, 10); 2 | proc foo; 3 | proc (1) = calc(local__row, fin, ...); 4 | fn /* inline */ twopi=pi*2; 5 | fn _n_pi(n /* inline comment */) = pi*n; 6 | keyword add(str, struct plotControl myPlot); 7 | keyword sub; 8 | -------------------------------------------------------------------------------- /test/markup/gauss/function_refs.txt: -------------------------------------------------------------------------------- 1 | k = colsf(fin); 2 | nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); 3 | call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); 4 | ols("", csvReadM("test.csv")); 5 | if myfn(10) == 20; 6 | -------------------------------------------------------------------------------- /test/markup/gauss/keywords.txt: -------------------------------------------------------------------------------- 1 | for i(start, stop, bar(5)); 2 | if (i-1 % 5 == 0 .and some_flag); 3 | elseif i % 2 .eqv 0; 4 | external string _olsrnam; 5 | external proc indices2,indexcat; 6 | myPlot.axes.and.for.if.endif.text = "hey"; 7 | local f:proc; 8 | -------------------------------------------------------------------------------- /test/markup/go/functions.txt: -------------------------------------------------------------------------------- 1 | func name() 2 | 3 | func name(int32, *somePointer)(string) 4 | 5 | map[string]func(int32, string) 6 | 7 | func name (x int32) int32 { 8 | return x; 9 | } 10 | -------------------------------------------------------------------------------- /test/markup/go/numbers.expect.txt: -------------------------------------------------------------------------------- 1 | float_var := 1.0e10 2 | complex_var := 1.2e5+2.3i 3 | hex_int := 0xcf3e4028ac084aea 4 | -------------------------------------------------------------------------------- /test/markup/go/numbers.txt: -------------------------------------------------------------------------------- 1 | float_var := 1.0e10 2 | complex_var := 1.2e5+2.3i 3 | hex_int := 0xcf3e4028ac084aea 4 | -------------------------------------------------------------------------------- /test/markup/go/strings.expect.txt: -------------------------------------------------------------------------------- 1 | func main() { 2 | str := "Hello, 世界\nHello \"world\"\nHello 'world'" 3 | char := 'a' 4 | char2 := '"' 5 | char3 := '\\' 6 | char3 := '\'' 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/go/strings.txt: -------------------------------------------------------------------------------- 1 | func main() { 2 | str := "Hello, 世界\nHello \"world\"\nHello 'world'" 3 | char := 'a' 4 | char2 := '"' 5 | char3 := '\\' 6 | char3 := '\'' 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/golo/default.txt: -------------------------------------------------------------------------------- 1 | module hello 2 | 3 | function dyno = -> DynamicObject() 4 | 5 | struct human = { name } 6 | 7 | @annotated 8 | function main = |args| { 9 | let a = 1 10 | var b = 2 11 | 12 | println("hello") 13 | 14 | let john = human("John Doe") 15 | } 16 | -------------------------------------------------------------------------------- /test/markup/handlebars/block-expression-variants-as-path-segment.txt: -------------------------------------------------------------------------------- 1 | text {{#abc abcd.[lite"'ral}}segment] }}a{{/abc}} 2 | 3 | text {{#abc abcd."lite]'ral}}segment" }}a{{/abc}} 4 | 5 | text {{#abc abcd.'lite]"ral}}segment' }}a{{/abc}} 6 | 7 | text 8 | 9 | -------------------------------------------------------------------------------- /test/markup/handlebars/block-expression-variants-in-helper-name.txt: -------------------------------------------------------------------------------- 1 | text {{#[ab}}c] param }}a{{/[ab}}c]}} 2 | 3 | text {{#'ab}}c' param}}a{{/'ab}}c'}} 4 | 5 | text {{#"ab}}c" param}}a{{/"ab}}c"}} 6 | 7 | text {{#"" param}}a{{/""}} 8 | 9 | text {{#'' param}}a{{/''}} 10 | 11 | text {{#[] param}}a{{/[]}} 12 | 13 | text 14 | -------------------------------------------------------------------------------- /test/markup/handlebars/block-expression-variants-in-param.txt: -------------------------------------------------------------------------------- 1 | text {{#abc "lite]'ral}}segment" }}a{{/abc}} 2 | 3 | text {{#abc 'lite]"ral}}segment' }}a{{/abc}} 4 | 5 | text {{#abc [lite"'ral}}segment] }}a{{/abc}} 6 | 7 | text 8 | -------------------------------------------------------------------------------- /test/markup/handlebars/block-with-param.expect.txt: -------------------------------------------------------------------------------- 1 | {{#blockHelper param1 param2}}block content{{/blockHelper}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/block-with-param.txt: -------------------------------------------------------------------------------- 1 | {{#blockHelper param1 param2}}block content{{/blockHelper}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/block.expect.txt: -------------------------------------------------------------------------------- 1 | {{#block}}block content{{/block}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/block.txt: -------------------------------------------------------------------------------- 1 | {{#block}}block content{{/block}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/built-ins.txt: -------------------------------------------------------------------------------- 1 | {{#if test}}yes{{/if}} 2 | 3 | {{#unless test}}no{{/unless}} 4 | 5 | {{#with test}}abc{{/with}} 6 | 7 | {{#each test}}abc{{/each}} 8 | 9 | {{lookup abc}} 10 | 11 | {{log test}} 12 | -------------------------------------------------------------------------------- /test/markup/handlebars/comments.expect.txt: -------------------------------------------------------------------------------- 1 | {{!-- a comment {{expression}} --}} {{expression}} 2 | 3 | {{! a simple comment }} 4 | 5 | -------------------------------------------------------------------------------- /test/markup/handlebars/comments.txt: -------------------------------------------------------------------------------- 1 | {{!-- a comment {{expression}} --}} {{expression}} 2 | 3 | {{! a simple comment }} 4 | -------------------------------------------------------------------------------- /test/markup/handlebars/escaped-mustaches.expect.txt: -------------------------------------------------------------------------------- 1 | \{{no-expression}} 2 | 3 | \{{{no-expression}}} 4 | 5 | \{{#no}} block \{{/no}} 6 | 7 | \{{\{{no}}}} block \{{\{{/no}}}} 8 | 9 | \{{!-- no comment --}} 10 | 11 | \{{! no comment }} 12 | 13 | <!-- escaped escapings --> 14 | 15 | \\{{expression}} 16 | 17 | \\\{{expression}} 18 | 19 | \\\\{{expression}} 20 | 21 | \\\{{! comment }} 22 | 23 | -------------------------------------------------------------------------------- /test/markup/handlebars/escaped-mustaches.txt: -------------------------------------------------------------------------------- 1 | \{{no-expression}} 2 | 3 | \{{{no-expression}}} 4 | 5 | \{{#no}} block \{{/no}} 6 | 7 | \{{\{{no}}}} block \{{\{{/no}}}} 8 | 9 | \{{!-- no comment --}} 10 | 11 | \{{! no comment }} 12 | 13 | 14 | 15 | \\{{expression}} 16 | 17 | \\\{{expression}} 18 | 19 | \\\\{{expression}} 20 | 21 | \\\{{! comment }} 22 | -------------------------------------------------------------------------------- /test/markup/handlebars/expression-variants.txt: -------------------------------------------------------------------------------- 1 | text 2 | 3 | {{ "lite]'ral}}segment" }} text 4 | 5 | {{ 'lite]"ral}}segment' }} text 6 | 7 | {{ [lite"'ral}}segment] }} text 8 | 9 | {{ abc "lite]'ral}}segment" }} text 10 | 11 | {{ abc 'lite]"ral}}segment' }} text 12 | 13 | {{ abc [lite"'ral}}segment] }} text 14 | 15 | 16 | {{ abcd.[lite"'ral}}segment] }} text 17 | 18 | {{ abcd."lite]'ral}}segment" }} text 19 | 20 | {{ abcd.'lite]"ral}}segment' }} text 21 | 22 | {{ abcd.''}} text 23 | 24 | {{ abcd."" }} text 25 | 26 | {{ abcd.[] }} text 27 | -------------------------------------------------------------------------------- /test/markup/handlebars/partial-call.expect.txt: -------------------------------------------------------------------------------- 1 | {{> partial}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/partial-call.txt: -------------------------------------------------------------------------------- 1 | {{> partial}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/raw-block.expect.txt: -------------------------------------------------------------------------------- 1 | {{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/raw-block.txt: -------------------------------------------------------------------------------- 1 | {{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/simple-expression.expect.txt: -------------------------------------------------------------------------------- 1 | {{abc}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/simple-expression.txt: -------------------------------------------------------------------------------- 1 | {{abc}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/sub-expressions.expect.txt: -------------------------------------------------------------------------------- 1 | {{helper (subExpression 1 2)}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/sub-expressions.txt: -------------------------------------------------------------------------------- 1 | {{helper (subExpression 1 2)}} 2 | -------------------------------------------------------------------------------- /test/markup/handlebars/triple-mustache.expect.txt: -------------------------------------------------------------------------------- 1 | {{{raw}}} 2 | 3 | -------------------------------------------------------------------------------- /test/markup/handlebars/triple-mustache.txt: -------------------------------------------------------------------------------- 1 | {{{raw}}} 2 | -------------------------------------------------------------------------------- /test/markup/haskell/infix.expect.txt: -------------------------------------------------------------------------------- 1 | infix 3 `foo` 2 | infixl 6 `bar` 3 | infixr 9 `baz` 4 | -------------------------------------------------------------------------------- /test/markup/haskell/infix.txt: -------------------------------------------------------------------------------- 1 | infix 3 `foo` 2 | infixl 6 `bar` 3 | infixr 9 `baz` 4 | -------------------------------------------------------------------------------- /test/markup/haskell/nested-comments.expect.txt: -------------------------------------------------------------------------------- 1 | {- this is a {- nested -} comment -} 2 | -------------------------------------------------------------------------------- /test/markup/haskell/nested-comments.txt: -------------------------------------------------------------------------------- 1 | {- this is a {- nested -} comment -} 2 | -------------------------------------------------------------------------------- /test/markup/http/default.expect.txt: -------------------------------------------------------------------------------- 1 | POST /task?id=1 HTTP/1.1 2 | Host: example.org 3 | Content-Type: application/json; charset=utf-8 4 | Content-Length: 19 5 | 6 | {"status": "ok", "extended": true} 7 | 8 | -------------------------------------------------------------------------------- /test/markup/http/default.txt: -------------------------------------------------------------------------------- 1 | POST /task?id=1 HTTP/1.1 2 | Host: example.org 3 | Content-Type: application/json; charset=utf-8 4 | Content-Length: 19 5 | 6 | {"status": "ok", "extended": true} 7 | -------------------------------------------------------------------------------- /test/markup/ini/array.expect.txt: -------------------------------------------------------------------------------- 1 | moo=["foo"] 2 | 3 | KNOWN_PEERS = [ 4 | "finland.some-host.com:11625", 5 | "germany.some-host.com:11625", 6 | "hongkong.some-host.com:11625", 7 | 32, 8 | true 9 | ] 10 | -------------------------------------------------------------------------------- /test/markup/ini/array.txt: -------------------------------------------------------------------------------- 1 | 2 | moo=["foo"] 3 | 4 | KNOWN_PEERS = [ 5 | "finland.some-host.com:11625", 6 | "germany.some-host.com:11625", 7 | "hongkong.some-host.com:11625", 8 | 32, 9 | true 10 | ] 11 | -------------------------------------------------------------------------------- /test/markup/ini/comments.expect.txt: -------------------------------------------------------------------------------- 1 | # Comment 2 | ; ini-style comment 3 | x = "abc" # Comment on same line 4 | y = 123 ; Comment on same line 5 | [table] ; Comment on same line 6 | -------------------------------------------------------------------------------- /test/markup/ini/comments.txt: -------------------------------------------------------------------------------- 1 | # Comment 2 | ; ini-style comment 3 | x = "abc" # Comment on same line 4 | y = 123 ; Comment on same line 5 | [table] ; Comment on same line 6 | -------------------------------------------------------------------------------- /test/markup/ini/tables.expect.txt: -------------------------------------------------------------------------------- 1 | [table] 2 | [[array]] 3 | [dotted.table.name] 4 | [target.'cfg(unix)'] 5 | -------------------------------------------------------------------------------- /test/markup/ini/tables.txt: -------------------------------------------------------------------------------- 1 | [table] 2 | [[array]] 3 | [dotted.table.name] 4 | [target.'cfg(unix)'] 5 | -------------------------------------------------------------------------------- /test/markup/ini/types.txt: -------------------------------------------------------------------------------- 1 | i = 1_234 2 | f = 1.23 3 | f = 7e+12 4 | f = 2e3 5 | f = -1.234e-12 6 | basic = "string" 7 | multi_basic = """multiple 8 | lines""" 9 | literal = 'string' 10 | multi_literal = '''multiple 11 | lines''' 12 | b = true 13 | b = false 14 | b = on 15 | b = off 16 | b = yes 17 | b = no 18 | dotted.key = 1 19 | array = [1, 2, 3] 20 | inline = {name = "foo", id = 123} 21 | -------------------------------------------------------------------------------- /test/markup/ini/variable.expect.txt: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | key = $VAR1 3 | -------------------------------------------------------------------------------- /test/markup/ini/variable.txt: -------------------------------------------------------------------------------- 1 | memory_limit = ${PHP_MEMORY_LIMIT} 2 | key = $VAR1 3 | -------------------------------------------------------------------------------- /test/markup/java/annotations.txt: -------------------------------------------------------------------------------- 1 | @SpringBootTest 2 | @AutoConfigureMockMvc 3 | @Transactional 4 | @Slf4j 5 | @RunWith(SpringRunner.class) 6 | @Something(1+(3+4)) 7 | public class BoardControllerTest { 8 | } 9 | 10 | class Example { 11 | void foo(@SuppressWarnings("unused") int bar) { } 12 | } 13 | -------------------------------------------------------------------------------- /test/markup/java/gh1031.expect.txt: -------------------------------------------------------------------------------- 1 | public class DefaultDataDaoImpl { 2 | private List<AbstractCmrDataProcessor> cmrDataProcessors; 3 | } 4 | 5 | public class DefaultDataDaoImpl { 6 | private List<AbstractCmrDataProcessor, AbstractCmrDataProcessor> cmrDataProcessors; 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/java/gh1031.txt: -------------------------------------------------------------------------------- 1 | public class DefaultDataDaoImpl { 2 | private List cmrDataProcessors; 3 | } 4 | 5 | public class DefaultDataDaoImpl { 6 | private List cmrDataProcessors; 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/java/numbers.txt: -------------------------------------------------------------------------------- 1 | long creditCardNumber = 1234_5678_9012_3456L; 2 | long socialSecurityNumber = 999_99_9999L; 3 | float pi = 3.14_15F; 4 | long hexBytes = 0xFF_EC_DE_5E; 5 | long hexWords = 0xCAFE_BABE; 6 | long maxLong = 0x7fff_ffff_ffff_ffffL; 7 | byte nybbles = 0b0010_0101; 8 | long bytes = 0b11010010_01101001_10010100_10010010; 9 | int n = 1234 + Contacts._ID; 10 | -------------------------------------------------------------------------------- /test/markup/java/titles.txt: -------------------------------------------------------------------------------- 1 | public class Greet { 2 | public Either f(int val) { 3 | new Type(); 4 | if (val) { 5 | return getType(); 6 | } else if (!val) { 7 | throw getError(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/markup/javascript/arrow-function.txt: -------------------------------------------------------------------------------- 1 | var f = x => x; 2 | f(x => x + (y=2, z=undefined, ...rest) => y); 3 | () => null; 4 | const FC = props =>

    functional component

    ; 5 | -------------------------------------------------------------------------------- /test/markup/javascript/class.expect.txt: -------------------------------------------------------------------------------- 1 | class Car extends Vehicle { 2 | constructor(speed, cost) { 3 | super(speed); 4 | 5 | var c = Symbol('cost'); 6 | this[c] = cost; 7 | 8 | this.intro = `This is a car runs at 9 | ${speed}.`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/markup/javascript/class.txt: -------------------------------------------------------------------------------- 1 | class Car extends Vehicle { 2 | constructor(speed, cost) { 3 | super(speed); 4 | 5 | var c = Symbol('cost'); 6 | this[c] = cost; 7 | 8 | this.intro = `This is a car runs at 9 | ${speed}.`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/markup/javascript/default-parameters.expect.txt: -------------------------------------------------------------------------------- 1 | function visibleTodoFilter(state = 'watch', action) {} 2 | -------------------------------------------------------------------------------- /test/markup/javascript/default-parameters.txt: -------------------------------------------------------------------------------- 1 | function visibleTodoFilter(state = 'watch', action) {} 2 | -------------------------------------------------------------------------------- /test/markup/javascript/inline-languages.txt: -------------------------------------------------------------------------------- 1 | let foo = true; 2 | `hello ${foo ? `Mr ${name}` : 'there'}`; 3 | foo = false; 4 | 5 | html`
    Hello world
    `; 6 | 7 | html`
    Hello times ${10} world
    `; 8 | 9 | html` 10 |
      11 | ${repeat(['a', 'b', 'c'], (v) => { 12 | return html`
    • ${v}
    • `; 13 | }} 14 |
    15 | `; 16 | 17 | css` 18 | body { 19 | color: red; 20 | } 21 | `; 22 | 23 | // Ensure that we're back in JavaScript mode. 24 | var foo = 10; 25 | -------------------------------------------------------------------------------- /test/markup/javascript/jsdoc.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * Create a point. 3 | * @author Test 4 | * @author Test Smith 5 | * @param {number} x - The x value. 6 | * @param {number} y 7 | * @returns {Point} A Point object. 8 | */ 9 | 10 | /** 11 | * @typedef {Array} 12 | * @param {string=} n - Optional 13 | * @param {(string|number)} n - Multiple types 14 | * @param {*} n - Any type 15 | * @param {...string} n - repeatable arguments 16 | * @param {string[]} n - Array of strings 17 | */ 18 | -------------------------------------------------------------------------------- /test/markup/javascript/jsx-fragment.txt: -------------------------------------------------------------------------------- 1 | class Columns extends React.Component { 2 | render() { 3 | return ( 4 | <> 5 | Hello 6 | World 7 | 8 | ); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/markup/javascript/jsx.txt: -------------------------------------------------------------------------------- 1 | var jsx = ; 2 | var jsx = ; 3 | var jsx = ......; 4 | var jsx =

    ; 5 | var jsx = ; 6 | 7 | var x = 5; 8 | 9 | return (); 10 | 11 | const n = () => 12 | const m = () => 13 | 14 | class App extends Component { 15 | render() { 16 | return ( 17 | 18 |
    19 | 20 | 21 |
    22 |
    23 | ); 24 | } 25 | } 26 | 27 | var x = 5; 28 | -------------------------------------------------------------------------------- /test/markup/javascript/keywords.txt: -------------------------------------------------------------------------------- 1 | function $initHighlight(block, cls) { 2 | try { 3 | if (cls.search(/\bno\-highlight\b/) != -1) 4 | return process(block, true, 0x0F) + 5 | ' class=""'; 6 | } catch (e) { 7 | /* handle exception */ 8 | } 9 | for (var i = 0 / 2; i < classes.length; i++) { 10 | if (checkCondition(classes[i]) === undefined) 11 | return /\d+[\s/]/g; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/markup/javascript/method-call.expect.txt: -------------------------------------------------------------------------------- 1 | x.continue(0); 2 | 3 | x = [ 4 | hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), 5 | hljs.COMMENT(/\{#/, /#}/), 6 | ] 7 | -------------------------------------------------------------------------------- /test/markup/javascript/method-call.txt: -------------------------------------------------------------------------------- 1 | x.continue(0); 2 | 3 | x = [ 4 | hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/), 5 | hljs.COMMENT(/\{#/, /#}/), 6 | ] 7 | 8 | -------------------------------------------------------------------------------- /test/markup/javascript/modules.txt: -------------------------------------------------------------------------------- 1 | //------ underscore.js ------ 2 | export default function (obj) {}; 3 | export function each(obj, iterator, context) {}; 4 | export { each as forEach }; 5 | export function something() {}; 6 | 7 | //------ main.js ------ 8 | import _, { each, something as otherthing } from 'underscore'; 9 | -------------------------------------------------------------------------------- /test/markup/javascript/object-attr.expect.txt: -------------------------------------------------------------------------------- 1 | { 2 | key: value, // with comment 3 | key2: value, 4 | 'key-3': value, 5 | key4: false ? undefined : true 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/javascript/object-attr.txt: -------------------------------------------------------------------------------- 1 | { 2 | key: value, // with comment 3 | key2: value, 4 | 'key-3': value, 5 | key4: false ? undefined : true 6 | } 7 | -------------------------------------------------------------------------------- /test/markup/javascript/regex.expect.txt: -------------------------------------------------------------------------------- 1 | // examples that have proven problematic in the past 2 | `Bad ${foo / 1000}` 3 | foo = 2 / 2 + 2 / 2; 4 | foo = / 2 + 2 /; 5 | b = a++ / 2; 6 | -------------------------------------------------------------------------------- /test/markup/javascript/regex.txt: -------------------------------------------------------------------------------- 1 | // examples that have proven problematic in the past 2 | `Bad ${foo / 1000}` 3 | foo = 2 / 2 + 2 / 2; 4 | foo = / 2 + 2 /; 5 | b = a++ / 2; 6 | -------------------------------------------------------------------------------- /test/markup/javascript/shebang.expect.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var a = 1; 4 | -------------------------------------------------------------------------------- /test/markup/javascript/shebang.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var a = 1; 4 | -------------------------------------------------------------------------------- /test/markup/javascript/template-strings.expect.txt: -------------------------------------------------------------------------------- 1 | `string ${foo + `str${undefined}ing`}`; 2 | -------------------------------------------------------------------------------- /test/markup/javascript/template-strings.txt: -------------------------------------------------------------------------------- 1 | `string ${foo + `str${undefined}ing`}`; 2 | -------------------------------------------------------------------------------- /test/markup/json/comments.txt: -------------------------------------------------------------------------------- 1 | /* multi-line comment before */ 2 | [ 3 | { 4 | "title": "apples", // yum 5 | "count": [12000, 20000], /* so many? */ 6 | "description": {"text": "...", "sensitive": false} 7 | }, 8 | { 9 | "title": "oranges", 10 | "count": [17500, null], 11 | "description": {"text": "...", "sensitive": false} 12 | } 13 | // { 14 | // "title" : "brocolli" 15 | // } 16 | ] 17 | /* multi-line 18 | comment after */ 19 | -------------------------------------------------------------------------------- /test/markup/kotlin/class.txt: -------------------------------------------------------------------------------- 1 | class A { 2 | } 3 | 4 | class B() 5 | 6 | class C() {} 7 | 8 | public class D 9 | 10 | class E1 11 | class E2 12 | class E3 13 | 14 | class F1 : A 15 | class F2 : A, B 16 | class F3 : A -------------------------------------------------------------------------------- /test/markup/kotlin/function.txt: -------------------------------------------------------------------------------- 1 | fun a() = 1 2 | fun /* b1 */ b(/*b2*/ a : Int /*b3*/) /*b4*/ = a // b5 3 | 4 | 5 | fun c() : String = "1" 6 | inline fun d() { return } 7 | 8 | 9 | fun e( 10 | a : Int, /*a*/ 11 | b : String //b 12 | ) 13 | {} 14 | 15 | 16 | fun handle(lambda: (IN) /* parenthesized type */ -> OUT) {} 17 | -------------------------------------------------------------------------------- /test/markup/kotlin/nested_comment.expect.txt: -------------------------------------------------------------------------------- 1 | /* begin comment at LEVEL 0 2 | /* 3 | multiline nested comment LEVEL 1 4 | */ 5 | println("on kotlin this is a commented code in comment LEVEL 0") 6 | /* 7 | another multiline nested comment LEVEL 1 8 | */ 9 | end comment at LEVEL 0 */ 10 | -------------------------------------------------------------------------------- /test/markup/kotlin/nested_comment.txt: -------------------------------------------------------------------------------- 1 | /* begin comment at LEVEL 0 2 | /* 3 | multiline nested comment LEVEL 1 4 | */ 5 | println("on kotlin this is a commented code in comment LEVEL 0") 6 | /* 7 | another multiline nested comment LEVEL 1 8 | */ 9 | end comment at LEVEL 0 */ 10 | -------------------------------------------------------------------------------- /test/markup/kotlin/string.expect.txt: -------------------------------------------------------------------------------- 1 | "astring" 2 | expression 3 | "a ${ "string" } ${'c'} b" 4 | "a ${ "string $var ${subs}" } b" 5 | """ ${ 6 | ${subst} 7 | } """ 8 | """f="true"""" 9 | -------------------------------------------------------------------------------- /test/markup/kotlin/string.txt: -------------------------------------------------------------------------------- 1 | "astring" 2 | expression 3 | "a ${ "string" } ${'c'} b" 4 | "a ${ "string $var ${subs}" } b" 5 | """ ${ 6 | ${subst} 7 | } """ 8 | """f="true"""" 9 | -------------------------------------------------------------------------------- /test/markup/lasso/delimiters.txt: -------------------------------------------------------------------------------- 1 |
    2 | [local(y::decimal = .57721)] 3 | [noprocess] [until] [/noprocess] 4 | [no_square_brackets] skip subsequent [square brackets] 5 | 6 | 7 |
    8 | -------------------------------------------------------------------------------- /test/markup/ldif/ldapmodify.expect.txt: -------------------------------------------------------------------------------- 1 | dn: uid=user.0,ou=People,dc=example,dc=com 2 | changeType: modify 3 | add: cn 4 | cn: Morris Day 5 | - 6 | add: mobile 7 | mobile: (408) 555-7844 8 | -------------------------------------------------------------------------------- /test/markup/ldif/ldapmodify.txt: -------------------------------------------------------------------------------- 1 | dn: uid=user.0,ou=People,dc=example,dc=com 2 | changeType: modify 3 | add: cn 4 | cn: Morris Day 5 | - 6 | add: mobile 7 | mobile: (408) 555-7844 8 | -------------------------------------------------------------------------------- /test/markup/ldif/schema.txt: -------------------------------------------------------------------------------- 1 | dn: cn=schema 2 | objectClass: top 3 | objectClass: ldapSubentry 4 | objectClass: subschema 5 | # Single-valued JSON attribute 6 | attributeTypes: ( example-json1-oid NAME 'json1' 7 | EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 8 | SINGLE-VALUE X-ORIGIN 'custom attribute' ) 9 | # Multi-valued JSON attribute 10 | attributeTypes: ( example-mjson1-oid NAME 'mjson1' 11 | EQUALITY jsonObjectExactMatch SYNTAX 1.3.6.1.4.1.30221.2.3.4 12 | X-ORIGIN 'custom attribute' ) 13 | objectClasses: ( example-application-oc-oid NAME 'example-application-oc' 14 | SUP top AUXILIARY MAY ( json1 $ mjson1 ) 15 | X-ORIGIN 'custom auxiliary object class' ) 16 | -------------------------------------------------------------------------------- /test/markup/less/selectors.expect.txt: -------------------------------------------------------------------------------- 1 | #foo { 2 | tag #bar {} 3 | > #bar {} 4 | #bar {} 5 | &#bar {} 6 | &:hover {} 7 | height: ~"@{height}px"; 8 | } 9 | -------------------------------------------------------------------------------- /test/markup/less/selectors.txt: -------------------------------------------------------------------------------- 1 | #foo { 2 | tag #bar {} 3 | > #bar {} 4 | #bar {} 5 | &#bar {} 6 | &:hover {} 7 | height: ~"@{height}px"; 8 | } 9 | -------------------------------------------------------------------------------- /test/markup/lisp/mec.expect.txt: -------------------------------------------------------------------------------- 1 | ; MEC: Multiple Escape Characters. See https://github.com/highlightjs/highlight.js/issues/615 2 | (|spaces and 3 | newlines| x) 4 | (x '|quoted|) 5 | -------------------------------------------------------------------------------- /test/markup/lisp/mec.txt: -------------------------------------------------------------------------------- 1 | ; MEC: Multiple Escape Characters. See https://github.com/highlightjs/highlight.js/issues/615 2 | (|spaces and 3 | newlines| x) 4 | (x '|quoted|) 5 | -------------------------------------------------------------------------------- /test/markup/markdown/bold_italics.txt: -------------------------------------------------------------------------------- 1 | _Italic_ 2 | *Italic* 3 | __Bold__ 4 | **Bold** 5 | *Is __Combined__* 6 | __Bold *then italic*__ 7 | **Bold _then italic_** 8 | **Bold and
    ** 9 | **_[this](https://google.com)_** 10 | 11 | > quoted **Bold _then italic_** 12 | > _[this](https://google.com)_ 13 | 14 | *this is a emphasized paragraph* 15 | *this is too* 16 | 17 | * list with a *italic item* 18 | * list with a **bold item** 19 | -------------------------------------------------------------------------------- /test/markup/markdown/code.txt: -------------------------------------------------------------------------------- 1 | var code = true; 2 | var code = false; 3 | 4 | 5 | ```javascript 6 | var code = true; 7 | ``` 8 | 9 | ````md 10 | ``` 11 | a = 'This is a code block in python' 12 | ``` 13 | ```` 14 | 15 | ~~~ 16 | tilde can be used also (github) 17 | ~~~ 18 | 19 | ~~~~ ruby startline=3 $%@#$ 20 | def foo(x) 21 | return 3 22 | end 23 | ~~~~~~~ 24 | 25 | ~~~~~~~something 26 | code here 27 | ~~~~~~~ 28 | 29 | ``` 30 | aaa 31 | ~~~ 32 | ``` 33 | 34 | ```javascript 35 | can be indented 36 | ``` 37 | 38 | Inline `code`, and `more code`. 39 | -------------------------------------------------------------------------------- /test/markup/markdown/list.expect.txt: -------------------------------------------------------------------------------- 1 | - this is a list 2 | - this is another 3 | - nested list 4 | - another nested 5 | * nested alternative 6 | -------------------------------------------------------------------------------- /test/markup/markdown/list.txt: -------------------------------------------------------------------------------- 1 | - this is a list 2 | - this is another 3 | - nested list 4 | - another nested 5 | * nested alternative 6 | -------------------------------------------------------------------------------- /test/markup/markdown/sections.expect.txt: -------------------------------------------------------------------------------- 1 | # hello world 2 | 3 | ## hello world 4 | 5 | hello world 6 | =========== 7 | 8 | *hello world* or [google](link) 9 | =========== 10 | 11 | # *hello world* or [google](link) 12 | -------------------------------------------------------------------------------- /test/markup/markdown/sections.txt: -------------------------------------------------------------------------------- 1 | # hello world 2 | 3 | ## hello world 4 | 5 | hello world 6 | =========== 7 | 8 | *hello world* or [google](link) 9 | =========== 10 | 11 | # *hello world* or [google](link) 12 | 13 | -------------------------------------------------------------------------------- /test/markup/matlab/block_comment.txt: -------------------------------------------------------------------------------- 1 | %{ evaluate_this = false; % Evaluated as regular single-line comment 2 | evaluate_this = true; 3 | %} 4 | 5 | evaluate_this = true; 6 | 7 | %{ 8 | This is a multi-line comment 9 | evaluate_this = false; 10 | %{ 11 | %} 12 | 13 | evaluate_this = true; 14 | 15 | %{ 16 | Opening (%{) and closing (%}) block comment markers can be within a comment block 17 | %} 18 | 19 | evaluate_this = true; 20 | 21 | %{ 22 | Indented block comments can be indented 23 | or not 24 | and whitespace can be added before or after the %{ and %} 25 | %} 26 | 27 | evaluate_this = true; 28 | -------------------------------------------------------------------------------- /test/markup/maxima/numbers.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0. 3 | 12345. 4 | 12345 5 | 0.0 6 | 123.45 7 | 0e0 8 | 0b0 9 | 12345e0 10 | 12345e123 11 | 12345e-123 12 | 12345e+123 13 | 12345b0 14 | 12345b123 15 | 12345b-123 16 | 12345b+123 17 | 1.2345e0 18 | 1.2345e123 19 | 1.2345e-123 20 | 1.2345e+123 21 | 1.2345b0 22 | 1.2345b123 23 | 1.2345b-123 24 | 1.2345b+123 25 | -------------------------------------------------------------------------------- /test/markup/maxima/symbols.txt: -------------------------------------------------------------------------------- 1 | /* symbolic constants */ 2 | 3 | [true, false, unknown, inf, minf, ind, 4 | und, %e, %i, %pi, %phi, %gamma]; 5 | 6 | /* built-in variables */ 7 | 8 | [_, __, %, %%, linel, simp, dispflag, 9 | stringdisp, lispdisp, %edispflag]; 10 | 11 | /* built-in functions */ 12 | 13 | [sin, cosh, exp, atan2, sqrt, log, struve_h, 14 | sublist_indices, read_array]; 15 | 16 | /* user-defined symbols */ 17 | 18 | [foo, ?bar, baz%, quux_mumble_blurf]; 19 | -------------------------------------------------------------------------------- /test/markup/objectivec/preprocessor.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #define foo 1<<16 3 | 4 | #ifdef DEBUG 5 | TYPE1 foo(void) 6 | #else 7 | int foo(void) 8 | #endif 9 | { } 10 | 11 | #define x(v) ((v)) 12 | # define x(v) ((v)) 13 | # define x(v) ((v)) 14 | 15 | #if MACRO_WITH_STRING_ARG("hello \"world\"") 16 | #elif MULTI_LINE /* comment */ < \ 17 | EXPRESSION 18 | int bar; 19 | #endif // comment 20 | -------------------------------------------------------------------------------- /test/markup/objectivec/string-literals.txt: -------------------------------------------------------------------------------- 1 | const char *str = "Regular \"quoted\" string\n"; 2 | NSString *nsstr = @"Obj-C \"quoted\" string\n"; 3 | char c = 'c'; 4 | char c2 = '"'; 5 | char c3 = '\''; 6 | char c4 = '\n'; 7 | int multibyte_char = 'abcd'; 8 | -------------------------------------------------------------------------------- /test/markup/ocaml/literals.txt: -------------------------------------------------------------------------------- 1 | let i = 14 2 | let i = -14 3 | let i = 1_000 4 | let i = 0b100 5 | let i = 0x1FF 6 | let i = 0o777 7 | let i64 = 128L 8 | let i64 = 0b10L 9 | let i32 = 32l 10 | let i32 = 0x12l 11 | let nat = 10n 12 | let nat = 0o644n 13 | let f = 5. 14 | let f = 5.1 15 | let f = 1e+1 16 | let f = 1e1 17 | let f = 1e-1 18 | let f = 1_024e12 19 | let f = 1L 20 | 21 | let b = true || false 22 | let l = [] 23 | let a = [||] 24 | let () = ignore (b) 25 | 26 | let c = 'a' 27 | let c = '\xFF' 28 | let c = '\128' 29 | let c = '\n' 30 | -------------------------------------------------------------------------------- /test/markup/ocaml/types.txt: -------------------------------------------------------------------------------- 1 | (* type variables *) 2 | type 'a t = 'a list 3 | let f (a : 'a list) : 'a = List.hd a 4 | 5 | (* polymorphic variants *) 6 | type t = [ `A | `B ] 7 | 8 | (* variants *) 9 | type result = Sat | Unsat | Unknown 10 | 11 | (* module and module types *) 12 | module type S = sig 13 | val compute : unit -> unit 14 | end 15 | module Impl : S = struct 16 | let compute () = () 17 | end 18 | -------------------------------------------------------------------------------- /test/markup/pgsql/constraints.txt: -------------------------------------------------------------------------------- 1 | -- column_constraint, table_constraint: 2 | 3 | CONSTRAINT, 4 | NOT NULL, NULL, 5 | CHECK ( .. ) NO INHERIT, 6 | DEFAULT .., 7 | EXCLUDE USING .. ( .. WITH .. ) .. WHERE ( .. ), 8 | GENERATED ALWAYS AS IDENTITY, 9 | GENERATED ALWAYS AS IDENTITY ( .. ), 10 | GENERATED BY DEFAULT AS IDENTITY, 11 | UNIQUE .., UNIQUE ( .. ), 12 | PRIMARY KEY .., PRIMARY KEY ( .. ), 13 | REFERENCES, REFERENCES .. ( .. ), 14 | MATCH FULL, MATCH PARTIAL, MATCH SIMPLE, 15 | ON DELETE .., ON UPDATE .., 16 | DEFERRABLE, NOT DEFERRABLE, INITIALLY DEFERRED, INITIALLY IMMEDIATE, 17 | FOREIGN KEY ( .. ) REFERENCES, 18 | USING INDEX bar, 19 | INCLUDE ( .. ), 20 | WITH ( .. ), 21 | USING INDEX TABLESPACE; 22 | -------------------------------------------------------------------------------- /test/markup/php/comments.txt: -------------------------------------------------------------------------------- 1 | echo <<<EOT 2 | String with $var and {$foo->bar[1]}. 3 | EOT; 4 | 5 | echo <<<EOT 6 | string 7 | EOT 8 | still string 9 | EOT; 10 | 11 | array(<<<EOD 12 | foobar! 13 | EOD 14 | ); 15 | -------------------------------------------------------------------------------- /test/markup/php/heredoc.txt: -------------------------------------------------------------------------------- 1 | echo <<bar[1]}. 3 | EOT; 4 | 5 | echo << b or b < a then 4 | env.out.print("a is bigger") 5 | else 6 | env.out.print("b bigger") 7 | end 8 | 9 | while count <= 10 do 10 | env.out.print(count.string()) 11 | count = count + 1 12 | end 13 | 14 | for name in ["Bob"; "Fred"; "Sarah"].values() do 15 | env.out.print(name) 16 | end 17 | 18 | repeat 19 | env.out.print("hello!") 20 | counter = counter + 1 21 | until counter > 7 end -------------------------------------------------------------------------------- /test/markup/pony/creator.expect.txt: -------------------------------------------------------------------------------- 1 | new create(env: Env, name: String) => 2 | _env = env 3 | _name = name -------------------------------------------------------------------------------- /test/markup/pony/creator.txt: -------------------------------------------------------------------------------- 1 | new create(env: Env, name: String) => 2 | _env = env 3 | _name = name -------------------------------------------------------------------------------- /test/markup/pony/iterface-trait.txt: -------------------------------------------------------------------------------- 1 | interface Iterator[A: A] 2 | fun has_next(): Bool 3 | fun next(): T? 4 | 5 | trait UnitTest 6 | fun name(): String 7 | fun ref set_up(h: TestHelper) ? => 8 | None 9 | fun apply(h: TestHelper) ? -------------------------------------------------------------------------------- /test/markup/pony/lambda.expect.txt: -------------------------------------------------------------------------------- 1 | {(foo: I32)(bar): String => (foo + bar).string()} 2 | -------------------------------------------------------------------------------- /test/markup/pony/lambda.txt: -------------------------------------------------------------------------------- 1 | {(foo: I32)(bar): String => (foo + bar).string()} -------------------------------------------------------------------------------- /test/markup/pony/match.txt: -------------------------------------------------------------------------------- 1 | match foo 2 | | true => "it's true" 3 | | "bar" => "it's bar" 4 | | let x: I32 if x > 3 => "it's greater than 3" 5 | | let x: I32 => "it's less than or equal to 3" 6 | else 7 | "I don't know what it is" 8 | end -------------------------------------------------------------------------------- /test/markup/pony/method.expect.txt: -------------------------------------------------------------------------------- 1 | fun foo(bar: String): String => 2 | bar + "baz" 3 | 4 | new create(hunger: I32) => 5 | _hunger = hunger 6 | 7 | be feed(food: I32) => 8 | _hunger = _hunger - food -------------------------------------------------------------------------------- /test/markup/pony/method.txt: -------------------------------------------------------------------------------- 1 | fun foo(bar: String): String => 2 | bar + "baz" 3 | 4 | new create(hunger: I32) => 5 | _hunger = hunger 6 | 7 | be feed(food: I32) => 8 | _hunger = _hunger - food -------------------------------------------------------------------------------- /test/markup/pony/number-literals.txt: -------------------------------------------------------------------------------- 1 | let num: U32 = 42_000 2 | let num: U32 = 42_000_ 3 | let num: U32 = 42_000.234 4 | let num: U8 = 1 5 | let num: F32 = 1.234 6 | let num: I32 = 1024 7 | let num: I32 = -1024 8 | let num: I32 = 0x400 9 | let num: I32 = 0X400 10 | let num: I32 = 0b10101010 11 | let num: I32 = 0B1010101 12 | let num: F32 = 42.12e-4 13 | let num: F32 = 42.12E-4 14 | let num: F32 = 42.12e+4 15 | let num: F32 = 42.12E+4 16 | -------------------------------------------------------------------------------- /test/markup/pony/objects.txt: -------------------------------------------------------------------------------- 1 | primitive I32 is SignedInteger 2 | 3 | actor Main 4 | 5 | class ref List[A: A] is Seq[A] ref 6 | 7 | object is Hashable 8 | 9 | object iso 10 | 11 | primitive Foo is Bar iso -------------------------------------------------------------------------------- /test/markup/pony/prime.expect.txt: -------------------------------------------------------------------------------- 1 | new create(name': String) => 2 | name = name' + 'a' -------------------------------------------------------------------------------- /test/markup/pony/prime.txt: -------------------------------------------------------------------------------- 1 | new create(name': String) => 2 | name = name' + 'a' 3 | -------------------------------------------------------------------------------- /test/markup/pony/triple-quote.expect.txt: -------------------------------------------------------------------------------- 1 | """ 2 | A triple quoted string 3 | * Goes several lines 4 | * Keeps formatting 5 | """ -------------------------------------------------------------------------------- /test/markup/pony/triple-quote.txt: -------------------------------------------------------------------------------- 1 | """ 2 | A triple quoted string 3 | * Goes several lines 4 | * Keeps formatting 5 | """ -------------------------------------------------------------------------------- /test/markup/powershell/apos-herestring.expect.txt: -------------------------------------------------------------------------------- 1 | @' The wild cat jumped over the $height-tall fence. 2 | He did so with grace. 3 | '@ 4 | 5 | This SHOULDNT be a part of the above strings span. 6 | 7 | @' The wild cat jumped over the $height-tall fence. 8 | He did so with grace. 9 | break-end-of-string'@ 10 | 11 | This SHOULD be a part of the above strings span. -------------------------------------------------------------------------------- /test/markup/powershell/apos-herestring.txt: -------------------------------------------------------------------------------- 1 | @' The wild cat jumped over the $height-tall fence. 2 | He did so with grace. 3 | '@ 4 | 5 | This SHOULDNT be a part of the above strings span. 6 | 7 | @' The wild cat jumped over the $height-tall fence. 8 | He did so with grace. 9 | break-end-of-string'@ 10 | 11 | This SHOULD be a part of the above strings span. -------------------------------------------------------------------------------- /test/markup/powershell/quote-herestring.expect.txt: -------------------------------------------------------------------------------- 1 | @" The wild cat jumped over the $height-tall fence. 2 | He did so with grace. 3 | "@ 4 | 5 | This SHOULDNT be a part of the above strings span. 6 | 7 | @" The wild cat jumped over the $height-tall fence. 8 | He did so with grace. 9 | break-end-of-string"@ 10 | 11 | This SHOULD be a part of the above strings span. -------------------------------------------------------------------------------- /test/markup/powershell/quote-herestring.txt: -------------------------------------------------------------------------------- 1 | @" The wild cat jumped over the $height-tall fence. 2 | He did so with grace. 3 | "@ 4 | 5 | This SHOULDNT be a part of the above strings span. 6 | 7 | @" The wild cat jumped over the $height-tall fence. 8 | He did so with grace. 9 | break-end-of-string"@ 10 | 11 | This SHOULD be a part of the above strings span. -------------------------------------------------------------------------------- /test/markup/properties/syntax.txt: -------------------------------------------------------------------------------- 1 | # comment 2 | # comment 3 | ! comment 4 | ! comment 5 | key=val 6 | key = val 7 | key:val 8 | key : val 9 | key val 10 | key val 11 | key = val\ 12 | val 13 | key\ key\:\= val 14 | key 15 | -------------------------------------------------------------------------------- /test/markup/protobuf/message-message.expect.txt: -------------------------------------------------------------------------------- 1 | message Container { 2 | message Message { 3 | required int64 id = 1; 4 | } 5 | repeated Message messages = 1; 6 | optional int32 number = 2; 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/protobuf/message-message.txt: -------------------------------------------------------------------------------- 1 | message Container { 2 | message Message { 3 | required int64 id = 1; 4 | } 5 | repeated Message messages = 1; 6 | optional int32 number = 2; 7 | } 8 | -------------------------------------------------------------------------------- /test/markup/protobuf/rpc.expect.txt: -------------------------------------------------------------------------------- 1 | service Greeter { 2 | // Sends a greeting 3 | rpc SayHello (HelloRequest) returns (HelloReply) {} 4 | } 5 | -------------------------------------------------------------------------------- /test/markup/protobuf/rpc.txt: -------------------------------------------------------------------------------- 1 | service Greeter { 2 | // Sends a greeting 3 | rpc SayHello (HelloRequest) returns (HelloReply) {} 4 | } 5 | -------------------------------------------------------------------------------- /test/markup/python-repl/sample.txt: -------------------------------------------------------------------------------- 1 | >>> v = "foo = 42" 2 | >>> v 3 | "foo = 42" 4 | >>> print(v) 5 | foo = 42 6 | >>> print(repr(v).rstrip('"')) 7 | "foo = 42 8 | >>> print(repr(v).lstrip('"')) 9 | foo = 42" 10 | 11 | >>> """ 12 | ... abc 13 | ... """ 14 | >>> def test(): 15 | ... pass 16 | >>> 17 | >>> 18 | -------------------------------------------------------------------------------- /test/markup/python/f-strings.txt: -------------------------------------------------------------------------------- 1 | f'{name}' 2 | f"{name + 5}" 3 | >>> f""" 4 | ... { 5 | ... name 6 | ... } 7 | ... """ 8 | rf"{name}" 9 | fr"{name}" 10 | f"{name + f'{name}'}" 11 | f"{{ }}" 12 | if"text"=="text": 13 | "good" 14 | -------------------------------------------------------------------------------- /test/markup/python/function-header-comments.expect.txt: -------------------------------------------------------------------------------- 1 | def foo( 2 | bar, # commment 3 | ): 4 | pass 5 | 6 | 7 | class Foo(collections.namedtuple('Test'), ( 8 | 'name', # comment 9 | )): 10 | pass -------------------------------------------------------------------------------- /test/markup/python/function-header-comments.txt: -------------------------------------------------------------------------------- 1 | def foo( 2 | bar, # commment 3 | ): 4 | pass 5 | 6 | 7 | class Foo(collections.namedtuple('Test'), ( 8 | 'name', # comment 9 | )): 10 | pass 11 | -------------------------------------------------------------------------------- /test/markup/python/function-header.expect.txt: -------------------------------------------------------------------------------- 1 | def f(x: int) -> None: 2 | pass 3 | -------------------------------------------------------------------------------- /test/markup/python/function-header.txt: -------------------------------------------------------------------------------- 1 | def f(x: int) -> None: 2 | pass 3 | -------------------------------------------------------------------------------- /test/markup/python/matrix-multiplication.expect.txt: -------------------------------------------------------------------------------- 1 | @meta 2 | class C: 3 | 4 | @decorator 5 | def f(self, H, V, beta, r): 6 | S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) 7 | return S 8 | -------------------------------------------------------------------------------- /test/markup/python/matrix-multiplication.txt: -------------------------------------------------------------------------------- 1 | @meta 2 | class C: 3 | 4 | @decorator 5 | def f(self, H, V, beta, r): 6 | S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r) 7 | return S 8 | -------------------------------------------------------------------------------- /test/markup/reasonml/modules.txt: -------------------------------------------------------------------------------- 1 | let decode = json => 2 | Json.Decode.{ 3 | query: json |> field("query", string), 4 | cacheKey: json |> field("cacheKey", string), 5 | desc: json |> field("desc", string), 6 | lambda: json |> field("lambda", string), 7 | }; 8 | 9 | Some.Bucket.Of.( 10 | let value = stuff(); 11 | ); 12 | 13 | let value = Some.Bucket.Of.stuff(); 14 | 15 | module type RewiredModule = { 16 | type t = { 17 | name: string 18 | }; 19 | }; -------------------------------------------------------------------------------- /test/markup/reasonml/pattern-matching.txt: -------------------------------------------------------------------------------- 1 | let message = 2 | switch (person1) { 3 | | School.Teacher => "Hello teacher!" 4 | | School.Director => "Hello director!" 5 | }; 6 | 7 | let message = 8 | School.( 9 | switch (person1) { 10 | | Teacher => "Hello teacher!" 11 | | Director => "Hello director!" 12 | } 13 | ); 14 | 15 | let readCacheServiceConfigAndDecode = (configJson) => 16 | switch (configJson |> Js.Json.decodeObject) { 17 | | None => raise(Json.Decode.DecodeError("Invalid Cache Config")) 18 | | Some(data) => 19 | data |> Js.Dict.map((. json) => CachingServiceConfig.decode(json)) 20 | }; 21 | -------------------------------------------------------------------------------- /test/markup/ruby/gemfile.expect.txt: -------------------------------------------------------------------------------- 1 | gem "gem_name1", ">= 4.1" 2 | 3 | gem "gem_name2", "~> 4.1" 4 | -------------------------------------------------------------------------------- /test/markup/ruby/gemfile.txt: -------------------------------------------------------------------------------- 1 | gem "gem_name1", ">= 4.1" 2 | 3 | gem "gem_name2", "~> 4.1" 4 | -------------------------------------------------------------------------------- /test/markup/ruby/heredoc.txt: -------------------------------------------------------------------------------- 1 | def foo() 2 | msg = <<-HTML 3 |
    4 |

    #{bar}

    5 |
    6 | HTML 7 | end 8 | 9 | def baz() 10 | msg = <<~FOO 11 |
    12 |

    #{bar}

    13 |
    14 | FOO 15 | end -------------------------------------------------------------------------------- /test/markup/ruby/prompt.txt: -------------------------------------------------------------------------------- 1 | 2.0.0p0 :001 > ['some'] 2 | => ["some"] 3 | 2.0.0p0 :002 > if true 4 | 2.0.0p0 :003?> "yop" 5 | 2.0.0p0 :004?> end 6 | => "yop" 7 | 8 | jruby-1.7.16 :001 > "RVM-Format" 9 | 10 | >> obj = OpenStruct.new :integer => 987, :symbol => :so_great 11 | => # 12 | >> [obj,obj,obj] 13 | => [#, #, #] 14 | >> {1 => obj, 2 => obj} 15 | => {1=>#, 2=>#} 16 | >> if 10 > 20 17 | >> "YEAH" 18 | >> else 19 | ?> "NO" 20 | >> end 21 | => "NO" 22 | 23 | irb(main):002:0> test = 1 24 | -------------------------------------------------------------------------------- /test/markup/ruby/regexes.expect.txt: -------------------------------------------------------------------------------- 1 | str =~ /^(?:foo)$/ 2 | str =~ %r{foo|bar|buz$} 3 | str =~ %r!foo|bar$! 4 | str =~ %r[foo|bar$] 5 | str =~ %r(\(foo|bar\)$) 6 | -------------------------------------------------------------------------------- /test/markup/ruby/regexes.txt: -------------------------------------------------------------------------------- 1 | str =~ /^(?:foo)$/ 2 | str =~ %r{foo|bar|buz$} 3 | str =~ %r!foo|bar$! 4 | str =~ %r[foo|bar$] 5 | str =~ %r(\(foo|bar\)$) 6 | -------------------------------------------------------------------------------- /test/markup/rust/comments.expect.txt: -------------------------------------------------------------------------------- 1 | /* rust has 2 | /* nested /* block */ */ 3 | */ comments 4 | -------------------------------------------------------------------------------- /test/markup/rust/comments.txt: -------------------------------------------------------------------------------- 1 | /* rust has 2 | /* nested /* block */ */ 3 | */ comments 4 | -------------------------------------------------------------------------------- /test/markup/rust/numbers.expect.txt: -------------------------------------------------------------------------------- 1 | 123; 2 | 123usize; 3 | 123_usize; 4 | 0xff00; 5 | 0xff_u8; 6 | 0b1111111110010000; 7 | 0b1111_1111_1001_0000_i32; 8 | 0o764317; 9 | 0o764317_u16; 10 | 123.0; 11 | 0.1; 12 | 0.1f32; 13 | 12E+99_f64; 14 | -------------------------------------------------------------------------------- /test/markup/rust/numbers.txt: -------------------------------------------------------------------------------- 1 | 123; 2 | 123usize; 3 | 123_usize; 4 | 0xff00; 5 | 0xff_u8; 6 | 0b1111111110010000; 7 | 0b1111_1111_1001_0000_i32; 8 | 0o764317; 9 | 0o764317_u16; 10 | 123.0; 11 | 0.1; 12 | 0.1f32; 13 | 12E+99_f64; 14 | -------------------------------------------------------------------------------- /test/markup/rust/strings.expect.txt: -------------------------------------------------------------------------------- 1 | 'a'; 2 | '\n'; 3 | '\x1A'; 4 | '\u12AS'; 5 | '\U1234ASDF'; 6 | b'a'; 7 | 8 | "hello"; 9 | b"hello"; 10 | 11 | r"hello"; 12 | r###"world"###; 13 | r##" "### 14 | "# "##; 15 | -------------------------------------------------------------------------------- /test/markup/rust/strings.txt: -------------------------------------------------------------------------------- 1 | 'a'; 2 | '\n'; 3 | '\x1A'; 4 | '\u12AS'; 5 | '\U1234ASDF'; 6 | b'a'; 7 | 8 | "hello"; 9 | b"hello"; 10 | 11 | r"hello"; 12 | r###"world"###; 13 | r##" "### 14 | "# "##; 15 | -------------------------------------------------------------------------------- /test/markup/rust/traits.expect.txt: -------------------------------------------------------------------------------- 1 | fn sqr(i: i32) { i * i } 2 | trait Minimum : Copy {} 3 | pub trait Builder where Self: Sized + Iterator<Item=Event> {} 4 | -------------------------------------------------------------------------------- /test/markup/rust/traits.txt: -------------------------------------------------------------------------------- 1 | fn sqr(i: i32) { i * i } 2 | trait Minimum : Copy {} 3 | pub trait Builder where Self: Sized + Iterator {} 4 | -------------------------------------------------------------------------------- /test/markup/rust/types.expect.txt: -------------------------------------------------------------------------------- 1 | type A: Trait; 2 | type A; 3 | type A = B; 4 | type R<T> = m::R<T, ConcreteError> 5 | -------------------------------------------------------------------------------- /test/markup/rust/types.txt: -------------------------------------------------------------------------------- 1 | type A: Trait; 2 | type A; 3 | type A = B; 4 | type R = m::R 5 | -------------------------------------------------------------------------------- /test/markup/rust/variables.expect.txt: -------------------------------------------------------------------------------- 1 | let foo; 2 | let mut bar; 3 | let _foo_bar; 4 | -------------------------------------------------------------------------------- /test/markup/rust/variables.txt: -------------------------------------------------------------------------------- 1 | let foo; 2 | let mut bar; 3 | let _foo_bar; 4 | -------------------------------------------------------------------------------- /test/markup/scala/case-classes.txt: -------------------------------------------------------------------------------- 1 | abstract class Vertical extends CaseJeu 2 | case class Haut(name: String) extends Vertical 3 | case class Bas(name: String) extends Vertical 4 | -------------------------------------------------------------------------------- /test/markup/scheme/lambda.expect.txt: -------------------------------------------------------------------------------- 1 | (lambda (x y z) (+ y z)) 2 | -------------------------------------------------------------------------------- /test/markup/scheme/lambda.txt: -------------------------------------------------------------------------------- 1 | (lambda (x y z) (+ y z)) 2 | -------------------------------------------------------------------------------- /test/markup/scheme/quoted.expect.txt: -------------------------------------------------------------------------------- 1 | (scheme 'a '(a quoted (list)) `(quoted)) 2 | -------------------------------------------------------------------------------- /test/markup/scheme/quoted.txt: -------------------------------------------------------------------------------- 1 | (scheme 'a '(a quoted (list)) `(quoted)) 2 | -------------------------------------------------------------------------------- /test/markup/shell/plain-prompt.expect.txt: -------------------------------------------------------------------------------- 1 | > foo 2 | > /bin/sh 3 | -------------------------------------------------------------------------------- /test/markup/shell/plain-prompt.txt: -------------------------------------------------------------------------------- 1 | > foo 2 | > /bin/sh 3 | -------------------------------------------------------------------------------- /test/markup/sql/interval.txt: -------------------------------------------------------------------------------- 1 | SELECT 2 | CURRENT_TIMESTAMP 3 | - INTERVAL 2 YEARS 4 | + INTERVAL 1 MONTH 5 | - INTERVAL 3 DAYS 6 | + INTERVAL 10 HOURS 7 | + interval 30 MINUTES 8 | - INTERVAL 20 SECOND AS past_timestamp 9 | FROM VALUES ("dummy"); 10 | 11 | WITH ts AS ( 12 | SELECT CURRENT_TIMESTAMP AS now FROM VALUES ('dummy') 13 | ) 14 | SELECT 15 | now - INTERVAL 1 DAY - INTERVAL 2 HOURS - INTERVAL 3 MINUTES - INTERVAL 4 SECONDS AS LONG_VERSION, 16 | now - INTERVAL '1 2:3:4.100' DAY TO SECOND AS SHORT_VERSION 17 | FROM ts; 18 | -------------------------------------------------------------------------------- /test/markup/sql/join.txt: -------------------------------------------------------------------------------- 1 | SELECT 2 | left_table.col1 AS l_col1, 3 | left_table.col2 AS l_col2 4 | FROM 5 | VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table 6 | ANTI JOIN 7 | VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table 8 | ON left_table.col1 = right_table.col1; 9 | 10 | SELECT 11 | left_table.col1 AS l_col1, 12 | left_table.col2 AS l_col2 13 | FROM 14 | VALUES (0, 10), (1, 11), (2, 12), (3,13), (4, 14), (5, 14) AS left_table 15 | LEFT SEMI JOIN 16 | VALUES (0, 10), (2, 12), (4, 14), (6, 16) AS right_table 17 | ON left_table.col1 = right_table.col1; 18 | -------------------------------------------------------------------------------- /test/markup/sql/keywords.expect.txt: -------------------------------------------------------------------------------- 1 | select * from t where t.select is null; 2 | -------------------------------------------------------------------------------- /test/markup/sql/keywords.txt: -------------------------------------------------------------------------------- 1 | select * from t where t.select is null; 2 | -------------------------------------------------------------------------------- /test/markup/sql/lateral-view.txt: -------------------------------------------------------------------------------- 1 | SELECT 2 | master_child.col1 AS master_id, 3 | child_table.child_id 4 | FROM VALUES 5 | ( 1 , ARRAY(1,2,3)), 6 | (2, ARRAY(4,5,6)) AS master_child 7 | LATERAL VIEW EXPLODE(master_child.col2) child_table AS child_id; 8 | -------------------------------------------------------------------------------- /test/markup/sql/numeric-types.expect.txt: -------------------------------------------------------------------------------- 1 | SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); 2 | -------------------------------------------------------------------------------- /test/markup/sql/numeric-types.txt: -------------------------------------------------------------------------------- 1 | SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy'); 2 | -------------------------------------------------------------------------------- /test/markup/sql/set-operator.expect.txt: -------------------------------------------------------------------------------- 1 | SELECT * FROM VALUES 1, 2 ,3 UNION ALL VALUES 1, 2, 3; 2 | -------------------------------------------------------------------------------- /test/markup/sql/set-operator.txt: -------------------------------------------------------------------------------- 1 | SELECT * FROM VALUES 1, 2 ,3 UNION ALL VALUES 1, 2, 3; 2 | -------------------------------------------------------------------------------- /test/markup/sql/string-types.expect.txt: -------------------------------------------------------------------------------- 1 | SELECT '\'; 2 | 3 | SELECT "\"; 4 | 5 | SELECT `\`; 6 | -------------------------------------------------------------------------------- /test/markup/sql/string-types.txt: -------------------------------------------------------------------------------- 1 | SELECT '\'; 2 | 3 | SELECT "\"; 4 | 5 | SELECT `\`; 6 | -------------------------------------------------------------------------------- /test/markup/sql/tablesample.txt: -------------------------------------------------------------------------------- 1 | SELECT * FROM orders TABLESAMPLE (500 ROWS); 2 | 3 | SELECT * FROM customers TABLESAMPLE (25 PERCENT); 4 | 5 | SELECT * FROM employees TABLESAMPLE (BUCKET 2 OUT OF 10); 6 | -------------------------------------------------------------------------------- /test/markup/sql/values-statement.expect.txt: -------------------------------------------------------------------------------- 1 | VALUES 1, 2 , 3; 2 | 3 | VALUES 4 | (1, 'Spock'), 5 | (2,'Kirk') , 6 | (3, 'McCoy'), 7 | (4,'Scotty'); 8 | -------------------------------------------------------------------------------- /test/markup/sql/values-statement.txt: -------------------------------------------------------------------------------- 1 | VALUES 1, 2 , 3; 2 | 3 | VALUES 4 | (1, 'Spock'), 5 | (2,'Kirk') , 6 | (3, 'McCoy'), 7 | (4,'Scotty'); 8 | -------------------------------------------------------------------------------- /test/markup/sql/window-function.txt: -------------------------------------------------------------------------------- 1 | SELECT * 2 | FROM ( 3 | SELECT 4 | posts.col1 AS emp_id, 5 | posts.col2 AS dept_id, 6 | posts.col3 AS posts, 7 | DENSE_RANK() OVER post_ranking AS rank 8 | FROM VALUES 9 | (1, 1 ,100), 10 | (2, 1 ,50), 11 | (8, 1 ,250), 12 | (3, 2 ,200), 13 | (4, 2 ,300), 14 | (9, 2 ,1000), 15 | (5, 3 ,300), 16 | (6, 3 ,100), 17 | (7, 3 ,400) AS posts 18 | WINDOW post_ranking AS ( 19 | PARTITION BY posts.col2 20 | ORDER BY posts.col3 DESC 21 | ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) 22 | ) 23 | WHERE rank <= 2; 24 | -------------------------------------------------------------------------------- /test/markup/stata/built_ins.expect.txt: -------------------------------------------------------------------------------- 1 | local b1 = ln(`or') 2 | generate logit1 = log( pgty1 / ( 1 - pgty1)) 3 | generate logit2 = log( pgty2 / ( 1 - pgty2)) 4 | -------------------------------------------------------------------------------- /test/markup/stata/built_ins.txt: -------------------------------------------------------------------------------- 1 | local b1 = ln(`or') 2 | generate logit1 = log( pgty1 / ( 1 - pgty1)) 3 | generate logit2 = log( pgty2 / ( 1 - pgty2)) 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-errorline.expect.txt: -------------------------------------------------------------------------------- 1 | error: test simplename 2 | error: test simple name 3 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-errorline.txt: -------------------------------------------------------------------------------- 1 | error: test simplename 2 | error: test simple name 3 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-failureline.expect.txt: -------------------------------------------------------------------------------- 1 | failure: test simplename1 2 | failure test simplename1 3 | failure: test simple name1 4 | failure test simple name1 5 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-failureline.txt: -------------------------------------------------------------------------------- 1 | failure: test simplename1 2 | failure test simplename1 3 | failure: test simple name1 4 | failure test simple name1 5 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-progressline.expect.txt: -------------------------------------------------------------------------------- 1 | progress: +5 2 | progress: +12 3 | progress: 29 4 | progress: -3 5 | progress: -91 6 | progress: push 7 | progress: pop 8 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-progressline.txt: -------------------------------------------------------------------------------- 1 | progress: +5 2 | progress: +12 3 | progress: 29 4 | progress: -3 5 | progress: -91 6 | progress: push 7 | progress: pop 8 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-skipline.expect.txt: -------------------------------------------------------------------------------- 1 | skip test simplename 2 | skip: test simple name 3 | skip test simple name 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-skipline.txt: -------------------------------------------------------------------------------- 1 | skip test simplename 2 | skip: test simple name 3 | skip test simple name 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-successline.expect.txt: -------------------------------------------------------------------------------- 1 | success test simplename1 2 | success: test simplename2 3 | successful test simplename3 4 | successful: test simplename4 5 | success test simple name1 6 | success: test simple name2 7 | successful test simple name3 8 | successful: test simple name4 9 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-successline.txt: -------------------------------------------------------------------------------- 1 | success test simplename1 2 | success: test simplename2 3 | successful test simplename3 4 | successful: test simplename4 5 | success test simple name1 6 | success: test simple name2 7 | successful test simple name3 8 | successful: test simple name4 9 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-tagline.expect.txt: -------------------------------------------------------------------------------- 1 | tags: fuzz unit beta functional 2 | tags: -functional basic -beta 3 | tags: -unit 4 | tags: unit 5 | tags: ddd 6 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-tagline.txt: -------------------------------------------------------------------------------- 1 | tags: fuzz unit beta functional 2 | tags: -functional basic -beta 3 | tags: -unit 4 | tags: unit 5 | tags: ddd 6 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-testline.expect.txt: -------------------------------------------------------------------------------- 1 | test: test basicsuite1 2 | testing: test basicsuite1 3 | test test basicsuite1 4 | testing test basicsuite1 5 | test: test basic suite1 6 | testing: test basic suite1 7 | test test basic suite1 8 | testing test basic suite1 9 | testing test basic 10 | test test 222 11 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-testline.txt: -------------------------------------------------------------------------------- 1 | test: test basicsuite1 2 | testing: test basicsuite1 3 | test test basicsuite1 4 | testing test basicsuite1 5 | test: test basic suite1 6 | testing: test basic suite1 7 | test test basic suite1 8 | testing test basic suite1 9 | testing test basic 10 | test test 222 11 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-timeline.expect.txt: -------------------------------------------------------------------------------- 1 | time: 2016-03-13 18:12:37.231080Z 2 | time: 1917-10-25 09:05:37.231080Z 3 | time: 1984-03-24 07:02:09.231080Z 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-timeline.txt: -------------------------------------------------------------------------------- 1 | time: 2016-03-13 18:12:37.231080Z 2 | time: 1917-10-25 09:05:37.231080Z 3 | time: 1984-03-24 07:02:09.231080Z 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-uxsuccessline.expect.txt: -------------------------------------------------------------------------------- 1 | uxsuccess test simplename 2 | uxsuccess: test simple name 3 | uxsuccess test simple name 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-uxsuccessline.txt: -------------------------------------------------------------------------------- 1 | uxsuccess test simplename 2 | uxsuccess: test simple name 3 | uxsuccess test simple name 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-xfailline.expect.txt: -------------------------------------------------------------------------------- 1 | xfail test simplename 2 | xfail: test simple name 3 | xfail test simple name 4 | -------------------------------------------------------------------------------- /test/markup/subunit/subunit-xfailline.txt: -------------------------------------------------------------------------------- 1 | xfail test simplename 2 | xfail: test simple name 3 | xfail test simple name 4 | -------------------------------------------------------------------------------- /test/markup/swift/functions.txt: -------------------------------------------------------------------------------- 1 | protocol Protocol { 2 | func f1() 3 | func f2() 4 | } 5 | 6 | class MyClass { 7 | func f() { 8 | return true 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/markup/swift/multiline-string.expect.txt: -------------------------------------------------------------------------------- 1 | var string = """ 2 | var a = not actually code 3 | """ -------------------------------------------------------------------------------- /test/markup/swift/multiline-string.txt: -------------------------------------------------------------------------------- 1 | var string = """ 2 | var a = not actually code 3 | """ -------------------------------------------------------------------------------- /test/markup/tap/basic.expect.txt: -------------------------------------------------------------------------------- 1 | 1..4 2 | ok 1 - Input file opened 3 | not ok 2 - First line of the input valid 4 | ok 3 - Read the rest of the file 5 | not ok 4 - Summarized correctly # TODO Not written yet 6 | -------------------------------------------------------------------------------- /test/markup/tap/basic.txt: -------------------------------------------------------------------------------- 1 | 1..4 2 | ok 1 - Input file opened 3 | not ok 2 - First line of the input valid 4 | ok 3 - Read the rest of the file 5 | not ok 4 - Summarized correctly # TODO Not written yet 6 | -------------------------------------------------------------------------------- /test/markup/tap/without-numbers.expect.txt: -------------------------------------------------------------------------------- 1 | 1..6 2 | not ok 3 | ok 4 | not ok 5 | ok 6 | ok 7 | -------------------------------------------------------------------------------- /test/markup/tap/without-numbers.txt: -------------------------------------------------------------------------------- 1 | 1..6 2 | not ok 3 | ok 4 | not ok 5 | ok 6 | ok 7 | -------------------------------------------------------------------------------- /test/markup/tap/yaml-block.txt: -------------------------------------------------------------------------------- 1 | TAP version 13 2 | ok - created Board 3 | ok 4 | ok 5 | ok 6 | ok 7 | ok 8 | ok 9 | ok 10 | --- 11 | message: "Board layout" 12 | severity: comment 13 | dump: 14 | board: 15 | - ' 16G 05C ' 16 | - ' G N C C C G ' 17 | - ' G C + ' 18 | - '10C 01G 03C ' 19 | - 'R N G G A G C C C ' 20 | - ' R G C + ' 21 | - ' 01G 17C 00C ' 22 | - ' G A G G N R R N R ' 23 | - ' G R G ' 24 | ... 25 | ok - board has 7 tiles + starter tile 26 | 1..9 27 | -------------------------------------------------------------------------------- /test/markup/twig/filter_with_underscore.expect.txt: -------------------------------------------------------------------------------- 1 | {{ "string with spaces"|url_encode }} 2 | -------------------------------------------------------------------------------- /test/markup/twig/filter_with_underscore.txt: -------------------------------------------------------------------------------- 1 | {{ "string with spaces"|url_encode }} -------------------------------------------------------------------------------- /test/markup/twig/template_tags.txt: -------------------------------------------------------------------------------- 1 | {% if posts|length %} 2 | {% for article in articles %} 3 | <div> 4 | {{ article.title|upper() }} 5 | 6 | {# outputs 'WELCOME' #} 7 | </div> 8 | {% endfor %} 9 | {% endif %} 10 | 11 | {% set user = json_encode(user) %} 12 | -------------------------------------------------------------------------------- /test/markup/typescript/class.expect.txt: -------------------------------------------------------------------------------- 1 | class Car extends Vehicle { 2 | constructor(speed, cost) { 3 | super(speed); 4 | 5 | var c = Symbol('cost'); 6 | this[c] = cost; 7 | 8 | this.intro = `This is a car runs at 9 | ${speed}.`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/markup/typescript/class.txt: -------------------------------------------------------------------------------- 1 | class Car extends Vehicle { 2 | constructor(speed, cost) { 3 | super(speed); 4 | 5 | var c = Symbol('cost'); 6 | this[c] = cost; 7 | 8 | this.intro = `This is a car runs at 9 | ${speed}.`; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/markup/typescript/declares.expect.txt: -------------------------------------------------------------------------------- 1 | export declare class CommandHandler extends EventEmitter { 2 | 3 | constructor(config: CommandHandlerConfig); 4 | /** 5 | * Install the handler onto Discord.js 6 | * @param client - Client to handle 7 | */ 8 | } 9 | -------------------------------------------------------------------------------- /test/markup/typescript/declares.txt: -------------------------------------------------------------------------------- 1 | export declare class CommandHandler extends EventEmitter { 2 | 3 | constructor(config: CommandHandlerConfig); 4 | /** 5 | * Install the handler onto Discord.js 6 | * @param client - Client to handle 7 | */ 8 | } 9 | -------------------------------------------------------------------------------- /test/markup/typescript/decorator-factories.txt: -------------------------------------------------------------------------------- 1 | @foo('foo') 2 | export class MyClass { 3 | @baz(123) 4 | private myAttribute: string; 5 | 6 | constructor(@bar(true) private x, 7 | @bar(qux(quux(true))) private y) { } 8 | 9 | @bar() 10 | private myMethod(@bar() z) { 11 | console.log('Hello world.'); 12 | } 13 | } -------------------------------------------------------------------------------- /test/markup/typescript/functions.txt: -------------------------------------------------------------------------------- 1 | var noop = function() {}; 2 | 3 | var identity = function(foo) { 4 | return foo; 5 | }; 6 | 7 | function println(value: string); 8 | 9 | function getArray(): number[] { 10 | return [1, 2]; 11 | } 12 | 13 | type Foo = { 14 | functionInFoo(): void; 15 | }; 16 | -------------------------------------------------------------------------------- /test/markup/typescript/inline-languages.txt: -------------------------------------------------------------------------------- 1 | let foo = true; 2 | `hello ${foo ? `Mr ${name}` : 'there'}`; 3 | foo = false; 4 | 5 | html`
    Hello world
    `; 6 | 7 | html`
    Hello times ${10} world
    `; 8 | 9 | html` 10 |
      11 | ${repeat(['a', 'b', 'c'], (v) => { 12 | return html`
    • ${v}
    • `; 13 | }} 14 |
    15 | `; 16 | 17 | css` 18 | body { 19 | color: red; 20 | } 21 | `; 22 | 23 | // Ensure that we're back in TypeScript mode. 24 | var foo = 10; 25 | -------------------------------------------------------------------------------- /test/markup/typescript/module-id.expect.txt: -------------------------------------------------------------------------------- 1 | @Component({ 2 | selector: 'my-example', 3 | directives: [SomeDirective], 4 | templateUrl: './my-example.component.html', 5 | moduleId: module.id, 6 | styles: [` 7 | .my-example { 8 | padding: 5px; 9 | } 10 | `] 11 | }) 12 | export class MyExampleComponent { 13 | someProp: string = "blah"; 14 | } 15 | -------------------------------------------------------------------------------- /test/markup/typescript/module-id.txt: -------------------------------------------------------------------------------- 1 | @Component({ 2 | selector: 'my-example', 3 | directives: [SomeDirective], 4 | templateUrl: './my-example.component.html', 5 | moduleId: module.id, 6 | styles: [` 7 | .my-example { 8 | padding: 5px; 9 | } 10 | `] 11 | }) 12 | export class MyExampleComponent { 13 | someProp: string = "blah"; 14 | } -------------------------------------------------------------------------------- /test/markup/typescript/nested-templates.expect.txt: -------------------------------------------------------------------------------- 1 | let foo = true; 2 | `hello ${foo ? `Mr ${name}` : 'there'}`; 3 | foo = false; 4 | -------------------------------------------------------------------------------- /test/markup/typescript/nested-templates.txt: -------------------------------------------------------------------------------- 1 | let foo = true; 2 | `hello ${foo ? `Mr ${name}` : 'there'}`; 3 | foo = false; 4 | -------------------------------------------------------------------------------- /test/markup/verilog/numbers.expect.txt: -------------------------------------------------------------------------------- 1 | a = 'hff; 2 | A = 'HFF; 3 | b = 8'h33; 4 | B = 8'H33; 5 | c = 12; 6 | d = 'o755; 7 | e = 8'b1001_0001; 8 | f = 8'b1111zzzx; 9 | -------------------------------------------------------------------------------- /test/markup/verilog/numbers.txt: -------------------------------------------------------------------------------- 1 | a = 'hff; 2 | A = 'HFF; 3 | b = 8'h33; 4 | B = 8'H33; 5 | c = 12; 6 | d = 'o755; 7 | e = 8'b1001_0001; 8 | f = 8'b1111zzzx; 9 | -------------------------------------------------------------------------------- /test/markup/vim/strings-comments.expect.txt: -------------------------------------------------------------------------------- 1 | " comment 2 | let one = "string" " comment 3 | let two = "crazy 4 | \ string with a \" quote" 5 | -------------------------------------------------------------------------------- /test/markup/vim/strings-comments.txt: -------------------------------------------------------------------------------- 1 | " comment 2 | let one = "string" " comment 3 | let two = "crazy 4 | \ string with a \" quote" 5 | -------------------------------------------------------------------------------- /test/markup/x86asm/labels-directives.expect.txt: -------------------------------------------------------------------------------- 1 | .cfi_startproc 2 | _ZN3lib13is_whitespace17h28afa23272bf056bE: 3 | .align 16, 0x90 4 | ja .Lfunc_end0 5 | .Lfunc_end0: 6 | ret 7 | -------------------------------------------------------------------------------- /test/markup/x86asm/labels-directives.txt: -------------------------------------------------------------------------------- 1 | .cfi_startproc 2 | _ZN3lib13is_whitespace17h28afa23272bf056bE: 3 | .align 16, 0x90 4 | ja .Lfunc_end0 5 | .Lfunc_end0: 6 | ret 7 | -------------------------------------------------------------------------------- /test/markup/xml/space-attributes.expect.txt: -------------------------------------------------------------------------------- 1 | <img src ="/pics/foo.jpg"> 2 | <img src= "/pics/foo.jpg"> 3 | <img src = "/pics/foo.jpg"> 4 | -------------------------------------------------------------------------------- /test/markup/xml/space-attributes.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/markup/xml/unquoted-attributes.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/markup/xquery/computed_inbuilt.txt: -------------------------------------------------------------------------------- 1 | xquery version "3.1"; 2 | let $root := element {fn:node-name($e)} 3 | {$e/@*, 2 * fn:data($e)} 4 | 5 | for $node in root($root) 6 | return 7 | element root { root ($node)/text(), attribute root {'root'}, 8 | element not-root{attribute type{"root"}, root($root)} 9 | } 10 | -------------------------------------------------------------------------------- /test/markup/xquery/direct_method.txt: -------------------------------------------------------------------------------- 1 | xquery version "3.1"; 2 | let $var := "rooting" out 1 or 2 root causes 3 | return 4 | 5 | disable highlight for a name such as root { 6 | for $name in $var 7 | return 8 | $name as xs:string 9 | } 10 | return to unhighlighted order of things. 11 | "rooting" out root causes 12 | 13 | -------------------------------------------------------------------------------- /test/markup/xquery/function_body.txt: -------------------------------------------------------------------------------- 1 | declare function local:test ($node as node()) as element(div) { 2 | for $n in $node 3 | return 4 | element div { switch($n) 5 | case 'abc' return 'OK' 6 | default return 2 7 | } 8 | }; 9 | for $x in 1 to 3 10 | return 11 | local:test(abc) 12 | -------------------------------------------------------------------------------- /test/markup/xquery/prolog_declarations.txt: -------------------------------------------------------------------------------- 1 | xquery version "3.1"; 2 | (:~ 3 | : @author Duncan Paterson 4 | : @version 1.0:) 5 | 6 | module namespace app="http://none"; 7 | 8 | import module namespace config="http://config" at "config.xqm"; (: schema :) 9 | 10 | 11 | declare copy-namespaces no-preserve, inherit; 12 | (: switch to preserve, no-inherit:) 13 | 14 | declare %private variable $app:maxItems := 12; 15 | declare context item := doc("catalog.xml"); 16 | 17 | declare %templates:wrap-all function app:helloworld($node as node(), $model as map(*), $name as xs:string?) { 18 | if ($name) then 19 |

    Hello {$name}!

    20 | else 21 | () 22 | }; 23 | -------------------------------------------------------------------------------- /test/markup/yaml/keys.txt: -------------------------------------------------------------------------------- 1 | someKey: 2 | anotherKey: value 3 | 4 | some_key: 5 | another_key: value 6 | 7 | some key: 8 | another key: value 9 | 10 | "some key": 11 | "another key": value 12 | 13 | 'some key': 14 | 'another key': value 15 | 16 | some-key: 17 | another-key: value 18 | 19 | some.key: 20 | another.key: value 21 | 22 | 23 | parentKey: 24 | - subKey: 25 | subValue 26 | - sub key: 27 | sub value 28 | 29 | https://url.as.a.key/: 30 | - some value 31 | 32 | someKey: https://url.as.a.value/ 33 | -------------------------------------------------------------------------------- /test/markup/yaml/numbers.expect.txt: -------------------------------------------------------------------------------- 1 | key: 1234 2 | not_hex: 999fff 3 | hex: 0x999fff 4 | numkey999: 1234 5 | exp: -2.3e-5 6 | -------------------------------------------------------------------------------- /test/markup/yaml/numbers.txt: -------------------------------------------------------------------------------- 1 | key: 1234 2 | not_hex: 999fff 3 | hex: 0x999fff 4 | numkey999: 1234 5 | exp: -2.3e-5 6 | -------------------------------------------------------------------------------- /test/markup/yaml/string.expect.txt: -------------------------------------------------------------------------------- 1 | key: value 2 | key: 'some value' 3 | key: "some value" 4 | key: | 5 | multi-string 6 | value 7 | key: true 8 | -------------------------------------------------------------------------------- /test/markup/yaml/string.txt: -------------------------------------------------------------------------------- 1 | key: value 2 | key: 'some value' 3 | key: "some value" 4 | key: | 5 | multi-string 6 | value 7 | key: true 8 | -------------------------------------------------------------------------------- /test/markup/yaml/tag.expect.txt: -------------------------------------------------------------------------------- 1 | key: !!builtintagname test 2 | key: !localtagname test 3 | key: "!notatag" 4 | key: '!!notatageither' 5 | -------------------------------------------------------------------------------- /test/markup/yaml/tag.txt: -------------------------------------------------------------------------------- 1 | key: !!builtintagname test 2 | key: !localtagname test 3 | key: "!notatag" 4 | key: '!!notatageither' 5 | -------------------------------------------------------------------------------- /test/mocha.opts: -------------------------------------------------------------------------------- 1 | --require should 2 | --reporter spec 3 | --ui bdd 4 | --bail 5 | --check-leaks 6 | --inline-diffs 7 | -------------------------------------------------------------------------------- /test/parser/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | describe('hljs', function() { 4 | require('./reuse-endsWithParent'); 5 | require('./should-not-destroyData'); 6 | require('./look-ahead-end-matchers'); 7 | }); 8 | -------------------------------------------------------------------------------- /test/special/endsWithParentVariants.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const utility = require('../utility'); 4 | 5 | describe('ends with parent variants', () => { 6 | before(() => { 7 | const filename = utility.buildPath('fixtures', 'expect', 'endsWithParentVariants.txt'), 8 | testHTML = document.querySelectorAll('#ends-with-parent-variants .hljs'); 9 | 10 | return utility.setupFile(filename, 'utf-8', this, testHTML); 11 | }); 12 | 13 | it('should end on all variants', () => { 14 | const actual = this.blocks[0]; 15 | 16 | actual.should.equal(this.expected); 17 | }); 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /test/special/languageAlias.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const utility = require('../utility'); 4 | 5 | describe('language alias', () => { 6 | before(() => { 7 | const testHTML = document.querySelectorAll('#language-alias .hljs'); 8 | 9 | this.blocks = [...testHTML].map(x => x.innerHTML); 10 | }); 11 | 12 | it('should highlight as aliased language', () => { 13 | const filename = utility.buildPath('fixtures', 'expect', 14 | 'languagealias.txt'), 15 | actual = this.blocks[0]; 16 | 17 | return utility.expectedFile(filename, 'utf-8', actual); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /test/special/subLanguages.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const utility = require('../utility'); 4 | 5 | describe('sub-languages', () => { 6 | before(() => { 7 | this.block = document.querySelector('#sublanguages'); 8 | }); 9 | 10 | it('should highlight XML with PHP and JavaScript', () => { 11 | const filename = utility.buildPath('fixtures', 'expect', 12 | 'sublanguages.txt'), 13 | actual = this.block.innerHTML; 14 | 15 | return utility.expectedFile(filename, 'utf-8', actual); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /tools/keywordsformat.js: -------------------------------------------------------------------------------- 1 | /** Example */ 2 | 3 | var all = 'keywords here'; 4 | 5 | var output = '', line = ''; 6 | all.forEach(function (item) { 7 | if (12 + 1 + line.length + 1 + item.length + 4 > 120) { 8 | output += "\n" + " '" + line + " ' +"; 9 | line = ''; 10 | return; 11 | } 12 | if (line) { 13 | line = line + ' ' + item; 14 | } else { 15 | line = item; 16 | } 17 | }); 18 | console.log(output); 19 | --------------------------------------------------------------------------------