1 //<script type="text/javscript">
9 isBuiltin : function(name) {
10 return (this.coreObjects.indexOf(name) > -1);
12 coreObjects : ['_global_', 'Array', 'Boolean', 'Date', 'Error',
13 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String'],
16 whitespace : function(ch) {
17 return this.whitespaceNames[ch];
24 "\u0009": "UNICODE_TAB",
25 "\u000A": "UNICODE_NBR",
26 "\u0008": "VERTICAL_TAB"
29 newline : function(ch) {
30 return this.newlineNames[ch];
35 "\u000A": "UNICODE_LF",
36 "\u000D": "UNICODE_CR",
37 "\u2029": "UNICODE_PS",
38 "\u2028": "UNICODE_LS"
41 keyword : function(word) {
42 return this.keywordNames["="+word];
44 isKeyword: function(word) {
45 return typeof(this.keywordNames["="+word]) == 'undefined' ? false : true;
53 "=continue": "CONTINUE",
54 "=default": "DEFAULT",
60 "=finally": "FINALLY",
62 "=function": "FUNCTION",
65 "=instanceof": "INSTANCEOF",
82 return this.puncNames[ch];
124 matching : function(name) {
125 name = typeof(this.puncNames[name]) == 'undefined' ? name : this.puncNames[name];
127 return this.matchingNames[name];
130 "LEFT_PAREN": "RIGHT_PAREN",
131 "RIGHT_PAREN": "LEFT_PAREN",
132 "LEFT_CURLY": "RIGHT_CURLY",
133 "RIGHT_CURLY": "LEFT_CURLY",
134 "LEFT_BRACE": "RIGHT_BRACE",
135 "RIGHT_BRACE": "LEFT_BRACE"
138 isNumber : function(str) {
139 return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
142 isHexDec : function(str) {
143 return /^0x[0-9A-F]+$/i.test(str);
146 isWordChar : function(str) {
147 return /^[a-zA-Z0-9$_.]+$/.test(str);
150 isSpace : function(str) {
151 return (typeof this.whitespace(str) != "undefined");
154 isNewline : function(str) {
155 return (typeof this.newline(str) != "undefined");