xsawyerx / guacamole

Guacamole is a parser toolkit for Standard Perl. It provides fully static BNF-based parsing capability to a reasonable subset of Perl.
https://metacpan.org/pod/Guacamole
20 stars 8 forks source link

Support LiteralValue number with minus and dot #56

Closed xsawyerx closed 4 years ago

xsawyerx commented 4 years ago

When trying to parse -44.4, we get the following options:

# (Program
#   (StatementSeq
#     (Statement
#       (NonBraceExprValueR
#         (NonBraceValue
#           (NonBraceLiteral (LitNumber '-' '44' '.' '4')))))))
# (Program
#   (StatementSeq
#     (Statement
#       (NonBraceExprUnaryR
#         '-'
#         (ExprValueR
#           (Value
#             (Literal
#               (NonBraceLiteral (LitNumber '44' '.' '4')))))))))
# (Program
#   (StatementSeq
#     (Statement
#       (NonBraceExprAddR
#         (NonBraceExprValueL
#           (NonBraceValue (NonBraceLiteral (LitNumber '-' '44'))))
#         '.'
#         (ExprValueR
#           (Value
#             (Literal (NonBraceLiteral (LitNumber '4')))))))))
# (Program
#   (StatementSeq
#     (Statement
#       (NonBraceExprAddR
#         (NonBraceExprUnaryL
#           '-'
#           (ExprValueL
#             (Value
#               (Literal (NonBraceLiteral (LitNumber '44'))))))
#         '.'
#         (ExprValueR
#           (Value
#             (Literal (NonBraceLiteral (LitNumber '4')))))))))

This isn't urgent. I moved the failing test to TODO.