Jerrylum / path.jerryio

The best path editor in VRC for designing skills routes and generating path files.
https://path.jerryio.com
GNU General Public License v3.0
32 stars 14 forks source link

:bug: Negative Zero With a Decimal Point Is Not Valid for the Token Parser #16

Closed Jerrylum closed 10 months ago

Jerrylum commented 10 months ago

Describe the bug The following is the description of the format of Number in EBNF:

Number       ::= (NegativeInt | Int) Frac?

DecimalPoint ::= '.'
Digit        ::= '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
Digit1To9    ::= '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
Frac         ::= DecimalPoint Digit+
Int          ::= Zero | PositiveInt
Minus        ::= '-'
NegativeInt  ::= Minus PositiveInt
PositiveInt  ::= Digit1To9 Digit*
Zero         ::= '0'

Delimiter     ::= " "+ | "NEXT LINE"

It is incorrect since a negative zero with a decimal point is not considered valid.

To Reproduce Provided by discord user gradient_descent:

You cannot input negative numbers that are less than 1 into points Im on MacOS

https://github.com/Jerrylum/path.jerryio/assets/12783829/8d9e34c4-40cb-403d-89ab-99e013080fbe

Expected behavior The format of Number should be changed to: Number ::= Minus? Int Frac?

Screenshots image

Desktop (please complete the following information):

Additional context None