jekyll-theme-anc 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +1 -0
- data/_includes/disqus.html +42 -0
- data/_includes/facebook_share_btn.html +1 -0
- data/_includes/footer.html +79 -0
- data/_includes/go2top.html +22 -0
- data/_includes/google-analytics.html +11 -0
- data/_includes/head.html +50 -0
- data/_includes/header.html +13 -0
- data/_includes/jspdf.html +41 -0
- data/_includes/nav.html +25 -0
- data/_includes/pageloginpoper.html +59 -0
- data/_includes/post-categories.html +8 -0
- data/_includes/post_seo.html +59 -0
- data/_includes/youtube_video.html +11 -0
- data/_layouts/blog.html +33 -0
- data/_layouts/default.html +151 -0
- data/_layouts/home.html +26 -0
- data/_layouts/page.html +5 -0
- data/_layouts/post.html +83 -0
- data/_sass/anc.scss +9 -0
- data/_sass/anc/_base.scss +144 -0
- data/_sass/anc/_layout.scss +0 -0
- data/_sass/anc/_materialize.scss +38 -0
- data/_sass/anc/_syntax-highlighting.scss +78 -0
- data/_sass/anc/components/_variables.scss +343 -0
- data/_sass/materialize-css/components/_badges.scss +47 -0
- data/_sass/materialize-css/components/_buttons.scss +291 -0
- data/_sass/materialize-css/components/_cards.scss +196 -0
- data/_sass/materialize-css/components/_carousel.scss +90 -0
- data/_sass/materialize-css/components/_chips.scss +89 -0
- data/_sass/materialize-css/components/_collapsible.scss +84 -0
- data/_sass/materialize-css/components/_color.scss +412 -0
- data/_sass/materialize-css/components/_dropdown.scss +68 -0
- data/_sass/materialize-css/components/_global.scss +734 -0
- data/_sass/materialize-css/components/_grid.scss +156 -0
- data/_sass/materialize-css/components/_icons-material-design.scss +5 -0
- data/_sass/materialize-css/components/_materialbox.scss +43 -0
- data/_sass/materialize-css/components/_modal.scss +90 -0
- data/_sass/materialize-css/components/_navbar.scss +208 -0
- data/_sass/materialize-css/components/_normalize.scss +424 -0
- data/_sass/materialize-css/components/_preloader.scss +334 -0
- data/_sass/materialize-css/components/_pulse.scss +34 -0
- data/_sass/materialize-css/components/_roboto.scss +39 -0
- data/_sass/materialize-css/components/_sideNav.scss +214 -0
- data/_sass/materialize-css/components/_slider.scss +92 -0
- data/_sass/materialize-css/components/_table_of_contents.scss +33 -0
- data/_sass/materialize-css/components/_tabs.scss +93 -0
- data/_sass/materialize-css/components/_tapTarget.scss +103 -0
- data/_sass/materialize-css/components/_toast.scss +59 -0
- data/_sass/materialize-css/components/_tooltip.scss +31 -0
- data/_sass/materialize-css/components/_transitions.scss +13 -0
- data/_sass/materialize-css/components/_typography.scss +61 -0
- data/_sass/materialize-css/components/_variables.scss +343 -0
- data/_sass/materialize-css/components/_waves.scss +114 -0
- data/_sass/materialize-css/components/date_picker/_default.date.scss +456 -0
- data/_sass/materialize-css/components/date_picker/_default.scss +212 -0
- data/_sass/materialize-css/components/date_picker/_default.time.scss +267 -0
- data/_sass/materialize-css/components/forms/_checkboxes.scss +210 -0
- data/_sass/materialize-css/components/forms/_file-input.scss +44 -0
- data/_sass/materialize-css/components/forms/_forms.scss +22 -0
- data/_sass/materialize-css/components/forms/_input-fields.scss +333 -0
- data/_sass/materialize-css/components/forms/_radio-buttons.scss +115 -0
- data/_sass/materialize-css/components/forms/_range.scss +160 -0
- data/_sass/materialize-css/components/forms/_select.scss +182 -0
- data/_sass/materialize-css/components/forms/_switches.scss +89 -0
- data/_sass/materialize-css/materialize.scss +42 -0
- data/_sass/materialize/components/_badges.scss +47 -0
- data/_sass/materialize/components/_buttons.scss +291 -0
- data/_sass/materialize/components/_cards.scss +196 -0
- data/_sass/materialize/components/_carousel.scss +90 -0
- data/_sass/materialize/components/_chips.scss +89 -0
- data/_sass/materialize/components/_collapsible.scss +84 -0
- data/_sass/materialize/components/_color.scss +412 -0
- data/_sass/materialize/components/_dropdown.scss +68 -0
- data/_sass/materialize/components/_global.scss +734 -0
- data/_sass/materialize/components/_grid.scss +156 -0
- data/_sass/materialize/components/_icons-material-design.scss +5 -0
- data/_sass/materialize/components/_materialbox.scss +43 -0
- data/_sass/materialize/components/_modal.scss +90 -0
- data/_sass/materialize/components/_navbar.scss +208 -0
- data/_sass/materialize/components/_normalize.scss +424 -0
- data/_sass/materialize/components/_preloader.scss +334 -0
- data/_sass/materialize/components/_pulse.scss +34 -0
- data/_sass/materialize/components/_roboto.scss +39 -0
- data/_sass/materialize/components/_sideNav.scss +214 -0
- data/_sass/materialize/components/_slider.scss +92 -0
- data/_sass/materialize/components/_table_of_contents.scss +33 -0
- data/_sass/materialize/components/_tabs.scss +93 -0
- data/_sass/materialize/components/_tapTarget.scss +103 -0
- data/_sass/materialize/components/_toast.scss +59 -0
- data/_sass/materialize/components/_tooltip.scss +31 -0
- data/_sass/materialize/components/_transitions.scss +13 -0
- data/_sass/materialize/components/_typography.scss +61 -0
- data/_sass/materialize/components/_variables.scss +343 -0
- data/_sass/materialize/components/_waves.scss +114 -0
- data/_sass/materialize/components/date_picker/_default.date.scss +456 -0
- data/_sass/materialize/components/date_picker/_default.scss +212 -0
- data/_sass/materialize/components/date_picker/_default.time.scss +267 -0
- data/_sass/materialize/components/forms/_checkboxes.scss +210 -0
- data/_sass/materialize/components/forms/_file-input.scss +44 -0
- data/_sass/materialize/components/forms/_forms.scss +22 -0
- data/_sass/materialize/components/forms/_input-fields.scss +333 -0
- data/_sass/materialize/components/forms/_radio-buttons.scss +115 -0
- data/_sass/materialize/components/forms/_range.scss +160 -0
- data/_sass/materialize/components/forms/_select.scss +182 -0
- data/_sass/materialize/components/forms/_switches.scss +89 -0
- data/_sass/materialize/materialize.scss +42 -0
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.eot +0 -0
- data/assets/fonts/fontawesome-webfont.svg +2671 -0
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/assets/images/close.png +0 -0
- data/assets/images/loader.gif +0 -0
- data/assets/img/icons/facebook-square.png +0 -0
- data/assets/img/icons/github-square.png +0 -0
- data/assets/img/icons/twitter-square.png +0 -0
- data/assets/img/icons/youtube-square.png +0 -0
- data/assets/img/jubayed11.37-16.jpg +0 -0
- data/assets/img/parallax1.jpg +0 -0
- data/assets/img/sample-1.jpg +0 -0
- data/assets/js/custom_script.js +200 -0
- data/assets/js/highlight.pack.js +2 -0
- data/assets/js/materialize.min.js +6 -0
- data/assets/js/mode/apl/apl.js +174 -0
- data/assets/js/mode/asciiarmor/asciiarmor.js +74 -0
- data/assets/js/mode/asn.1/asn.1.js +204 -0
- data/assets/js/mode/asterisk/asterisk.js +196 -0
- data/assets/js/mode/brainfuck/brainfuck.js +85 -0
- data/assets/js/mode/clike/clike.js +789 -0
- data/assets/js/mode/clojure/clojure.js +306 -0
- data/assets/js/mode/cmake/cmake.js +97 -0
- data/assets/js/mode/cobol/cobol.js +255 -0
- data/assets/js/mode/coffeescript/coffeescript.js +359 -0
- data/assets/js/mode/commonlisp/commonlisp.js +124 -0
- data/assets/js/mode/crystal/crystal.js +433 -0
- data/assets/js/mode/css/css.js +831 -0
- data/assets/js/mode/cypher/cypher.js +150 -0
- data/assets/js/mode/d/d.js +218 -0
- data/assets/js/mode/dart/dart.js +157 -0
- data/assets/js/mode/diff/diff.js +47 -0
- data/assets/js/mode/django/django.js +356 -0
- data/assets/js/mode/dockerfile/dockerfile.js +79 -0
- data/assets/js/mode/dtd/dtd.js +142 -0
- data/assets/js/mode/dylan/dylan.js +352 -0
- data/assets/js/mode/ebnf/ebnf.js +195 -0
- data/assets/js/mode/ecl/ecl.js +206 -0
- data/assets/js/mode/eiffel/eiffel.js +160 -0
- data/assets/js/mode/elm/elm.js +205 -0
- data/assets/js/mode/erlang/erlang.js +619 -0
- data/assets/js/mode/factor/factor.js +85 -0
- data/assets/js/mode/fcl/fcl.js +173 -0
- data/assets/js/mode/forth/forth.js +180 -0
- data/assets/js/mode/fortran/fortran.js +188 -0
- data/assets/js/mode/gas/gas.js +345 -0
- data/assets/js/mode/gfm/gfm.js +129 -0
- data/assets/js/mode/gherkin/gherkin.js +178 -0
- data/assets/js/mode/go/go.js +187 -0
- data/assets/js/mode/groovy/groovy.js +230 -0
- data/assets/js/mode/haml/haml.js +161 -0
- data/assets/js/mode/handlebars/handlebars.js +62 -0
- data/assets/js/mode/haskell-literate/haskell-literate.js +43 -0
- data/assets/js/mode/haskell/haskell.js +267 -0
- data/assets/js/mode/haxe/haxe.js +515 -0
- data/assets/js/mode/htmlembedded/htmlembedded.js +28 -0
- data/assets/js/mode/htmlmixed/htmlmixed.js +152 -0
- data/assets/js/mode/http/http.js +113 -0
- data/assets/js/mode/idl/idl.js +290 -0
- data/assets/js/mode/javascript/javascript.js +838 -0
- data/assets/js/mode/jinja2/jinja2.js +142 -0
- data/assets/js/mode/jsx/jsx.js +148 -0
- data/assets/js/mode/julia/julia.js +418 -0
- data/assets/js/mode/livescript/livescript.js +280 -0
- data/assets/js/mode/lua/lua.js +159 -0
- data/assets/js/mode/markdown/markdown.js +859 -0
- data/assets/js/mode/mathematica/mathematica.js +176 -0
- data/assets/js/mode/mbox/mbox.js +129 -0
- data/assets/js/mode/meta.js +215 -0
- data/assets/js/mode/mirc/mirc.js +193 -0
- data/assets/js/mode/mllike/mllike.js +208 -0
- data/assets/js/mode/modelica/modelica.js +245 -0
- data/assets/js/mode/mscgen/mscgen.js +175 -0
- data/assets/js/mode/mumps/mumps.js +148 -0
- data/assets/js/mode/nginx/nginx.js +178 -0
- data/assets/js/mode/nsis/nsis.js +95 -0
- data/assets/js/mode/ntriples/ntriples.js +195 -0
- data/assets/js/mode/octave/octave.js +139 -0
- data/assets/js/mode/oz/oz.js +252 -0
- data/assets/js/mode/pascal/pascal.js +109 -0
- data/assets/js/mode/pegjs/pegjs.js +114 -0
- data/assets/js/mode/perl/perl.js +837 -0
- data/assets/js/mode/php/php.js +234 -0
- data/assets/js/mode/pig/pig.js +178 -0
- data/assets/js/mode/powershell/powershell.js +398 -0
- data/assets/js/mode/properties/properties.js +78 -0
- data/assets/js/mode/protobuf/protobuf.js +68 -0
- data/assets/js/mode/pug/pug.js +591 -0
- data/assets/js/mode/puppet/puppet.js +220 -0
- data/assets/js/mode/python/python.js +334 -0
- data/assets/js/mode/q/q.js +139 -0
- data/assets/js/mode/r/r.js +183 -0
- data/assets/js/mode/rpm/changes/index.html +66 -0
- data/assets/js/mode/rpm/rpm.js +109 -0
- data/assets/js/mode/rst/rst.js +557 -0
- data/assets/js/mode/ruby/ruby.js +295 -0
- data/assets/js/mode/rust/rust.js +72 -0
- data/assets/js/mode/sas/sas.js +303 -0
- data/assets/js/mode/sass/sass.js +454 -0
- data/assets/js/mode/scheme/scheme.js +249 -0
- data/assets/js/mode/shell/shell.js +142 -0
- data/assets/js/mode/sieve/sieve.js +193 -0
- data/assets/js/mode/slim/slim.js +575 -0
- data/assets/js/mode/smalltalk/smalltalk.js +168 -0
- data/assets/js/mode/smarty/smarty.js +225 -0
- data/assets/js/mode/solr/solr.js +104 -0
- data/assets/js/mode/soy/soy.js +342 -0
- data/assets/js/mode/sparql/sparql.js +180 -0
- data/assets/js/mode/spreadsheet/spreadsheet.js +112 -0
- data/assets/js/mode/sql/sql.js +475 -0
- data/assets/js/mode/stex/stex.js +251 -0
- data/assets/js/mode/stylus/stylus.js +771 -0
- data/assets/js/mode/swift/swift.js +210 -0
- data/assets/js/mode/tcl/tcl.js +139 -0
- data/assets/js/mode/textile/textile.js +469 -0
- data/assets/js/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/assets/js/mode/tiddlywiki/tiddlywiki.js +308 -0
- data/assets/js/mode/tiki/tiki.css +26 -0
- data/assets/js/mode/tiki/tiki.js +312 -0
- data/assets/js/mode/toml/toml.js +88 -0
- data/assets/js/mode/tornado/tornado.js +68 -0
- data/assets/js/mode/troff/troff.js +84 -0
- data/assets/js/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- data/assets/js/mode/ttcn/ttcn.js +283 -0
- data/assets/js/mode/turtle/turtle.js +162 -0
- data/assets/js/mode/twig/twig.js +141 -0
- data/assets/js/mode/vb/vb.js +275 -0
- data/assets/js/mode/vbscript/vbscript.js +350 -0
- data/assets/js/mode/velocity/velocity.js +201 -0
- data/assets/js/mode/verilog/verilog.js +675 -0
- data/assets/js/mode/vhdl/vhdl.js +189 -0
- data/assets/js/mode/vue/vue.js +70 -0
- data/assets/js/mode/webidl/webidl.js +195 -0
- data/assets/js/mode/xml/xml.js +394 -0
- data/assets/js/mode/xquery/xquery.js +448 -0
- data/assets/js/mode/yacas/yacas.js +204 -0
- data/assets/js/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/assets/js/mode/yaml/yaml.js +118 -0
- data/assets/js/mode/z80/z80.js +116 -0
- data/assets/main.scss +5 -0
- metadata +347 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// Author: Jan T. Sott (http://github.com/idleberg)
|
5
|
+
|
6
|
+
(function(mod) {
|
7
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8
|
+
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
|
9
|
+
else if (typeof define == "function" && define.amd) // AMD
|
10
|
+
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
|
11
|
+
else // Plain browser env
|
12
|
+
mod(CodeMirror);
|
13
|
+
})(function(CodeMirror) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
CodeMirror.defineSimpleMode("nsis",{
|
17
|
+
start:[
|
18
|
+
// Numbers
|
19
|
+
{regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
|
20
|
+
|
21
|
+
// Strings
|
22
|
+
{ regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
|
23
|
+
{ regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
|
24
|
+
{ regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
|
25
|
+
|
26
|
+
// Compile Time Commands
|
27
|
+
{regex: /^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|pragma|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
|
28
|
+
|
29
|
+
// Conditional Compilation
|
30
|
+
{regex: /^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
|
31
|
+
{regex: /^\s*(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
|
32
|
+
|
33
|
+
// Runtime Commands
|
34
|
+
{regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
|
35
|
+
{regex: /^\s*(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
|
36
|
+
{regex: /^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
|
37
|
+
|
38
|
+
// Command Options
|
39
|
+
{regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
|
40
|
+
{regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
|
41
|
+
|
42
|
+
// LogicLib.nsh
|
43
|
+
{regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
|
44
|
+
|
45
|
+
// FileFunc.nsh
|
46
|
+
{regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
|
47
|
+
|
48
|
+
// Memento.nsh
|
49
|
+
{regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
|
50
|
+
|
51
|
+
// TextFunc.nsh
|
52
|
+
{regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
|
53
|
+
|
54
|
+
// WinVer.nsh
|
55
|
+
{regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
|
56
|
+
|
57
|
+
// WordFunc.nsh
|
58
|
+
{regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
|
59
|
+
|
60
|
+
// x64.nsh
|
61
|
+
{regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
|
62
|
+
{regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
|
63
|
+
|
64
|
+
// Line Comment
|
65
|
+
{regex: /(#|;).*/, token: "comment"},
|
66
|
+
|
67
|
+
// Block Comment
|
68
|
+
{regex: /\/\*/, token: "comment", next: "comment"},
|
69
|
+
|
70
|
+
// Operator
|
71
|
+
{regex: /[-+\/*=<>!]+/, token: "operator"},
|
72
|
+
|
73
|
+
// Variable
|
74
|
+
{regex: /\$\w+/, token: "variable"},
|
75
|
+
|
76
|
+
// Constant
|
77
|
+
{regex: /\${[\w\.:-]+}/, token: "variable-2"},
|
78
|
+
|
79
|
+
// Language String
|
80
|
+
{regex: /\$\([\w\.:-]+\)/, token: "variable-3"}
|
81
|
+
],
|
82
|
+
comment: [
|
83
|
+
{regex: /.*?\*\//, token: "comment", next: "start"},
|
84
|
+
{regex: /.*/, token: "comment"}
|
85
|
+
],
|
86
|
+
meta: {
|
87
|
+
electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
|
88
|
+
blockCommentStart: "/*",
|
89
|
+
blockCommentEnd: "*/",
|
90
|
+
lineComment: ["#", ";"]
|
91
|
+
}
|
92
|
+
});
|
93
|
+
|
94
|
+
CodeMirror.defineMIME("text/x-nsis", "nsis");
|
95
|
+
});
|
@@ -0,0 +1,195 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
/**********************************************************
|
5
|
+
* This script provides syntax highlighting support for
|
6
|
+
* the N-Triples format.
|
7
|
+
* N-Triples format specification:
|
8
|
+
* https://www.w3.org/TR/n-triples/
|
9
|
+
***********************************************************/
|
10
|
+
|
11
|
+
/*
|
12
|
+
The following expression defines the defined ASF grammar transitions.
|
13
|
+
|
14
|
+
pre_subject ->
|
15
|
+
{
|
16
|
+
( writing_subject_uri | writing_bnode_uri )
|
17
|
+
-> pre_predicate
|
18
|
+
-> writing_predicate_uri
|
19
|
+
-> pre_object
|
20
|
+
-> writing_object_uri | writing_object_bnode |
|
21
|
+
(
|
22
|
+
writing_object_literal
|
23
|
+
-> writing_literal_lang | writing_literal_type
|
24
|
+
)
|
25
|
+
-> post_object
|
26
|
+
-> BEGIN
|
27
|
+
} otherwise {
|
28
|
+
-> ERROR
|
29
|
+
}
|
30
|
+
*/
|
31
|
+
|
32
|
+
(function(mod) {
|
33
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
34
|
+
mod(require("../../lib/codemirror"));
|
35
|
+
else if (typeof define == "function" && define.amd) // AMD
|
36
|
+
define(["../../lib/codemirror"], mod);
|
37
|
+
else // Plain browser env
|
38
|
+
mod(CodeMirror);
|
39
|
+
})(function(CodeMirror) {
|
40
|
+
"use strict";
|
41
|
+
|
42
|
+
CodeMirror.defineMode("ntriples", function() {
|
43
|
+
|
44
|
+
var Location = {
|
45
|
+
PRE_SUBJECT : 0,
|
46
|
+
WRITING_SUB_URI : 1,
|
47
|
+
WRITING_BNODE_URI : 2,
|
48
|
+
PRE_PRED : 3,
|
49
|
+
WRITING_PRED_URI : 4,
|
50
|
+
PRE_OBJ : 5,
|
51
|
+
WRITING_OBJ_URI : 6,
|
52
|
+
WRITING_OBJ_BNODE : 7,
|
53
|
+
WRITING_OBJ_LITERAL : 8,
|
54
|
+
WRITING_LIT_LANG : 9,
|
55
|
+
WRITING_LIT_TYPE : 10,
|
56
|
+
POST_OBJ : 11,
|
57
|
+
ERROR : 12
|
58
|
+
};
|
59
|
+
function transitState(currState, c) {
|
60
|
+
var currLocation = currState.location;
|
61
|
+
var ret;
|
62
|
+
|
63
|
+
// Opening.
|
64
|
+
if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;
|
65
|
+
else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;
|
66
|
+
else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;
|
67
|
+
else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;
|
68
|
+
else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;
|
69
|
+
else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL;
|
70
|
+
|
71
|
+
// Closing.
|
72
|
+
else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;
|
73
|
+
else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;
|
74
|
+
else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;
|
75
|
+
else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;
|
76
|
+
else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;
|
77
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ;
|
78
|
+
else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;
|
79
|
+
else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;
|
80
|
+
|
81
|
+
// Closing typed and language literal.
|
82
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;
|
83
|
+
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;
|
84
|
+
|
85
|
+
// Spaces.
|
86
|
+
else if( c == ' ' &&
|
87
|
+
(
|
88
|
+
currLocation == Location.PRE_SUBJECT ||
|
89
|
+
currLocation == Location.PRE_PRED ||
|
90
|
+
currLocation == Location.PRE_OBJ ||
|
91
|
+
currLocation == Location.POST_OBJ
|
92
|
+
)
|
93
|
+
) ret = currLocation;
|
94
|
+
|
95
|
+
// Reset.
|
96
|
+
else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;
|
97
|
+
|
98
|
+
// Error
|
99
|
+
else ret = Location.ERROR;
|
100
|
+
|
101
|
+
currState.location=ret;
|
102
|
+
}
|
103
|
+
|
104
|
+
return {
|
105
|
+
startState: function() {
|
106
|
+
return {
|
107
|
+
location : Location.PRE_SUBJECT,
|
108
|
+
uris : [],
|
109
|
+
anchors : [],
|
110
|
+
bnodes : [],
|
111
|
+
langs : [],
|
112
|
+
types : []
|
113
|
+
};
|
114
|
+
},
|
115
|
+
token: function(stream, state) {
|
116
|
+
var ch = stream.next();
|
117
|
+
if(ch == '<') {
|
118
|
+
transitState(state, ch);
|
119
|
+
var parsedURI = '';
|
120
|
+
stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );
|
121
|
+
state.uris.push(parsedURI);
|
122
|
+
if( stream.match('#', false) ) return 'variable';
|
123
|
+
stream.next();
|
124
|
+
transitState(state, '>');
|
125
|
+
return 'variable';
|
126
|
+
}
|
127
|
+
if(ch == '#') {
|
128
|
+
var parsedAnchor = '';
|
129
|
+
stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});
|
130
|
+
state.anchors.push(parsedAnchor);
|
131
|
+
return 'variable-2';
|
132
|
+
}
|
133
|
+
if(ch == '>') {
|
134
|
+
transitState(state, '>');
|
135
|
+
return 'variable';
|
136
|
+
}
|
137
|
+
if(ch == '_') {
|
138
|
+
transitState(state, ch);
|
139
|
+
var parsedBNode = '';
|
140
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});
|
141
|
+
state.bnodes.push(parsedBNode);
|
142
|
+
stream.next();
|
143
|
+
transitState(state, ' ');
|
144
|
+
return 'builtin';
|
145
|
+
}
|
146
|
+
if(ch == '"') {
|
147
|
+
transitState(state, ch);
|
148
|
+
stream.eatWhile( function(c) { return c != '"'; } );
|
149
|
+
stream.next();
|
150
|
+
if( stream.peek() != '@' && stream.peek() != '^' ) {
|
151
|
+
transitState(state, '"');
|
152
|
+
}
|
153
|
+
return 'string';
|
154
|
+
}
|
155
|
+
if( ch == '@' ) {
|
156
|
+
transitState(state, '@');
|
157
|
+
var parsedLang = '';
|
158
|
+
stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});
|
159
|
+
state.langs.push(parsedLang);
|
160
|
+
stream.next();
|
161
|
+
transitState(state, ' ');
|
162
|
+
return 'string-2';
|
163
|
+
}
|
164
|
+
if( ch == '^' ) {
|
165
|
+
stream.next();
|
166
|
+
transitState(state, '^');
|
167
|
+
var parsedType = '';
|
168
|
+
stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );
|
169
|
+
state.types.push(parsedType);
|
170
|
+
stream.next();
|
171
|
+
transitState(state, '>');
|
172
|
+
return 'variable';
|
173
|
+
}
|
174
|
+
if( ch == ' ' ) {
|
175
|
+
transitState(state, ch);
|
176
|
+
}
|
177
|
+
if( ch == '.' ) {
|
178
|
+
transitState(state, ch);
|
179
|
+
}
|
180
|
+
}
|
181
|
+
};
|
182
|
+
});
|
183
|
+
|
184
|
+
// define the registered Media Type for n-triples:
|
185
|
+
// https://www.w3.org/TR/n-triples/#n-triples-mediatype
|
186
|
+
CodeMirror.defineMIME("application/n-triples", "ntriples");
|
187
|
+
|
188
|
+
// N-Quads is based on the N-Triples format (so same highlighting works)
|
189
|
+
// https://www.w3.org/TR/n-quads/
|
190
|
+
CodeMirror.defineMIME("application/n-quads", "ntriples");
|
191
|
+
|
192
|
+
// previously used, though technically incorrect media type for n-triples
|
193
|
+
CodeMirror.defineMIME("text/n-triples", "ntriples");
|
194
|
+
|
195
|
+
});
|
@@ -0,0 +1,139 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode("octave", function() {
|
15
|
+
function wordRegexp(words) {
|
16
|
+
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
17
|
+
}
|
18
|
+
|
19
|
+
var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]");
|
20
|
+
var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]');
|
21
|
+
var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))");
|
22
|
+
var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))");
|
23
|
+
var tripleDelimiters = new RegExp("^((>>=)|(<<=))");
|
24
|
+
var expressionEnd = new RegExp("^[\\]\\)]");
|
25
|
+
var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
|
26
|
+
|
27
|
+
var builtins = wordRegexp([
|
28
|
+
'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos',
|
29
|
+
'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh',
|
30
|
+
'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones',
|
31
|
+
'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov',
|
32
|
+
'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot',
|
33
|
+
'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str',
|
34
|
+
'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember'
|
35
|
+
]);
|
36
|
+
|
37
|
+
var keywords = wordRegexp([
|
38
|
+
'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction',
|
39
|
+
'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events',
|
40
|
+
'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until',
|
41
|
+
'continue', 'pkg'
|
42
|
+
]);
|
43
|
+
|
44
|
+
|
45
|
+
// tokenizers
|
46
|
+
function tokenTranspose(stream, state) {
|
47
|
+
if (!stream.sol() && stream.peek() === '\'') {
|
48
|
+
stream.next();
|
49
|
+
state.tokenize = tokenBase;
|
50
|
+
return 'operator';
|
51
|
+
}
|
52
|
+
state.tokenize = tokenBase;
|
53
|
+
return tokenBase(stream, state);
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
function tokenComment(stream, state) {
|
58
|
+
if (stream.match(/^.*%}/)) {
|
59
|
+
state.tokenize = tokenBase;
|
60
|
+
return 'comment';
|
61
|
+
};
|
62
|
+
stream.skipToEnd();
|
63
|
+
return 'comment';
|
64
|
+
}
|
65
|
+
|
66
|
+
function tokenBase(stream, state) {
|
67
|
+
// whitespaces
|
68
|
+
if (stream.eatSpace()) return null;
|
69
|
+
|
70
|
+
// Handle one line Comments
|
71
|
+
if (stream.match('%{')){
|
72
|
+
state.tokenize = tokenComment;
|
73
|
+
stream.skipToEnd();
|
74
|
+
return 'comment';
|
75
|
+
}
|
76
|
+
|
77
|
+
if (stream.match(/^[%#]/)){
|
78
|
+
stream.skipToEnd();
|
79
|
+
return 'comment';
|
80
|
+
}
|
81
|
+
|
82
|
+
// Handle Number Literals
|
83
|
+
if (stream.match(/^[0-9\.+-]/, false)) {
|
84
|
+
if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {
|
85
|
+
stream.tokenize = tokenBase;
|
86
|
+
return 'number'; };
|
87
|
+
if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
|
88
|
+
if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
|
89
|
+
}
|
90
|
+
if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };
|
91
|
+
|
92
|
+
// Handle Strings
|
93
|
+
var m = stream.match(/^"(?:[^"]|"")*("|$)/) || stream.match(/^'(?:[^']|'')*('|$)/)
|
94
|
+
if (m) { return m[1] ? 'string' : "string error"; }
|
95
|
+
|
96
|
+
// Handle words
|
97
|
+
if (stream.match(keywords)) { return 'keyword'; } ;
|
98
|
+
if (stream.match(builtins)) { return 'builtin'; } ;
|
99
|
+
if (stream.match(identifiers)) { return 'variable'; } ;
|
100
|
+
|
101
|
+
if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; };
|
102
|
+
if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; };
|
103
|
+
|
104
|
+
if (stream.match(expressionEnd)) {
|
105
|
+
state.tokenize = tokenTranspose;
|
106
|
+
return null;
|
107
|
+
};
|
108
|
+
|
109
|
+
|
110
|
+
// Handle non-detected items
|
111
|
+
stream.next();
|
112
|
+
return 'error';
|
113
|
+
};
|
114
|
+
|
115
|
+
|
116
|
+
return {
|
117
|
+
startState: function() {
|
118
|
+
return {
|
119
|
+
tokenize: tokenBase
|
120
|
+
};
|
121
|
+
},
|
122
|
+
|
123
|
+
token: function(stream, state) {
|
124
|
+
var style = state.tokenize(stream, state);
|
125
|
+
if (style === 'number' || style === 'variable'){
|
126
|
+
state.tokenize = tokenTranspose;
|
127
|
+
}
|
128
|
+
return style;
|
129
|
+
},
|
130
|
+
|
131
|
+
lineComment: '%',
|
132
|
+
|
133
|
+
fold: 'indent'
|
134
|
+
};
|
135
|
+
});
|
136
|
+
|
137
|
+
CodeMirror.defineMIME("text/x-octave", "octave");
|
138
|
+
|
139
|
+
});
|
@@ -0,0 +1,252 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode("oz", function (conf) {
|
15
|
+
|
16
|
+
function wordRegexp(words) {
|
17
|
+
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
18
|
+
}
|
19
|
+
|
20
|
+
var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/;
|
21
|
+
var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;
|
22
|
+
var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/;
|
23
|
+
|
24
|
+
var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch",
|
25
|
+
"finally", "with", "require", "prepare", "import", "export", "define", "do"];
|
26
|
+
var end = ["end"];
|
27
|
+
|
28
|
+
var atoms = wordRegexp(["true", "false", "nil", "unit"]);
|
29
|
+
var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
|
30
|
+
"mod", "div", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
|
31
|
+
var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
|
32
|
+
"choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
|
33
|
+
var middleKeywords = wordRegexp(middle);
|
34
|
+
var endKeywords = wordRegexp(end);
|
35
|
+
|
36
|
+
// Tokenizers
|
37
|
+
function tokenBase(stream, state) {
|
38
|
+
if (stream.eatSpace()) {
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
|
42
|
+
// Brackets
|
43
|
+
if(stream.match(/[{}]/)) {
|
44
|
+
return "bracket";
|
45
|
+
}
|
46
|
+
|
47
|
+
// Special [] keyword
|
48
|
+
if (stream.match(/(\[])/)) {
|
49
|
+
return "keyword"
|
50
|
+
}
|
51
|
+
|
52
|
+
// Operators
|
53
|
+
if (stream.match(tripleOperators) || stream.match(doubleOperators)) {
|
54
|
+
return "operator";
|
55
|
+
}
|
56
|
+
|
57
|
+
// Atoms
|
58
|
+
if(stream.match(atoms)) {
|
59
|
+
return 'atom';
|
60
|
+
}
|
61
|
+
|
62
|
+
// Opening keywords
|
63
|
+
var matched = stream.match(openingKeywords);
|
64
|
+
if (matched) {
|
65
|
+
if (!state.doInCurrentLine)
|
66
|
+
state.currentIndent++;
|
67
|
+
else
|
68
|
+
state.doInCurrentLine = false;
|
69
|
+
|
70
|
+
// Special matching for signatures
|
71
|
+
if(matched[0] == "proc" || matched[0] == "fun")
|
72
|
+
state.tokenize = tokenFunProc;
|
73
|
+
else if(matched[0] == "class")
|
74
|
+
state.tokenize = tokenClass;
|
75
|
+
else if(matched[0] == "meth")
|
76
|
+
state.tokenize = tokenMeth;
|
77
|
+
|
78
|
+
return 'keyword';
|
79
|
+
}
|
80
|
+
|
81
|
+
// Middle and other keywords
|
82
|
+
if (stream.match(middleKeywords) || stream.match(commonKeywords)) {
|
83
|
+
return "keyword"
|
84
|
+
}
|
85
|
+
|
86
|
+
// End keywords
|
87
|
+
if (stream.match(endKeywords)) {
|
88
|
+
state.currentIndent--;
|
89
|
+
return 'keyword';
|
90
|
+
}
|
91
|
+
|
92
|
+
// Eat the next char for next comparisons
|
93
|
+
var ch = stream.next();
|
94
|
+
|
95
|
+
// Strings
|
96
|
+
if (ch == '"' || ch == "'") {
|
97
|
+
state.tokenize = tokenString(ch);
|
98
|
+
return state.tokenize(stream, state);
|
99
|
+
}
|
100
|
+
|
101
|
+
// Numbers
|
102
|
+
if (/[~\d]/.test(ch)) {
|
103
|
+
if (ch == "~") {
|
104
|
+
if(! /^[0-9]/.test(stream.peek()))
|
105
|
+
return null;
|
106
|
+
else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
|
107
|
+
return "number";
|
108
|
+
}
|
109
|
+
|
110
|
+
if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
|
111
|
+
return "number";
|
112
|
+
|
113
|
+
return null;
|
114
|
+
}
|
115
|
+
|
116
|
+
// Comments
|
117
|
+
if (ch == "%") {
|
118
|
+
stream.skipToEnd();
|
119
|
+
return 'comment';
|
120
|
+
}
|
121
|
+
else if (ch == "/") {
|
122
|
+
if (stream.eat("*")) {
|
123
|
+
state.tokenize = tokenComment;
|
124
|
+
return tokenComment(stream, state);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
// Single operators
|
129
|
+
if(singleOperators.test(ch)) {
|
130
|
+
return "operator";
|
131
|
+
}
|
132
|
+
|
133
|
+
// If nothing match, we skip the entire alphanumerical block
|
134
|
+
stream.eatWhile(/\w/);
|
135
|
+
|
136
|
+
return "variable";
|
137
|
+
}
|
138
|
+
|
139
|
+
function tokenClass(stream, state) {
|
140
|
+
if (stream.eatSpace()) {
|
141
|
+
return null;
|
142
|
+
}
|
143
|
+
stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);
|
144
|
+
state.tokenize = tokenBase;
|
145
|
+
return "variable-3"
|
146
|
+
}
|
147
|
+
|
148
|
+
function tokenMeth(stream, state) {
|
149
|
+
if (stream.eatSpace()) {
|
150
|
+
return null;
|
151
|
+
}
|
152
|
+
stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);
|
153
|
+
state.tokenize = tokenBase;
|
154
|
+
return "def"
|
155
|
+
}
|
156
|
+
|
157
|
+
function tokenFunProc(stream, state) {
|
158
|
+
if (stream.eatSpace()) {
|
159
|
+
return null;
|
160
|
+
}
|
161
|
+
|
162
|
+
if(!state.hasPassedFirstStage && stream.eat("{")) {
|
163
|
+
state.hasPassedFirstStage = true;
|
164
|
+
return "bracket";
|
165
|
+
}
|
166
|
+
else if(state.hasPassedFirstStage) {
|
167
|
+
stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);
|
168
|
+
state.hasPassedFirstStage = false;
|
169
|
+
state.tokenize = tokenBase;
|
170
|
+
return "def"
|
171
|
+
}
|
172
|
+
else {
|
173
|
+
state.tokenize = tokenBase;
|
174
|
+
return null;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
function tokenComment(stream, state) {
|
179
|
+
var maybeEnd = false, ch;
|
180
|
+
while (ch = stream.next()) {
|
181
|
+
if (ch == "/" && maybeEnd) {
|
182
|
+
state.tokenize = tokenBase;
|
183
|
+
break;
|
184
|
+
}
|
185
|
+
maybeEnd = (ch == "*");
|
186
|
+
}
|
187
|
+
return "comment";
|
188
|
+
}
|
189
|
+
|
190
|
+
function tokenString(quote) {
|
191
|
+
return function (stream, state) {
|
192
|
+
var escaped = false, next, end = false;
|
193
|
+
while ((next = stream.next()) != null) {
|
194
|
+
if (next == quote && !escaped) {
|
195
|
+
end = true;
|
196
|
+
break;
|
197
|
+
}
|
198
|
+
escaped = !escaped && next == "\\";
|
199
|
+
}
|
200
|
+
if (end || !escaped)
|
201
|
+
state.tokenize = tokenBase;
|
202
|
+
return "string";
|
203
|
+
};
|
204
|
+
}
|
205
|
+
|
206
|
+
function buildElectricInputRegEx() {
|
207
|
+
// Reindentation should occur on [] or on a match of any of
|
208
|
+
// the block closing keywords, at the end of a line.
|
209
|
+
var allClosings = middle.concat(end);
|
210
|
+
return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$");
|
211
|
+
}
|
212
|
+
|
213
|
+
return {
|
214
|
+
|
215
|
+
startState: function () {
|
216
|
+
return {
|
217
|
+
tokenize: tokenBase,
|
218
|
+
currentIndent: 0,
|
219
|
+
doInCurrentLine: false,
|
220
|
+
hasPassedFirstStage: false
|
221
|
+
};
|
222
|
+
},
|
223
|
+
|
224
|
+
token: function (stream, state) {
|
225
|
+
if (stream.sol())
|
226
|
+
state.doInCurrentLine = 0;
|
227
|
+
|
228
|
+
return state.tokenize(stream, state);
|
229
|
+
},
|
230
|
+
|
231
|
+
indent: function (state, textAfter) {
|
232
|
+
var trueText = textAfter.replace(/^\s+|\s+$/g, '');
|
233
|
+
|
234
|
+
if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/))
|
235
|
+
return conf.indentUnit * (state.currentIndent - 1);
|
236
|
+
|
237
|
+
if (state.currentIndent < 0)
|
238
|
+
return 0;
|
239
|
+
|
240
|
+
return state.currentIndent * conf.indentUnit;
|
241
|
+
},
|
242
|
+
fold: "indent",
|
243
|
+
electricInput: buildElectricInputRegEx(),
|
244
|
+
lineComment: "%",
|
245
|
+
blockCommentStart: "/*",
|
246
|
+
blockCommentEnd: "*/"
|
247
|
+
};
|
248
|
+
});
|
249
|
+
|
250
|
+
CodeMirror.defineMIME("text/x-oz", "oz");
|
251
|
+
|
252
|
+
});
|