├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Example ├── Highlightr.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Highlightr-Example.xcscheme ├── Highlightr.xcworkspace │ └── contents.xcworkspacedata ├── Highlightr │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── SampleCode.swift │ ├── SampleCode.xib │ ├── Samples │ │ ├── 1c │ │ │ └── default.txt │ │ ├── abnf │ │ │ └── default.txt │ │ ├── accesslog │ │ │ └── default.txt │ │ ├── actionscript │ │ │ └── default.txt │ │ ├── ada │ │ │ └── default.txt │ │ ├── apache │ │ │ └── default.txt │ │ ├── applescript │ │ │ └── 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 │ │ ├── cs │ │ │ └── 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 │ │ ├── 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 │ │ ├── inform7 │ │ │ └── default.txt │ │ ├── ini │ │ │ └── default.txt │ │ ├── irpf90 │ │ │ └── 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 │ │ ├── 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 │ │ ├── nimrod │ │ │ └── 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 │ │ ├── php │ │ │ └── default.txt │ │ ├── pony │ │ │ └── default.txt │ │ ├── powershell │ │ │ └── default.txt │ │ ├── processing │ │ │ └── default.txt │ │ ├── prolog │ │ │ └── default.txt │ │ ├── protobuf │ │ │ └── default.txt │ │ ├── puppet │ │ │ └── default.txt │ │ ├── purebasic │ │ │ └── default.txt │ │ ├── python │ │ │ └── default.txt │ │ ├── q │ │ │ └── default.txt │ │ ├── qml │ │ │ └── default.txt │ │ ├── r │ │ │ └── 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 │ │ ├── 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 │ │ ├── tex │ │ │ └── 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 │ │ ├── xquery │ │ │ └── default.txt │ │ ├── yaml │ │ │ └── default.txt │ │ └── zephir │ │ │ └── default.txt │ └── sampleCode.txt ├── Highlightr_OSX_Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ └── MainMenu.xib │ └── Info.plist └── Podfile ├── Highlightr-iOS copy-Info.plist ├── Highlightr-macOS ├── Highlightr-macOS.h └── Info.plist ├── Highlightr.podspec ├── Highlightr.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── Highlightr-iOS.xcscheme │ └── Highlightr-macOS.xcscheme ├── Highlightr ├── Highlightr.h └── Info.plist ├── LICENSE ├── Package.swift ├── Package@swift-5.10.swift ├── Pod ├── Assets │ ├── .gitkeep │ ├── Highlighter │ │ ├── LICENSE │ │ └── highlight.min.js │ └── styles │ │ ├── a11y-dark.min.css │ │ ├── a11y-light.min.css │ │ ├── agate.min.css │ │ ├── an-old-hope.min.css │ │ ├── androidstudio.min.css │ │ ├── arduino-light.min.css │ │ ├── arta.min.css │ │ ├── ascetic.min.css │ │ ├── atelier-cave-dark.min.css │ │ ├── atelier-cave-light.min.css │ │ ├── atelier-dune-dark.min.css │ │ ├── atelier-dune-light.min.css │ │ ├── atelier-estuary-dark.min.css │ │ ├── atelier-estuary-light.min.css │ │ ├── atelier-forest-dark.min.css │ │ ├── atelier-forest-light.min.css │ │ ├── atelier-heath-dark.min.css │ │ ├── atelier-heath-light.min.css │ │ ├── atelier-lakeside-dark.min.css │ │ ├── atelier-lakeside-light.min.css │ │ ├── atelier-plateau-dark.min.css │ │ ├── atelier-plateau-light.min.css │ │ ├── atelier-savanna-dark.min.css │ │ ├── atelier-savanna-light.min.css │ │ ├── atelier-seaside-dark.min.css │ │ ├── atelier-seaside-light.min.css │ │ ├── atelier-sulphurpool-dark.min.css │ │ ├── atelier-sulphurpool-light.min.css │ │ ├── atom-one-dark-reasonable.min.css │ │ ├── atom-one-dark.min.css │ │ ├── atom-one-light.min.css │ │ ├── brown-paper.min.css │ │ ├── codepen-embed.min.css │ │ ├── color-brewer.min.css │ │ ├── darcula.min.css │ │ ├── dark.min.css │ │ ├── darkula.min.css │ │ ├── default.min.css │ │ ├── docco.min.css │ │ ├── dracula.min.css │ │ ├── far.min.css │ │ ├── foundation.min.css │ │ ├── github-gist.min.css │ │ ├── github.min.css │ │ ├── gml.min.css │ │ ├── googlecode.min.css │ │ ├── grayscale.min.css │ │ ├── gruvbox-dark.min.css │ │ ├── gruvbox-light.min.css │ │ ├── hopscotch.min.css │ │ ├── hybrid.min.css │ │ ├── idea.min.css │ │ ├── ir-black.min.css │ │ ├── isbl-editor-dark.min.css │ │ ├── isbl-editor-light.min.css │ │ ├── kimbie.dark.min.css │ │ ├── kimbie.light.min.css │ │ ├── lightfair.min.css │ │ ├── magula.min.css │ │ ├── mono-blue.min.css │ │ ├── monokai-sublime.min.css │ │ ├── monokai.min.css │ │ ├── nord.min.css │ │ ├── obsidian.min.css │ │ ├── ocean.min.css │ │ ├── paraiso-dark.min.css │ │ ├── paraiso-light.min.css │ │ ├── pojoaque.min.css │ │ ├── purebasic.min.css │ │ ├── qtcreator_dark.min.css │ │ ├── qtcreator_light.min.css │ │ ├── railscasts.min.css │ │ ├── rainbow.min.css │ │ ├── routeros.min.css │ │ ├── school-book.min.css │ │ ├── shades-of-purple.min.css │ │ ├── solarized-dark.min.css │ │ ├── solarized-light.min.css │ │ ├── sunburst.min.css │ │ ├── tomorrow-night-blue.min.css │ │ ├── tomorrow-night-bright.min.css │ │ ├── tomorrow-night-eighties.min.css │ │ ├── tomorrow-night.min.css │ │ ├── tomorrow.min.css │ │ ├── vs.min.css │ │ ├── vs2015.min.css │ │ ├── xcode-dark.min.css │ │ ├── xcode.min.css │ │ ├── xt256.min.css │ │ └── zenburn.min.css └── Classes │ ├── .gitkeep │ ├── CodeAttributedString.swift │ ├── HTMLUtils.swift │ ├── Highlightr.swift │ ├── Shims.swift │ └── Theme.swift ├── README.md ├── _Pods.xcodeproj ├── coding.gif └── mix2.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Examples 26 | Example/**/Podfile.lock 27 | Example/Pods 28 | Example/**/Pods 29 | 30 | Carthage 31 | # We recommend against adding the Pods directory to your .gitignore. However 32 | # you should judge for yourself, the pros and cons are mentioned at: 33 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 34 | # 35 | # Note: if you ignore the Pods directory, make sure to uncomment 36 | # `pod install` in .travis.yml 37 | # 38 | # Pods/ 39 | 40 | # Swift Package Manager 41 | .build/ 42 | .swiftpm 43 | 44 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | language: objective-c 6 | # cache: cocoapods 7 | # podfile: Example/Podfile 8 | # before_install: 9 | # - gem install cocoapods # Since Travis is not always on latest version 10 | # - pod install --project-directory=Example 11 | script: 12 | - set -o pipefail && xcodebuild test -workspace Example/Highlightr.xcworkspace -scheme Highlightr-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty 13 | - pod lib lint 14 | -------------------------------------------------------------------------------- /Example/Highlightr.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Highlightr.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Highlightr/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Example/Highlightr/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarHidden 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | UIViewControllerBasedStatusBarAppearance 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | } -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/arduino/default.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | Turns on an LED on for one second, then off for one second, repeatedly. 4 | 5 | This example code is in the public domain. 6 | */ 7 | 8 | // Pin 13 has an LED connected on most Arduino boards. 9 | // give it a name: 10 | int led = 13; 11 | 12 | // the setup routine runs once when you press reset: 13 | void setup() { 14 | // initialize the digital pin as an output. 15 | pinMode(led, OUTPUT); 16 | } 17 | 18 | // the loop routine runs over and over again forever: 19 | void loop() { 20 | digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) 21 | delay(1000); // wait for a second 22 | digitalWrite(led, LOW); // turn the LED off by making the voltage LOW 23 | delay(1000); // wait for a second 24 | } -------------------------------------------------------------------------------- /Example/Highlightr/Samples/armasm/default.txt: -------------------------------------------------------------------------------- 1 | .text 2 | 3 | .global connect 4 | connect: 5 | mov r3, #2 ; s->sin_family = AF_INET 6 | strh r3, [sp] 7 | ldr r3, =server_port ; s->sin_port = server_port 8 | ldr r3, [r3] 9 | strh r3, [sp, #2] 10 | ldr r3, =server_addr ; s->sin_addr = server_addr 11 | ldr r3, [r3] 12 | str r3, [sp, #4] 13 | mov r3, #0 ; bzero(&s->sin_zero) 14 | str r3, [sp, #8] 15 | str r3, [sp, #12] 16 | mov r1, sp ; const struct sockaddr *addr = sp 17 | 18 | ldr r7, =connect_call 19 | ldr r7, [r7] 20 | swi #0 21 | 22 | add sp, sp, #16 23 | pop {r0} ; pop sockfd 24 | 25 | pop {r7} 26 | pop {fp, ip, lr} 27 | mov sp, ip 28 | bx lr 29 | 30 | .data 31 | socket_call: .long 281 32 | connect_call: .long 283 33 | 34 | /* all addresses are network byte-order (big-endian) */ 35 | server_addr: .long 0x0100007f ; localhost 36 | server_port: .hword 0x0b1a 37 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/aspectj/default.txt: -------------------------------------------------------------------------------- 1 | package com.aspectj.syntax; 2 | import org.aspectj.lang.annotation.AdviceName; 3 | 4 | privileged public aspect LoggingAspect percflowbelow(ajia.services.*){ 5 | private pointcut getResult() : call(* *(..) throws SQLException) && args(Account, .., int); 6 | @AdviceName("CheckValidEmail") 7 | before (Customer hu) : getResult(hu){ 8 | System.out.println("Your mail address is valid!"); 9 | } 10 | Object around() throws InsufficientBalanceException: getResult() && call(Customer.new(String,String,int,int,int)){ 11 | return proceed(); 12 | } 13 | public Cache getCache() { 14 | return this.cache; 15 | } 16 | pointcut beanPropertyChange(BeanSupport bean, Object newValue): execution(void BeanSupport+.set*(*)) && args(newValue) && this(bean); 17 | declare parents: banking.entities.* implements BeanSupport; 18 | declare warning : call(void TestSoftening.perform()): "Please ensure you are not calling this from an AWT thread"; 19 | private String Identifiable.id; 20 | public void Identifiable.setId(String id) { 21 | this.id = id; 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/axapta/default.txt: -------------------------------------------------------------------------------- 1 | class ExchRateLoadBatch extends RunBaseBatch { 2 | ExchRateLoad rbc; 3 | container currencies; 4 | boolean actual; 5 | boolean overwrite; 6 | date beg; 7 | date end; 8 | 9 | #define.CurrentVersion(5) 10 | 11 | #localmacro.CurrentList 12 | currencies, 13 | actual, 14 | beg, 15 | end 16 | #endmacro 17 | } 18 | 19 | public boolean unpack(container packedClass) { 20 | container base; 21 | boolean ret; 22 | Integer version = runbase::getVersion(packedClass); 23 | 24 | switch (version) { 25 | case #CurrentVersion: 26 | [version, #CurrentList] = packedClass; 27 | return true; 28 | default: 29 | return false; 30 | } 31 | return ret; 32 | } 33 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/bnf/default.txt: -------------------------------------------------------------------------------- 1 | ::= | 2 | ::= "<" ">" "::=" 3 | ::= " " | "" 4 | ::= | "|" 5 | ::= | 6 | ::= | 7 | ::= | "<" ">" 8 | ::= '"' '"' | "'" "'" 9 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/cal/default.txt: -------------------------------------------------------------------------------- 1 | OBJECT Codeunit 11 Gen. Jnl.-Check Line 2 | { 3 | OBJECT-PROPERTIES 4 | { 5 | Date=09-09-14; 6 | Time=12:00:00; 7 | Version List=NAVW18.00; 8 | } 9 | PROPERTIES 10 | { 11 | TableNo=81; 12 | Permissions=TableData 252=rimd; 13 | OnRun=BEGIN 14 | GLSetup.GET; 15 | RunCheck(Rec); 16 | END; 17 | 18 | } 19 | CODE 20 | { 21 | VAR 22 | Text000@1000 : TextConst 'ENU=can only be a closing date for G/L entries'; 23 | Text001@1001 : TextConst 'ENU=is not within your range of allowed posting dates'; 24 | 25 | PROCEDURE ErrorIfPositiveAmt@2(GenJnlLine@1000 : Record 81); 26 | BEGIN 27 | IF GenJnlLine.Amount > 0 THEN 28 | GenJnlLine.FIELDERROR(Amount,Text008); 29 | END; 30 | 31 | LOCAL PROCEDURE CheckGenJnlLineDocType@7(GenJnlLine@1001 : Record 81); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/capnproto/default.txt: -------------------------------------------------------------------------------- 1 | @0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id` 2 | 3 | struct Person { 4 | name @0 :Text; 5 | birthdate @3 :Date; 6 | 7 | email @1 :Text; 8 | phones @2 :List(PhoneNumber); 9 | 10 | struct PhoneNumber { 11 | number @0 :Text; 12 | type @1 :Type; 13 | 14 | enum Type { 15 | mobile @0; 16 | home @1; 17 | work @2; 18 | } 19 | } 20 | } 21 | 22 | struct Date { 23 | year @0 :Int16; 24 | month @1 :UInt8; 25 | day @2 :UInt8; 26 | flags @3 :List(Bool) = [ true, false, false, true ]; 27 | } 28 | 29 | interface Node { 30 | isDirectory @0 () -> (result :Bool); 31 | } 32 | 33 | interface Directory extends(Node) { 34 | list @0 () -> (list: List(Entry)); 35 | struct Entry { 36 | name @0 :Text; 37 | node @1 :Node; 38 | } 39 | 40 | create @1 (name :Text) -> (file :File); 41 | mkdir @2 (name :Text) -> (directory :Directory) 42 | open @3 (name :Text) -> (node :Node); 43 | delete @4 (name :Text); 44 | link @5 (name :Text, node :Node); 45 | } 46 | 47 | interface File extends(Node) { 48 | size @0 () -> (size: UInt64); 49 | read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) 50 | -> (data: Data); 51 | # Default params = read entire file. 52 | 53 | write @2 (startAt :UInt64, data :Data); 54 | truncate @3 (size :UInt64); 55 | } -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/clean/default.txt: -------------------------------------------------------------------------------- 1 | module fsieve 2 | 3 | import StdClass; // RWS 4 | import StdInt, StdReal 5 | 6 | NrOfPrimes :== 3000 7 | 8 | primes :: [Int] 9 | primes = pr where pr = [5 : sieve 7 4 pr] 10 | 11 | sieve :: Int !Int [Int] -> [Int] 12 | sieve g i prs 13 | | isPrime prs g (toInt (sqrt (toReal g))) = [g : sieve` g i prs] 14 | | otherwise = sieve (g + i) (6 - i) prs 15 | 16 | sieve` :: Int Int [Int] -> [Int] 17 | sieve` g i prs = sieve (g + i) (6 - i) prs 18 | 19 | isPrime :: [Int] !Int Int -> Bool 20 | isPrime [f:r] pr bd 21 | | f>bd = True 22 | | pr rem f==0 = False 23 | | otherwise = isPrime r pr bd 24 | 25 | select :: [x] Int -> x 26 | select [f:r] 1 = f 27 | select [f:r] n = select r (n - 1) 28 | 29 | Start :: Int 30 | Start = select [2, 3 : primes] NrOfPrimes 31 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/coq/default.txt: -------------------------------------------------------------------------------- 1 | Inductive seq : nat -> Set := 2 | | niln : seq 0 3 | | consn : forall n : nat, nat -> seq n -> seq (S n). 4 | 5 | Fixpoint length (n : nat) (s : seq n) {struct s} : nat := 6 | match s with 7 | | niln => 0 8 | | consn i _ s' => S (length i s') 9 | end. 10 | 11 | Theorem length_corr : forall (n : nat) (s : seq n), length n s = n. 12 | Proof. 13 | intros n s. 14 | 15 | (* reasoning by induction over s. Then, we have two new goals 16 | corresponding on the case analysis about s (either it is 17 | niln or some consn *) 18 | induction s. 19 | 20 | (* We are in the case where s is void. We can reduce the 21 | term: length 0 niln *) 22 | simpl. 23 | 24 | (* We obtain the goal 0 = 0. *) 25 | trivial. 26 | 27 | (* now, we treat the case s = consn n e s with induction 28 | hypothesis IHs *) 29 | simpl. 30 | 31 | (* The induction hypothesis has type length n s = n. 32 | So we can use it to perform some rewriting in the goal: *) 33 | rewrite IHs. 34 | 35 | (* Now the goal is the trivial equality: S n = S n *) 36 | trivial. 37 | 38 | (* Now all sub cases are closed, we perform the ultimate 39 | step: typing the term built using tactics and save it as 40 | a witness of the theorem. *) 41 | Qed. 42 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/cs/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | } 9 | 10 | @import url(print.css); 11 | @media print { 12 | a[href^=http]::after { 13 | content: attr(href) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/d/default.txt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rdmd 2 | // Computes average line length for standard input. 3 | import std.stdio; 4 | 5 | /+ 6 | this is a /+ nesting +/ comment 7 | +/ 8 | 9 | enum COMPILED_ON = __TIMESTAMP__; // special token 10 | 11 | enum character = '©'; 12 | enum copy_valid = '©'; 13 | enum backslash_escaped = '\\'; 14 | 15 | // string literals 16 | enum str = `hello "world"!`; 17 | enum multiline = r"lorem 18 | ipsum 19 | dolor"; // wysiwyg string, no escapes here allowed 20 | enum multiline2 = "sit 21 | amet 22 | \"adipiscing\" 23 | elit."; 24 | enum hex = x"66 6f 6f"; // same as "foo" 25 | 26 | #line 5 27 | 28 | // float literals 29 | enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100]; 30 | 31 | static if (something == true) { 32 | import std.algorithm; 33 | } 34 | 35 | void main() pure nothrow @safe { 36 | ulong lines = 0; 37 | double sumLength = 0; 38 | foreach (line; stdin.byLine()) { 39 | ++lines; 40 | sumLength += line.length; 41 | } 42 | writeln("Average line length: ", 43 | lines ? sumLength / lines : 0); 44 | } 45 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/dart/default.txt: -------------------------------------------------------------------------------- 1 | library app; 2 | import 'dart:html'; 3 | 4 | part 'app2.dart'; 5 | 6 | /** 7 | * Class description and [link](http://dartlang.org/). 8 | */ 9 | @Awesome('it works!') 10 | class SomeClass extends BaseClass implements Comparable { 11 | factory SomeClass(num param); 12 | SomeClass._internal(int q) : super() { 13 | assert(q != 1); 14 | double z = 0.0; 15 | } 16 | 17 | /// **Sum** function 18 | int sum(int a, int b) => a + b; 19 | 20 | ElementList els() => querySelectorAll('.dart'); 21 | } 22 | 23 | String str = ' (${'parameter' + 'zxc'})'; 24 | String str = " (${true ? 2 + 2 / 2 : null})"; 25 | String str = r'\nraw\'; 26 | String str = r"\nraw\"; 27 | var str = ''' 28 | Something ${2+3} 29 | '''; 30 | var str = r""" 31 | Something ${2+3} 32 | """; 33 | 34 | checkVersion() async { 35 | var version = await lookUpVersion(); 36 | } 37 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/delphi/default.txt: -------------------------------------------------------------------------------- 1 | TList = Class(TObject) 2 | Private 3 | Some: String; 4 | Public 5 | Procedure Inside; // Suxx 6 | End;{TList} 7 | 8 | Procedure CopyFile(InFileName, var OutFileName: String); 9 | Const 10 | BufSize = 4096; (* Huh? *) 11 | Var 12 | InFile, OutFile: TStream; 13 | Buffer: Array[1..BufSize] Of Byte; 14 | ReadBufSize: Integer; 15 | Begin 16 | InFile := Nil; 17 | OutFile := Nil; 18 | Try 19 | InFile := TFileStream.Create(InFileName, fmOpenRead); 20 | OutFile := TFileStream.Create(OutFileName, fmCreate); 21 | Repeat 22 | ReadBufSize := InFile.Read(Buffer, BufSize); 23 | OutFile.Write(Buffer, ReadBufSize); 24 | Until ReadBufSize<>BufSize; 25 | Log('File ''' + InFileName + ''' copied'#13#10); 26 | Finally 27 | InFile.Free; 28 | OutFile.Free; 29 | End;{Try} 30 | End;{CopyFile} 31 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/diff/default.txt: -------------------------------------------------------------------------------- 1 | Index: languages/ini.js 2 | =================================================================== 3 | --- languages/ini.js (revision 199) 4 | +++ languages/ini.js (revision 200) 5 | @@ -1,8 +1,7 @@ 6 | hljs.LANGUAGES.ini = 7 | { 8 | case_insensitive: true, 9 | - defaultMode: 10 | - { 11 | + defaultMode: { 12 | contains: ['comment', 'title', 'setting'], 13 | illegal: '[^\\s]' 14 | }, 15 | 16 | *** /path/to/original timestamp 17 | --- /path/to/new timestamp 18 | *************** 19 | *** 1,3 **** 20 | --- 1,9 ---- 21 | + This is an important 22 | + notice! It should 23 | + therefore be located at 24 | + the beginning of this 25 | + document! 26 | 27 | ! compress the size of the 28 | ! changes. 29 | 30 | It is important to spell 31 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/dust/default.txt: -------------------------------------------------------------------------------- 1 |

