Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-like: fix FLOAT lexing #8079

Merged
merged 2 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6723,12 +6723,7 @@ EQUALS
'='
;

FLOAT
:
(
F_PositiveDigit* F_Digit '.' F_Digit+
)
;
FLOAT: F_PositiveDigit F_Digit* '.' F_Digit+;

FORWARD_SLASH
:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6656,7 +6656,7 @@ EQUALS
FLOAT
:
(
F_PositiveDigit* F_Digit '.' F_Digit+
F_PositiveDigit F_Digit* '.' F_Digit+
)
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6097,7 +6097,7 @@ EQUALS
FLOAT
:
(
F_PositiveDigit* F_Digit '.' F_Digit+
F_PositiveDigit F_Digit* '.' F_Digit+
) {lastTokenType() == SPEED}?
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2973,10 +2973,10 @@ DOUBLE_QUOTED_STRING
/*
FLOAT
:
F_PositiveDigit* F_Digit '.'
F_PositiveDigit F_Digit* '.'
(
'0'
| F_Digit* F_PositiveDigit
| F_PositiveDigit F_Digit*
)
;
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1654,10 +1654,10 @@ DOUBLE_QUOTED_STRING

FLOAT
:
F_PositiveDigit* F_Digit '.'
F_PositiveDigit F_Digit* '.'
(
'0'
| F_Digit* F_PositiveDigit
| F_PositiveDigit F_Digit*
)
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
hostname ios-bgp-procnum-dotted
!
router bgp 62918.62741
neighbor 2.2.2.3 remote-as 2
neighbor 2.2.2.3 remote-as 2.5
neighbor 3.3.3.4 remote-as 65000.65000
!
12 changes: 3 additions & 9 deletions tests/parsing-tests/unit-tests.ref
Original file line number Diff line number Diff line change
Expand Up @@ -16017,27 +16017,21 @@
" STORM_CONTROL:'storm-control'",
" BROADCAST:'broadcast'",
" LEVEL:'level'",
" UINT8:'100'",
" PERIOD:'.'",
" DEC:'00'",
" FLOAT:'100.00'",
" NEWLINE:'\\n'))",
" (if_inner*",
" (if_null_block*",
" STORM_CONTROL:'storm-control'",
" MULTICAST:'multicast'",
" LEVEL:'level'",
" UINT8:'100'",
" PERIOD:'.'",
" DEC:'00'",
" FLOAT:'100.00'",
" NEWLINE:'\\n'))",
" (if_inner*",
" (if_null_block*",
" STORM_CONTROL:'storm-control'",
" UNICAST:'unicast'",
" LEVEL:'level'",
" UINT8:'100'",
" PERIOD:'.'",
" DEC:'00'",
" FLOAT:'100.00'",
" NEWLINE:'\\n'))",
" (if_inner*",
" (if_switchport",
Expand Down