-
Notifications
You must be signed in to change notification settings - Fork 30
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
Suggestion: reduce need for spaces #26
Comments
I see that in the code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I find it somewhat annoying that I have to write
3 4 *
instead of3 4*
. I know that clac usessdssplitargs()
, which needs whitespace between tokens, and that any enhancement needs to be unambiguous for both the code and the user. I propose the following solution:Every token output by
sdssplitargs()
is examined first in its entirety, as it is now, and then, if it's not recognized, it is split into a head and a tail in a loop, where the tail is 1, 2, 3... characters long, until the head is recognized (or until the head would be empty, in which case everything is discarded). As soon as the head is recognized, it is processed, and then the tail is handled in the same way (cyclically or recursively).E.g., if the input is
2pi*
(supposingpi
is a word): it is not recognized, so2pi
is tried (the tail being*
), then2p
(with taili*
) and then2
, which is recognized and processed. Then the tailpi*
is not recognized, so thatpi
is tried, which is recognized and processed, and finally the tail*
is recognized and processed.In other words: tokens are parsed in a "greedy" way, with backtracking.
The text was updated successfully, but these errors were encountered: