Skip to content

Commit

Permalink
Update Prism to 1.28.0
Browse files Browse the repository at this point in the history
There are now 290 (from 277) syntaxes supported.

See: <https://github.com/PrismJS/prism/blob/master/CHANGELOG.md#1280-2022-04-17>
  • Loading branch information
wooorm committed Apr 17, 2022
1 parent 6708c7f commit 8605b6c
Show file tree
Hide file tree
Showing 41 changed files with 1,283 additions and 160 deletions.
2 changes: 1 addition & 1 deletion lang/abap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions lang/ada.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ export default function ada(Prism) {
pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i
}
],
'attr-name': /\b'\w+/,
attribute: {
pattern: /\b'\w+/,
alias: 'attr-name'
},
keyword:
/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,
/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,
boolean: /\b(?:false|true)\b/i,
operator: /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,
punctuation: /\.\.?|[,;():]/,
Expand Down
54 changes: 54 additions & 0 deletions lang/armasm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// @ts-nocheck
armasm.displayName = 'armasm'
armasm.aliases = ['arm-asm']

/** @type {import('../core.js').Syntax} */
export default function armasm(Prism) {
Prism.languages.armasm = {
comment: {
pattern: /;.*/,
greedy: true
},
string: {
pattern: /"(?:[^"\r\n]|"")*"/,
greedy: true,
inside: {
variable: {
pattern: /((?:^|[^$])(?:\${2})*)\$\w+/,
lookbehind: true
}
}
},
char: {
pattern: /'(?:[^'\r\n]{0,4}|'')'/,
greedy: true
},
'version-symbol': {
pattern: /\|[\w@]+\|/,
greedy: true,
alias: 'property'
},
boolean: /\b(?:FALSE|TRUE)\b/,
directive: {
pattern:
/\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/,
alias: 'property'
},
instruction: {
pattern:
/((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/,
lookbehind: true,
alias: 'keyword'
},
variable: /\$\w+/,
number:
/(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i,
register: {
pattern: /\b(?:r\d|lr)\b/,
alias: 'symbol'
},
operator: /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/,
punctuation: /[()[\],]/
}
Prism.languages['arm-asm'] = Prism.languages.armasm
}

0 comments on commit 8605b6c

Please sign in to comment.