complete redesign: use nodejs on server instead of php - documentation to be updated
This commit is contained in:
53
nodejs/node_modules/stylus/lib/token.js
generated
vendored
Normal file
53
nodejs/node_modules/stylus/lib/token.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
/*!
|
||||
* Stylus - Token
|
||||
* Copyright (c) Automattic <developer.wordpress.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var inspect = require('util').inspect;
|
||||
|
||||
/**
|
||||
* Initialize a new `Token` with the given `type` and `val`.
|
||||
*
|
||||
* @param {String} type
|
||||
* @param {Mixed} val
|
||||
* @api private
|
||||
*/
|
||||
|
||||
var Token = exports = module.exports = function Token(type, val) {
|
||||
this.type = type;
|
||||
this.val = val;
|
||||
};
|
||||
|
||||
/**
|
||||
* Custom inspect.
|
||||
*
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Token.prototype.inspect = function(){
|
||||
var val = ' ' + inspect(this.val);
|
||||
return '[Token:' + this.lineno + ':' + this.column + ' '
|
||||
+ '\x1b[32m' + this.type + '\x1b[0m'
|
||||
+ '\x1b[33m' + (this.val ? val : '') + '\x1b[0m'
|
||||
+ ']';
|
||||
};
|
||||
|
||||
/**
|
||||
* Return type or val.
|
||||
*
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Token.prototype.toString = function(){
|
||||
return (undefined === this.val
|
||||
? this.type
|
||||
: this.val).toString();
|
||||
};
|
Reference in New Issue
Block a user