Remove outdated line and col information #218
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that we have closed #112, we could remove the col and line columns. The only problem is that we need to preserve the number of empty lines before the start of any content, which was done using
line1
so far. One way is to extract the starting line from the nested parse table, do the processing pass the number of blank lines to serialization function.Alternatively, we could add a start token at the top level of the nest, but that brings additional trouble: We'd have to check in every spacing rule that the token before is not the start token, otherwise we will add spaces before certain tokens, e.g. "{}" will become " {}". I think that's less elegant.
I also thought about adding the start line as an attribute to the parse table, but it seems that keeping the attribute attached to the parse table through all transformations is not necessarily more elegant.
This PR closes #147.
Note that in
enrich_terminals()
, the updated line and col information is added again.