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.
Required to fix bug in https://github.com/liveview-native/liveview-client-swiftui/pull/1402.
Currently, the
sigil_SHEET
parses blocks and hands the block contents to asigil_RULES
. We don't pass down any line information to thesigil_RULES
. The parser used by thesigil_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
andrule-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)).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 andrule-yellow
on line 7.