Skip to content

Fix the line number for rules produced inside a sigil_SHEET #77

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

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

NduatiK
Copy link
Contributor

@NduatiK NduatiK commented Aug 7, 2024

Required to fix bug in liveview-native/liveview-client-swiftui#1402.


Currently, the sigil_SHEET parses blocks and hands the block contents to a sigil_RULES. We don't pass down any line information to the sigil_RULES. The parser used by the sigil_RULES will not receive information about the location of the block contents it is parsing.

In the sheet below, the rules parser will treat rule-blue and rule-yellow as though they are at the same location. Both are assumed to be on line 3 (1 (Location of sheet parser) + 1 (location of block in sheet) + 1 (location of rule in block)).

1 | ~SHEET"""
2 | "color-blue" do
3 |   rule-blue
4 | end
5 | 
6 | "color-yellow" do
7 |   rule-yellow
8 | end
9 | """

This PR passes block line information from the sheet parser down to the rules parser which allows for more correct errors and warnings. In the example above, rule-blue will be on line 3 and rule-yellow on line 7.

@NduatiK NduatiK requested a review from bcardarella August 8, 2024 12:31
@bcardarella
Copy link
Contributor

I like it!

@bcardarella bcardarella merged commit 05639ca into main Aug 8, 2024
1 check passed
@bcardarella bcardarella deleted the nk-fix-line-number-for-block branch August 8, 2024 12:34
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

Successfully merging this pull request may close these issues.

2 participants