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

Disallow mixing tabs and spaces for the sequence block #4

Open
clairexen opened this issue Jul 20, 2023 · 1 comment
Open

Disallow mixing tabs and spaces for the sequence block #4

clairexen opened this issue Jul 20, 2023 · 1 comment

Comments

@clairexen
Copy link
Member

clairexen commented Jul 20, 2023

I was staring at this

[sequence]
cover r0c1:
  cover r0c2:
    cover r0c3:
      cover r0c4:
        cover r0c5:
          cover r0c6:
            cover r1c1:
              cover r1c2:
                cover r1c3:
		  trace sofar

and didn't understand why I was getting a trace for r0c2 for nearly a whole minute 🤣

instead of just comparing the length of the indent, maybe let's also see if the smaller is actually a prefix of the larger, and call it a syntax error if it doesn't?

KrystalDelusion added a commit that referenced this issue Aug 14, 2023
Give a warning for mixed whitespace, pending possible upgrade to error.
@KrystalDelusion
Copy link
Member

Rather than comparing the length, the regex will only match it as a child if it starts with the same whitespace, so \t might register as the child of \t, but not . So trace sofar should be a child of cover r0c1 not cover r0c2, and if you were getting a trace for r0c2 then that is a separate bug, but not one I am able to replicate locally (at least not with some quick testing).

36403a8 adds a warning if whitespace is mixed, but I can change that to an error if you think that is better (since it is probably pretty easy to miss the warning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants