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

Rules for indentation #167

Closed
apblack opened this issue Jun 18, 2018 · 2 comments
Closed

Rules for indentation #167

apblack opened this issue Jun 18, 2018 · 2 comments

Comments

@apblack
Copy link
Contributor

apblack commented Jun 18, 2018

I have added rules for indentation to the spec. These are (I believe) the rules that are implemented in SmallGrace. I'm in the process of implementing them in minigrace.

I probably should have made this change in a branch, and then issued a pull request. I didn't do so because that process seems to get no comments, and thus makes no progress. Should I have done it anyway?

@KimBruce
Copy link
Contributor

KimBruce commented Jun 19, 2018 via email

@apblack
Copy link
Contributor Author

apblack commented Jul 21, 2018

In writing tests for the layout rules, I found that one was not implemented correctly. This has now been fixed, but as a result some programs that used to compile might now fail.

The test is js/tests/t006_lexer_test.grace. The issue was with continuations. The spec says that

Further physical lines at the same (or greater) indentation are treated as part of the same logical line. The continuation ends either when the indentation decreases, or when the continuation line contains an unmatched brace.

However, decreases in indentation were not being taken as ending the continuation; it went on until the indentation returned to the opening level. So a block of continuation lines could wander all over the page, rather than having a strictly increasing indentation. I still think that the rule as written is correct, but if we decide that insisting on consent or increasing indentation is too strict, we could change the rule.

Note that a separate rule says that, at the end of a continuation,

The indentation must return to that of the line that began ... the continued line ...

@apblack apblack closed this as completed Jul 21, 2018
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