Rolisteam / DiceParser

Powerful dice Roller is used as discord bot, irc bot, cli tool and inside Rolisteam : 1d20+4, 1L[head,arm,leg,belly,chest], 1d6+1d8, 8+5*3
http://www.rolisteam.org/
GNU General Public License v3.0
125 stars 31 forks source link

Warning with comments #24

Closed ditto13 closed 5 years ago

ditto13 commented 5 years ago

Recently Diceparser is throwing warning messages due to extra comments, despite the comment being behind a # character:

image

image

also tried with space after #:

image

to confirm: Dec 18, @9 pm EST it was working fine, warnings started *am EST, Dec 19. Seems something changed between there?

obiwankennedy commented 5 years ago

Should be fixed.

ditto13 commented 5 years ago

Confirmed ! Thanks!

Curious .. what was root issue ?

obiwankennedy commented 5 years ago

DiceParser works like it is eating the command. When it understands the first character, this character is removed from the command line. And if it did not understand the rest of the command, it stopped the parsing and ran the command without displaying any warnings about "that part of the command has been ignored". For example: !1d6¿3 It would had understand 1d6, and run it but ¿3 would have been completely ignored, without user notification about it. So now, you are noticed when the whole command is not understand.

So i had management of that. At the end of the parsing step, if the command still contains characters that means not the whole command has been understood. But the reading of comment did not removed the comment from the command line. I just fix the coment reading to remove the comment from the command.

ditto13 commented 5 years ago

Ah, makes sense .. thanks for quick response and explanation! :)