-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fea-rs] Fix panic if same file was included twice
This wasn't something I had considered originally, but the fix is easy and zero-overhead.
- Loading branch information
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
fea-rs/test-data/parse-tests/good/include_same_file_twice.PARSE_TREE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FILE@[0; 147) | ||
#@0 "# we had an issue where we would panic if the same file was included twice" | ||
WS@74 "\n" | ||
FeatureNode@[75; 109) | ||
FeatureKw@75 "feature" | ||
WS@82 " " | ||
Tag@83 "nam" | ||
WS@86 " " | ||
{@87 "{" | ||
WS@88 "\n " | ||
GposType2@[91; 102) | ||
PosKw@91 "pos" | ||
WS@94 " " | ||
GlyphName@95 "A" | ||
WS@96 " " | ||
GlyphName@97 "B" | ||
WS@98 " " | ||
ValueRecordNode@[99; 101) | ||
NUM@99 "20" | ||
;@101 ";" | ||
WS@102 "\n" | ||
}@103 "}" | ||
WS@104 " " | ||
Tag@105 "nam" | ||
;@108 ";" | ||
WS@109 "\n" | ||
WS@110 "\n" | ||
FeatureNode@[111; 145) | ||
FeatureKw@111 "feature" | ||
WS@118 " " | ||
Tag@119 "nam" | ||
WS@122 " " | ||
{@123 "{" | ||
WS@124 "\n " | ||
GposType2@[127; 138) | ||
PosKw@127 "pos" | ||
WS@130 " " | ||
GlyphName@131 "A" | ||
WS@132 " " | ||
GlyphName@133 "B" | ||
WS@134 " " | ||
ValueRecordNode@[135; 137) | ||
NUM@135 "20" | ||
;@137 ";" | ||
WS@138 "\n" | ||
}@139 "}" | ||
WS@140 " " | ||
Tag@141 "nam" | ||
;@144 ";" | ||
WS@145 "\n" | ||
WS@146 "\n" |
3 changes: 3 additions & 0 deletions
3
fea-rs/test-data/parse-tests/good/include_same_file_twice.fea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# we had an issue where we would panic if the same file was included twice | ||
include(short-tag.fea); | ||
include(short-tag.fea); |