added site files
This commit is contained in:
parent
a6f70a6c78
commit
329148c253
253 changed files with 30486 additions and 0 deletions
78
EnlighterJS/Source/Language/Javascript.js
Normal file
78
EnlighterJS/Source/Language/Javascript.js
Normal file
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
---
|
||||
description: JavaScript language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.javascript]
|
||||
...
|
||||
*/
|
||||
EJS.Language.javascript = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function()
|
||||
{
|
||||
this.keywords = {
|
||||
commonKeywords: {
|
||||
csv: "as, break, case, catch, continue, delete, do, else, eval, finally, for, if, in, is, instanceof, return, switch, this, throw, try, typeof, void, while, write, with",
|
||||
alias: 'kw1'
|
||||
},
|
||||
langKeywords: {
|
||||
csv: "class, const, default, debugger, export, extends, false, function, import, namespace, new, null, package, private, protected, public, super, true, use, var",
|
||||
alias: 'kw2'
|
||||
},
|
||||
windowKeywords: {
|
||||
csv: "alert, confirm, open, print, prompt",
|
||||
alias: 'kw3'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': {
|
||||
pattern: this.common.slashComments,
|
||||
alias: 'co1'
|
||||
},
|
||||
'multiComments': {
|
||||
pattern: this.common.multiComments,
|
||||
alias: 'co2'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
'methodCalls': {
|
||||
pattern: this.common.properties,
|
||||
alias: 'me0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+)\b/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'regex': {
|
||||
pattern: this.delimToRegExp("/", "\\", "/", "g", "[gimy]*"),
|
||||
alias: 're0'
|
||||
},
|
||||
'symbols': {
|
||||
pattern: /\+|-|\*|\/|%|!|@|&|\||\^|\<|\>|=|,|\.|;|\?|:/g,
|
||||
alias: 'sy0'
|
||||
}
|
||||
};
|
||||
|
||||
this.delimiters = {
|
||||
start: this.strictRegExp('<script type="text/javascript">', '<script language="javascript">'),
|
||||
end: this.strictRegExp('<\/script>')
|
||||
};
|
||||
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue