aureooms/js-rpn

View on GitHub
js/src/compile.js

Summary

Maintainability
A
0 mins
Test Coverage
const compile = function ( isop , compute , stack , tokens ) {

    for ( let token of tokens ) {

        if ( isop( token ) ) operator( compute , stack , token ) ;

        else operand( stack , token ) ;

    }

    return stack.pop( ) ;

} ;

exports.compile = compile ;