MetaScript.js
function evaluate(expr) {
            if (expr.substring(0, 2) === '==') {
                return 'write(JSON.stringify('+expr.substring(2).trim()+'));\n';
            } else if (expr.substring(0, 1) === '=') {
                return 'write('+expr.substring(1).trim()+');\n';
            } else if (expr.substring(0, 3) === '...') {
                expr = '//...\n'+expr.substring(3).trim()+'\n//.';
            }
            if (expr !== '') {
                return expr+'\n';
            }
            return '';
        }
function evaluate(expr) {
            if (expr.substring(0, 2) === '==') {
                return 'write(JSON.stringify('+expr.substring(2).trim()+'));\n';
            } else if (expr.substring(0, 1) === '=') {
                return 'write('+expr.substring(1).trim()+');\n';
            } else if (expr.substring(0, 3) === '...') {
                expr = '//...\n'+expr.substring(3).trim()+'\n//.';
            }
            if (expr !== '') {
                return expr+'\n';
            }
            return '';
        }
function evaluate ( expr ) { if ( expr . substring ( 0 , 2 ) === '==' ) { return 'write(JSON.stringify(' + expr . substring ( 2 ) . trim ( ) + '));\n' ; } else if ( expr . substring ( 0 , 1 ) === '=' ) { return 'write(' + expr . substring ( 1 ) . trim ( ) + ');\n' ; } else if ( expr . substring ( 0 , 3 ) === '...' ) { expr = '//...\n' + expr . substring ( 3 ) . trim ( ) + '\n//.' ; } if ( expr !== '' ) { return expr + '\n' ; } return '' ; }
Evaluates a meta expression
Evaluates a meta expression