You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These rules are all the same, except the "digit" part: for binary numbers I'm using $bin_digit regex for the digits, for hex I'm using $hex_digit, and similar for other rules.
If we could implement "rule templates" that take regex as arguments, we could do have one template with a "digit" parameter, and pass $hex_digit, $oct_digit, etc. to it and avoid duplication.
The text was updated successfully, but these errors were encountered:
Here are rules I'm using to lex Rust decimal, binary, octal, and hexadecimal numbers:
These rules are all the same, except the "digit" part: for binary numbers I'm using
$bin_digit
regex for the digits, for hex I'm using$hex_digit
, and similar for other rules.If we could implement "rule templates" that take regex as arguments, we could do have one template with a "digit" parameter, and pass
$hex_digit
,$oct_digit
, etc. to it and avoid duplication.The text was updated successfully, but these errors were encountered: