obsidian-dice-roller icon indicating copy to clipboard operation
obsidian-dice-roller copied to clipboard

Any expression using parentheses breaks

Open mulfok opened this issue 3 years ago • 1 comments

As of 7.8.3, it looks like any dice rolls with parenthesis have stopped working.

Dice usage such as: dice: 1 + (overall_level - 3)d5 used to produce:

demonstration

...it now unfortunately doesn't render anything, and opening any note with expressions like these produce the error message:

There was an error parsing the dice string: dice: 1 + (overall_level - 3)d5

Error: Mismatched Parentheses

image

I've tried rearranging the parentheses in every-which-way, but on both my phone and computer, they return the same error message.

This might just be some sillyness on my part, but both the brackets are the same. Sorry for the trouble haha,,

mulfok avatar Nov 23 '21 21:11 mulfok

No worries!

I am actually surprised that this ever worked, and if it did. it likely did not work the way you thought it was working behind the scenes.

I'm not entirely sure I'll be able to implement this, unfortunately, because the entire string is parsed for tokens and then the stack is parsed. Let me give it some though.

valentine195 avatar Nov 24 '21 00:11 valentine195