-
Notifications
You must be signed in to change notification settings - Fork 8
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
Some underspecified parts in 1-regexes #55
Comments
This is a good edge-case, as it comes down to whether it is banned as a syntactic element,
The second alternative would be to come up with a well-defined value for
My intention was to take the first approach, as it is a really interesting example of As a consequence, I'll resolve it simply by saying that no fractions with zero |
No, or at least not in the language as I'm defining it. The idea here is that a fraction is a primitive literal or constant in this language, so it will You may be thinking of things in C, where you might have:
However, there is some interesting behavior here, as that is
There is no such thing as a negative literal in C, so it is actually
But in this language an entire fraction can be positive or negative, though not the |
This is a natural view of what the lexer is doing, but it is not quite how the lexer works. You So in our language, if there is an opening For example, the input:
Should be lexed as: |
The examples given for the output in 1-regexes are from least to most. Would it be possible to update these to reflect the new specification? |
Yes - thanks for pointing it out, and sorry again for not noticing this one. (Embedded examples have long been a problem for courseworks, as they are |
What should happen when the denominator of a fraction is
0
?Can the denominator of a fraction have a
-
sign after the/
sign to indicate that the denominator is negative?What should happen if we detect an "illegal sequence" (basically if
[ ]
spans a new line)The text was updated successfully, but these errors were encountered: