Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (37 sloc) 1.251 kb
FUNCTION ADDSIMPLETOKEN () {
ARRAY.PROTOTYPE.SLICE.CALL(ARGUMENTS).FOREACH(FUNCTION (K) {
FOR (VAR I = 0; I < TOKENS.LENGTH; I++)
IF (TOKENS[I].REG.SOURCE === K) RETURN
TOKENS.PUSH({ REG: NEW REGEXP(K, 'IG'), REP: K })
})
RETURN MODULE.EXPORTS
}
FUNCTION ADDKEYS (O) {
OBJECT.GETOWNPROPERTYNAMES(O).FOREACH(FUNCTION (K) {
IF (K !== K.TOLOWERCASE() && K.TOLOWERCASE() != 'FUNCTION') ADDSIMPLETOKEN(K)
})
}
ADDKEYS(OBJECT.PROTOTYPE)
ADDKEYS(STRING.PROTOTYPE)
ADDKEYS(NUMBER.PROTOTYPE)
ADDKEYS(ARRAY.PROTOTYPE)
ADDKEYS(DATE.PROTOTYPE)
ADDKEYS(BOOLEAN.PROTOTYPE)
ADDKEYS(GLOBAL)
ADDKEYS(PROCESS)
ADDKEYS(BUFFER)
ADDKEYS(REQUIRE('FS'))
ADDKEYS(REQUIRE('HTTP'))
ADDKEYS(REQUIRE('HTTPS'))
ADDKEYS(REQUIRE('EVENTS'))
ADDKEYS(REQUIRE('STREAM'))
FUNCTION INIT (FILE, ARG_NAMES, ARG_VALUES) {
RETURN LOAD(FILE, [], ARG_NAMES).APPLY(NULL, ARG_VALUES)
}
MODULE.EXPORTS['INIT'.TOUPPERCASE()] = INIT
MODULE.EXPORTS['ADDSIMPLETOKEN'.TOUPPERCASE()] = ADDSIMPLETOKEN
MODULE.EXPORTS['COMPILE'.TOUPPERCASE()] = TRANSLATE
MODULE.CONSTRUCTOR._EXTENSIONS['.CS'.TOUPPERCASE()] = FUNCTION (MODULE, FILENAME) {
VAR CONTENT = REQUIRE('FS').READFILESYNC(filename, 'UTF8');
MODULE._COMPILE(TRANSLATE(CONTENT), FILENAME);
}
Jump to Line
Something went wrong with that request. Please try again.