-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[FEATURE] Support for indentation in 'of/else/else if' etc. #18798
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
Conversation
Needs a gramar update too. For this, patch some |
There seems to be some nimble important_packages hiccups. |
CI passed earlier with the same implementation, and it is very unlikely that grammar comment modification affected semcheck for a package (code fails with type mismatch error). Does this mean I need to figure out what is wrong, or PR will still be accepted? |
It means we'll close and reopen the PR this weekend until it's green. |
CI is broken which doesn't run at all but is green until this PR: #18811 (make sure you already fetch the latest commit) |
I don't think closing and reopening this PR helps. As I said before, the PR may break some packages (CI may be green wrongly before). So make sure the PR already bases on the latest commit. If it were, maybe you need to figure out why the |
Separately executing testament for package batch 1_3, running |
IMO your PR can affect code like this readStmt = if typeMapping.hasKey(node.protoType): quote do: `stream`.`protoRead`()
else: quote do: `stream`.`protoRead`(`stream`.protoReadInt64()) #TODO: This is not implemented on the writer level see protobuf failure
|
Closing because it seems like it is impossible to implement cleanly, considering all of these ridiculous edge cases that I didn't even know were valid. Basically allowing any kind of flexibility with block arguments would create 'danging else' kind of situation, turning implementation in a completely broken piece of garbage, and it is not worth it. readStmt = if 1: quote do: 3 # ok now
else: quote do: 2
readStmt = if 1: quote: 3 # ok now
else: quote: 2
match: # Supported now
myOf: 12
of:
discard
match 1: # supported now, would be ambigous to implement
match 2:
of 1: discard # For inner one, indented against 'match 2'
of 1: discard # Meant to be added to outer, or inner?
of 1: discard # Added to outer one The same goes for |
And this is off-topic, but what is the point of having CI that randomly allows passing invalid code in the first run? If I initially updated grammar, it could potentially be merged, because the implementation looks so "harmless" and "simple" and no sane person could make up code like this for unit tests. |
It was a mistake in testament logics and has been fixed. see #18805 Because it didn't raise when a package name was wrong. The error was swallowed silently. |
Implements nim-lang/RFCs#420