Calamari / shunting-yard.js

The shunting yard algorithm transforms a mathematical expression from infix notation into a reversed polish notation (postfix).
23 stars 3 forks source link

Bracket operations #8

Open dammyng opened 3 years ago

dammyng commented 3 years ago

import ShuntingYard from "shunting-yard.js" const shuntingYard = new ShuntingYard(); console.log(shuntingYard.resolve("4(6)"))

The operation listed above return 4 instead of an expected 24

I can actually work on this

Calamari commented 3 years ago

Hello dammyng.

I am not sure if that really should qualify as a valid expression, since it is missing an explicit operator. But I don't have another hard argument against adding this convenience right now since it is what (we lazy) humans may like to do.

So if you like, you can give it a try.