Hours

2 | 3 |
    4 | {#users} 5 |
  • {firstName}
  • {~n} 6 | {/users} 7 |
8 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/elixir/default.txt: -------------------------------------------------------------------------------- 1 | defrecord Person, first_name: nil, last_name: "Dudington" do 2 | def name record do # huh ? 3 | "#{record.first_name} #{record.last_name}" 4 | end 5 | end 6 | 7 | defrecord User, name: "José", age: 25 8 | 9 | guy = Person.new first_name: "Guy" 10 | guy.name 11 | 12 | defmodule ListServer do 13 | @moduledoc """ 14 | This module provides an easy to use ListServer, useful for keeping 15 | lists of things. 16 | """ 17 | use GenServer.Behaviour 18 | alias Foo.Bar 19 | 20 | ### Public API 21 | @doc """ 22 | Starts and links a new ListServer, returning {:ok, pid} 23 | 24 | ## Example 25 | 26 | iex> {:ok, pid} = ListServer.start_link 27 | 28 | """ 29 | def start_link do 30 | :gen_server.start_link({:local, :list}, __MODULE__, [], []) 31 | end 32 | 33 | ### GenServer API 34 | def init(list) do 35 | {:ok, list} 36 | end 37 | 38 | # Clear the list 39 | def handle_cast :clear, list do 40 | {:noreply, []} 41 | end 42 | end 43 | 44 | {:ok, pid} = ListServer.start_link 45 | pid <- {:foo, "bar"} 46 | 47 | greeter = fn(x) -> IO.puts "hey #{x}" end 48 | greeter.("Bob") 49 | 50 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/elm/default.txt: -------------------------------------------------------------------------------- 1 | import Html exposing (div, button, text) 2 | import Html.App exposing (beginnerProgram) 3 | import Html.Events exposing (onClick) 4 | 5 | type Msg 6 | = Increment 7 | 8 | main = 9 | beginnerProgram 10 | { model = 0, view = view 11 | , update = \Increment model -> model + 1 } 12 | 13 | view model = 14 | div [] [ div [] [ text (toString model) ] 15 | , button [ onClick Increment ] [ text "+" ] ] 16 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/excel/default.txt: -------------------------------------------------------------------------------- 1 | =IF(C10 <= 275.5, "Unprofitable", "Profitable") -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 |  -------------------------------------------------------------------------------- /Example/Highlightr/Samples/flix/default.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * An example of Flix for syntax highlighting. 3 | */ 4 | 5 | // Here is a namespace. 6 | namespace a.b.c { 7 | 8 | // Here are some literals. 9 | def b: Bool = true 10 | def c: Char = 'a' 11 | def f: Float = 1.23 12 | def i: Int = 42 13 | def s: Str = "string" 14 | 15 | // Here are some relations. 16 | rel LitStm(r: Str, c: Int) 17 | rel AddStm(r: Str, x: Str, y: Str) 18 | rel DivStm(r: Str, x: Str, y: Str) 19 | 20 | // Here is a lattice. 21 | lat LocalVar(k: Str, v: Constant) 22 | 23 | // Here is an index. 24 | index LitStm{{r}, {r, c}} 25 | 26 | // Here is an enum. 27 | enum Constant { 28 | case Top, 29 | 30 | case Cst(Int), 31 | 32 | case Bot 33 | } 34 | 35 | // Here is a function. 36 | def leq(e1: Constant, e2: Constant): Bool = match (e1, e2) with { 37 | case (Constant.Bot, _) => true 38 | case (Constant.Cst(n1), Constant.Cst(n2)) => n1 == n2 39 | case (_, Constant.Top) => true 40 | case _ => false 41 | } 42 | 43 | // Here are some rules. 44 | LocalVar(r, alpha(c)) :- LitStm(r, c). 45 | 46 | LocalVar(r, sum(v1, v2)) :- AddStm(r, x, y), 47 | LocalVar(x, v1), 48 | LocalVar(y, v2). 49 | } 50 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/fsharp/default.txt: -------------------------------------------------------------------------------- 1 | open System 2 | 3 | // Single line comment... 4 | (* 5 | This is a 6 | multiline comment. 7 | *) 8 | let checkList alist = 9 | match alist with 10 | | [] -> 0 11 | | [a] -> 1 12 | | [a; b] -> 2 13 | | [a; b; c] -> 3 14 | | _ -> failwith "List is too big!" 15 | 16 | 17 | let text = "Some text..." 18 | let text2 = @"A ""verbatim"" string..." 19 | let catalog = """ 20 | Some "long" string... 21 | """ 22 | 23 | let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2) 24 | 25 | let fibs = 26 | Async.Parallel [ for i in 0..40 -> async { return fib(i) } ] 27 | |> Async.RunSynchronously 28 | 29 | type Sprocket(gears) = 30 | member this.Gears : int = gears 31 | 32 | [] 33 | type Animal = 34 | abstract Speak : unit -> unit 35 | 36 | type Widget = 37 | | RedWidget 38 | | GreenWidget 39 | 40 | type Point = {X: float; Y: float;} 41 | 42 | [] 43 | type s 44 | let minutte = 60 45 | 46 | type DefaultMailbox<'a>() = 47 | let mutable inbox = ConcurrentQueue<'a>() 48 | let awaitMsg = new AutoResetEvent(false) 49 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/gams/default.txt: -------------------------------------------------------------------------------- 1 | SETS 2 | I canning plants / SEATTLE, SAN-DIEGO / 3 | J markets / NEW-YORK, CHICAGO, TOPEKA / ; 4 | PARAMETERS 5 | A(I) capacity of plant i in cases 6 | / SEATTLE 350 7 | SAN-DIEGO 600 / 8 | B(J) demand at market j in cases 9 | / NEW-YORK 325 10 | CHICAGO 300 11 | TOPEKA 275 / ; 12 | TABLE D(I,J) distance in thousands of miles 13 | NEW-YORK CHICAGO TOPEKA 14 | SEATTLE 2.5 1.7 1.8 15 | SAN-DIEGO 2.5 1.8 1.4 ; 16 | SCALAR F freight in dollars per case per thousand miles /90/ ; 17 | PARAMETER C(I,J) transport cost in thousands of dollars per case ; 18 | C(I,J) = F * D(I,J) / 1000 ; 19 | VARIABLES 20 | X(I,J) shipment quantities in cases 21 | Z total transportation costs in thousands of dollars ; 22 | POSITIVE VARIABLE X ; 23 | EQUATIONS 24 | COST define objective function 25 | SUPPLY(I) observe supply limit at plant i 26 | DEMAND(J) satisfy demand at market j ; 27 | COST .. Z =E= SUM((I,J), C(I,J)*X(I,J)) ; 28 | SUPPLY(I) .. SUM(J, X(I,J)) =L= A(I) ; 29 | DEMAND(J) .. SUM(I, X(I,J)) =G= B(J) ; 30 | MODEL TRANSPORT /ALL/ ; 31 | SOLVE TRANSPORT USING LP MINIMIZING Z ; 32 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/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 | -------------------------------------------------------------------------------- /Example/Highlightr/Samples/gherkin/default.txt: -------------------------------------------------------------------------------- 1 | # language: en 2 | Feature: Addition 3 | In order to avoid silly mistakes 4 | As a math idiot 5 | I want to be told the sum of two numbers 6 | 7 | @this_is_a_tag 8 | Scenario Outline: Add two numbers 9 | * I have a calculator 10 | Given I have entered into the calculator 11 | And I have entered into the calculator 12 | When I press