Pool roller interpets huge numbers as variable names #21

Closed
opened 2020-10-20 20:50:33 +00:00 by projectmoon · 0 comments
Owner

A minor issue with the dice pool roller. It resolves huge numbers (outside the bounds of i32) to variable names, because the resolver simply assumes the value is a variable if it cannot parse an i32. What it should do is check if all the characters in the element are digits, and if so try to parse an i32. If the i32 parse fails, return an error. If the element is not all digits, then we can assume it's a variable name.

A minor issue with the dice pool roller. It resolves huge numbers (outside the bounds of `i32`) to variable names, because the resolver simply assumes the value is a variable if it cannot parse an i32. What it should do is check if all the characters in the element are digits, and if so try to parse an i32. If the i32 parse fails, return an error. If the element is not all digits, then we can assume it's a variable name.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: projectmoon/tenebrous-dicebot#21
No description provided.