Skip to content

Commit

Permalink
NASM: Converted indents to tabs, removed uneeded escapes, added lookb…
Browse files Browse the repository at this point in the history
…ehinds
  • Loading branch information
Golmote committed Aug 28, 2015
1 parent 2d204ae commit a92e4bd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
40 changes: 22 additions & 18 deletions components/prism-nasm.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
Prism.languages.nasm = {
'comment': /;.*$/m,
'string': /("|'|`)(\\?.)*?\1/m,
'label': {
pattern: /^\s*[A-Za-z\._\?\$][\w\.\?\$@~#]*:/m,
alias: 'function'
},
'keyword': [
/\[?BITS (16|32|64)\]?/m,
/^\s*section\s*[a-zA-Z\.]+:?/im,
/(?:extern|global)[^;]*/im,
/(?:CPU|FLOAT|DEFAULT).*$/m
],
'register': {
pattern: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/i,
alias: 'variable'
},
'number': /(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i,
'operator': /[\[\]\*+\-\/%<>=&|\$!]/m
'comment': /;.*$/m,
'string': /("|'|`)(\\?.)*?\1/m,
'label': {
pattern: /(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,
lookbehind: true,
alias: 'function'
},
'keyword': [
/\[?BITS (16|32|64)\]?/m,
{
pattern: /(^\s*)section\s*[a-zA-Z\.]+:?/im,
lookbehind: true
},
/(?:extern|global)[^;\r\n]*/im,
/(?:CPU|FLOAT|DEFAULT).*$/m
],
'register': {
pattern: /\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(bp|sp|si|di)|[cdefgs]s)\b/i,
alias: 'variable'
},
'number': /(\b|-|(?=\$))(0[hx][\da-f]*\.?[\da-f]+(p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|\d*\.?\d+(\.?e[+-]?\d+)?[dt]?)\b/i,
'operator': /[\[\]*+\-\/%<>=&|$!]/
};
2 changes: 1 addition & 1 deletion components/prism-nasm.min.js

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

0 comments on commit a92e4bd

Please sign in to comment.