dist/jlox/Parser.js
/* HELPER FUNCTION TO GENERATE PARSER RULES */
HELPER FUNCTION TO GENERATE PARSER RULES
HELPER FUNCTION TO GENERATE PARSER RULES
generateBinaryRule(getNonterminal, terminals) {
        return () => {
            let expr = getNonterminal()(); 
            while (this.match(...terminals)) {
                const operator = this.previous();
                const right = getNonterminal()();
                expr = new Expr.Binary(expr, operator, right);
            }
            return expr;
        };
    }
generateBinaryRule ( getNonterminal , terminals ) { return ( ) => { let expr = getNonterminal ( ) ( ) ; while ( this . match ( ... terminals ) ) { const operator = this . previous ( ) ; const right = getNonterminal ( ) ( ) ; expr = new Expr . Binary ( expr , operator , right ) ; } return expr ; } ; }
HELPER FUNCTION TO GENERATE PARSER RULES
HELPER FUNCTION TO GENERATE PARSER RULES
// This is to sidestep passing in a method that hasn't been defined yet, since generateBinaryRule runs at construct/link time