diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2023-04-08 18:52:00 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2023-04-08 18:52:00 -0300 |
commit | d849f5e301fa47cfd87df1e7f1ad0346ddf387f1 (patch) | |
tree | a2480d05b753d94a6a8afee9832a902edf02d266 /src/parser.rs | |
parent | 6dd30531ac62f6a3a564b7341d43f6cd71b90794 (diff) |
Initial success
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.rs b/src/parser.rs index eb378ad..744ab0f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -354,7 +354,7 @@ where let self_ = &mut *self; let id = id.unwrap_or_else(move || { string.shrink_to_fit(); - self_.consts.strings.push(string); + self_.consts.strings.insert(string); self_.consts.strings.len() - 1 }); self.tokens.push(PatternToken::String(id, skippable)); @@ -499,7 +499,7 @@ where // no processing of `name` is required for this. let id = self.consts.strings.iter().position(|c| c == name); let id = id.unwrap_or_else(|| { - self.consts.strings.push(name.into()); + self.consts.strings.insert(name.into()); self.consts.strings.len() - 1 }); self.tokens.push(PatternToken::Identifier(id)); |