nl_tokens: Parses a single expression ( one without any operators ) and returns a variable string or number
pl_tokens: function parseSingularExpression ( data ) { // A hash signifies a pointer if ( data [ 0 ] === '#' ) { var pointerId = data . substring ( 1 ) ; if ( isNaN ( parseInt ( pointerId ) ) ) return new SyntaxError ( 'Unexpected hash' ) ; return new statements . PointerStatement ( pointerId ) ; } var isString = <mask> . indexOf ( '"' ) !== - 1 ; // If there is any quote, its either a string or syntax error if ( isString ) { if ( data [ 0 ] !== '"' || data [ data . length - 1 ] !== '"' ) return new SyntaxError ( 'Unexpected quote' ) ; var stringContent = data . slice ( 1 , data . length - 1 ) ; return new statements . StringStatement ( stringContent ) ; } // If it is not not a number, it must be a number (see my logic?) var numberValue = parseFloat ( data ) ; if ( ! isNaN ( numberValue ) ) { return new statements . NumberStatement ( numberValue ) ; } // Otherwise, it must be a variable // TODO: validate variable name (this should actually go in the variable constructor..) return new statements . VariableStatement ( data ) ; }