Skip to content

Commit

Permalink
Update prism to 1.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan authored Aug 11, 2020
1 parent 54d2268 commit aa97241
Show file tree
Hide file tree
Showing 121 changed files with 1,740 additions and 525 deletions.
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ refractor.register(require('./lang/abap.js'))
refractor.register(require('./lang/abnf.js'))
refractor.register(require('./lang/actionscript.js'))
refractor.register(require('./lang/ada.js'))
refractor.register(require('./lang/agda.js'))
refractor.register(require('./lang/al.js'))
refractor.register(require('./lang/antlr4.js'))
refractor.register(require('./lang/apacheconf.js'))
refractor.register(require('./lang/apl.js'))
Expand Down Expand Up @@ -40,14 +42,17 @@ refractor.register(require('./lang/crystal.js'))
refractor.register(require('./lang/csharp.js'))
refractor.register(require('./lang/csp.js'))
refractor.register(require('./lang/css-extras.js'))
refractor.register(require('./lang/cypher.js'))
refractor.register(require('./lang/d.js'))
refractor.register(require('./lang/dart.js'))
refractor.register(require('./lang/dax.js'))
refractor.register(require('./lang/dhall.js'))
refractor.register(require('./lang/diff.js'))
refractor.register(require('./lang/django.js'))
refractor.register(require('./lang/dns-zone-file.js'))
refractor.register(require('./lang/docker.js'))
refractor.register(require('./lang/ebnf.js'))
refractor.register(require('./lang/editorconfig.js'))
refractor.register(require('./lang/eiffel.js'))
refractor.register(require('./lang/ejs.js'))
refractor.register(require('./lang/elixir.js'))
Expand Down Expand Up @@ -77,11 +82,14 @@ refractor.register(require('./lang/handlebars.js'))
refractor.register(require('./lang/haskell.js'))
refractor.register(require('./lang/haxe.js'))
refractor.register(require('./lang/hcl.js'))
refractor.register(require('./lang/hlsl.js'))
refractor.register(require('./lang/hpkp.js'))
refractor.register(require('./lang/hsts.js'))
refractor.register(require('./lang/http.js'))
refractor.register(require('./lang/ichigojam.js'))
refractor.register(require('./lang/icon.js'))
refractor.register(require('./lang/iecst.js'))
refractor.register(require('./lang/ignore.js'))
refractor.register(require('./lang/inform7.js'))
refractor.register(require('./lang/ini.js'))
refractor.register(require('./lang/io.js'))
Expand All @@ -98,6 +106,7 @@ refractor.register(require('./lang/jsdoc.js'))
refractor.register(require('./lang/json.js'))
refractor.register(require('./lang/json5.js'))
refractor.register(require('./lang/jsonp.js'))
refractor.register(require('./lang/jsstacktrace.js'))
refractor.register(require('./lang/jsx.js'))
refractor.register(require('./lang/julia.js'))
refractor.register(require('./lang/keyman.js'))
Expand Down Expand Up @@ -138,6 +147,7 @@ refractor.register(require('./lang/parser.js'))
refractor.register(require('./lang/pascal.js'))
refractor.register(require('./lang/pascaligo.js'))
refractor.register(require('./lang/pcaxis.js'))
refractor.register(require('./lang/peoplecode.js'))
refractor.register(require('./lang/perl.js'))
refractor.register(require('./lang/php-extras.js'))
refractor.register(require('./lang/php.js'))
Expand All @@ -152,11 +162,13 @@ refractor.register(require('./lang/protobuf.js'))
refractor.register(require('./lang/pug.js'))
refractor.register(require('./lang/puppet.js'))
refractor.register(require('./lang/pure.js'))
refractor.register(require('./lang/purebasic.js'))
refractor.register(require('./lang/python.js'))
refractor.register(require('./lang/q.js'))
refractor.register(require('./lang/qml.js'))
refractor.register(require('./lang/qore.js'))
refractor.register(require('./lang/r.js'))
refractor.register(require('./lang/racket.js'))
refractor.register(require('./lang/reason.js'))
refractor.register(require('./lang/regex.js'))
refractor.register(require('./lang/renpy.js'))
Expand All @@ -172,6 +184,7 @@ refractor.register(require('./lang/scala.js'))
refractor.register(require('./lang/scheme.js'))
refractor.register(require('./lang/scss.js'))
refractor.register(require('./lang/shell-session.js'))
refractor.register(require('./lang/smali.js'))
refractor.register(require('./lang/smalltalk.js'))
refractor.register(require('./lang/smarty.js'))
refractor.register(require('./lang/solidity.js'))
Expand All @@ -195,17 +208,21 @@ refractor.register(require('./lang/tt2.js'))
refractor.register(require('./lang/turtle.js'))
refractor.register(require('./lang/twig.js'))
refractor.register(require('./lang/typescript.js'))
refractor.register(require('./lang/unrealscript.js'))
refractor.register(require('./lang/vala.js'))
refractor.register(require('./lang/vbnet.js'))
refractor.register(require('./lang/velocity.js'))
refractor.register(require('./lang/verilog.js'))
refractor.register(require('./lang/vhdl.js'))
refractor.register(require('./lang/vim.js'))
refractor.register(require('./lang/visual-basic.js'))
refractor.register(require('./lang/warpscript.js'))
refractor.register(require('./lang/wasm.js'))
refractor.register(require('./lang/wiki.js'))
refractor.register(require('./lang/xeora.js'))
refractor.register(require('./lang/xml-doc.js'))
refractor.register(require('./lang/xojo.js'))
refractor.register(require('./lang/xquery.js'))
refractor.register(require('./lang/yaml.js'))
refractor.register(require('./lang/yang.js'))
refractor.register(require('./lang/zig.js'))
30 changes: 30 additions & 0 deletions lang/agda.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

module.exports = agda
agda.displayName = 'agda'
agda.aliases = []
function agda(Prism) {
;(function (Prism) {
Prism.languages.agda = {
comment: /\{-[\s\S]*?(?:-\}|$)|--.*/,
string: {
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,
greedy: true
},
punctuation: /[(){}⦃⦄.;@]/,
'class-name': {
pattern: /((?:data|record) +)\S+/,
lookbehind: true
},
function: {
pattern: /(^[ \t]*)[^:\r\n]+?(?=:)/m,
lookbehind: true
},
operator: {
pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,
lookbehind: true
},
keyword: /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/
}
})(Prism)
}
30 changes: 30 additions & 0 deletions lang/al.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

module.exports = al
al.displayName = 'al'
al.aliases = []
function al(Prism) {
// based on https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage
Prism.languages.al = {
comment: /\/\/.*|\/\*[\s\S]*?\*\//,
string: {
pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,
greedy: true
},
function: {
pattern: /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,
lookbehind: true
},
keyword: [
// keywords
/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i, // objects and metadata that are used like keywords
/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i
],
number: /\b(?:0x[\da-f]+|(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(?:F|U(?:LL?)?|LL?)?\b/i,
boolean: /\b(?:false|true)\b/i,
variable: /\b(?:Curr(?:FieldNo|Page|Report)|RequestOptionsPage|x?Rec)\b/,
'class-name': /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,
operator: /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,
punctuation: /[()\[\]{}:.;,]/
}
}
2 changes: 1 addition & 1 deletion lang/antlr4.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function antlr4(Prism) {
}
},
command: {
pattern: /(->\s*)(?:\s*(?:,\s*)?[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,
pattern: /(->\s*)(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,
lookbehind: true,
inside: {
function: /\b\w+(?=\s*(?:[,(]|$))/,
Expand Down
4 changes: 2 additions & 2 deletions lang/apl.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function apl(Prism) {
pattern: /'(?:[^'\r\n]|'')*'/,
greedy: true
},
number: /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i,
number: /¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞))?/i,
statement: /:[A-Z][a-z][A-Za-z]*\b/,
'system-function': {
pattern: /⎕[A-Z]+/i,
Expand All @@ -23,7 +23,7 @@ function apl(Prism) {
alias: 'operator'
},
'dyadic-operator': {
pattern: /[.⍣⍠⍤∘⌸@⌺]/,
pattern: /[.⍣⍠⍤∘⌸@⌺]/,
alias: 'operator'
},
assignment: {
Expand Down
2 changes: 1 addition & 1 deletion lang/applescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function applescript(Prism) {
Prism.languages.applescript = {
comment: [
// Allow one level of nesting
/\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/,
/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,
/--.+/,
/#.+/
],
Expand Down
2 changes: 1 addition & 1 deletion lang/asciidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Then we handle the unconstrained quotes.
Those do not have the restrictions of the constrained quotes.
They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes))
*/
pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,
pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,
lookbehind: true,
inside: {
attributes: attributes,
Expand Down
6 changes: 3 additions & 3 deletions lang/asm6502.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ function asm6502(Prism) {
alias: 'property'
},
hexnumber: {
pattern: /#?\$[\da-f]{2,4}/i,
pattern: /#?\$[\da-f]{2,4}\b/i,
alias: 'string'
},
binarynumber: {
pattern: /#?%[01]+/,
pattern: /#?%[01]+\b/,
alias: 'string'
},
decimalnumber: {
pattern: /#?\d+/,
pattern: /#?\b\d+\b/,
alias: 'string'
},
register: {
Expand Down
3 changes: 2 additions & 1 deletion lang/aspnet.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict'

var refractorCsharp = require('./csharp.js')
module.exports = aspnet
aspnet.displayName = 'aspnet'
aspnet.aliases = []
function aspnet(Prism) {
Prism.register(refractorCsharp)
Prism.languages.aspnet = Prism.languages.extend('markup', {
'page-directive': {
pattern: /<%\s*@.*%>/i,
Expand Down
Loading

0 comments on commit aa97241

Please sign in to comment.