You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a sytnax with dedenting
(all numbers here represent different types of spaces literal spaces are only used for alignment)
my_dedented_string = "
12 line1 with indent of 2 spaces, 12 removed
123 line2 with indent of 3 spaces, 12 removed, 3 stays
21 line3 with indent of 2 WRONG spaces, so ERROR
12" closing line defines the exact indentat should be removed (order and type)
I'd like to have the information from (12)" matching group from the end of the string to be available for comparison at the beginning of the string.
I think there is a way to get to the closing string in a branch, match whatever is before the last ", then fail that branch, then backtrack and switch to another branch.
But then this match before the last " is lost!
Preferred solution
Preserve the last match from the failed branch in a \1, or better yet, in some named dedent variable scoped to the whole branch
Alternatives
Maybe this more general proposal could also work #2912, though my shallow understanding is that it's mostly about carrying some information "forward" (matching new tag to old ones), but maybe a parameter can be recorded in a faild branch as well?
Or maybe there is an even better non-branching solution?
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Problem description
There is a sytnax with dedenting
(all numbers here represent different types of spaces literal spaces are only used for alignment)
I'd like to have the information from
(12)"
matching group from the end of the string to be available for comparison at the beginning of the string.I think there is a way to get to the closing string in a branch, match whatever is before the last
"
, then fail that branch, then backtrack and switch to another branch.But then this match before the last
"
is lost!Preferred solution
Preserve the last match from the failed branch in a
\1
, or better yet, in some nameddedent
variable scoped to the whole branchAlternatives
Maybe this more general proposal could also work #2912, though my shallow understanding is that it's mostly about carrying some information "forward" (matching new tag to old ones), but maybe a parameter can be recorded in a faild branch as well?
Or maybe there is an even better non-branching solution?
Additional Information
No response
The text was updated successfully, but these errors were encountered: