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 return this.matchingNames[name];
127 "LEFT_PAREN": "RIGHT_PAREN",
128 "RIGHT_PAREN": "LEFT_PAREN",
129 "LEFT_CURLY": "RIGHT_CURLY",
130 "RIGHT_CURLY": "LEFT_CURLY",
131 "LEFT_BRACE": "RIGHT_BRACE",
132 "RIGHT_BRACE": "LEFT_BRACE"
135 isNumber : function(str) {
136 return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
139 isHexDec : function(str) {
140 return /^0x[0-9A-F]+$/i.test(str);
143 isWordChar : function(str) {
144 return /^[a-zA-Z0-9$_.]+$/.test(str);
147 isSpace : function(str) {
148 return (typeof this.whitespace(str) != "undefined");
151 isNewline : function(str) {
152 return (typeof this.newline(str) != "undefined");