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",
59 "=finally": "FINALLY",
61 "=function": "FUNCTION",
64 "=instanceof": "INSTANCEOF",
81 return this.puncNames[ch];
123 matching : function(name) {
124 name = typeof(puncNames[name]) == 'undefined' ? name : puncNames[name];
126 return this.matchingNames[name];
129 "LEFT_PAREN": "RIGHT_PAREN",
130 "RIGHT_PAREN": "LEFT_PAREN",
131 "LEFT_CURLY": "RIGHT_CURLY",
132 "RIGHT_CURLY": "LEFT_CURLY",
133 "LEFT_BRACE": "RIGHT_BRACE",
134 "RIGHT_BRACE": "LEFT_BRACE"
137 isNumber : function(str) {
138 return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
141 isHexDec : function(str) {
142 return /^0x[0-9A-F]+$/i.test(str);
145 isWordChar : function(str) {
146 return /^[a-zA-Z0-9$_.]+$/.test(str);
149 isSpace : function(str) {
150 return (typeof this.whitespace(str) != "undefined");
153 isNewline : function(str) {
154 return (typeof this.newline(str) != "undefined");