Unnamed repository; edit this file 'description' to name the repository.
add cross-crate inlines
Aleksey Kladov 2021-12-12
parent 1055a61 · commit 18d4737
-rw-r--r--crates/parser/src/tokens.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/parser/src/tokens.rs b/crates/parser/src/tokens.rs
index dff5e583b1..de831f0f70 100644
--- a/crates/parser/src/tokens.rs
+++ b/crates/parser/src/tokens.rs
@@ -30,6 +30,7 @@ pub struct Tokens {
}
impl Tokens {
+ #[inline]
pub fn push(&mut self, kind: SyntaxKind) {
self.push_impl(kind, SyntaxKind::EOF)
}
@@ -49,15 +50,18 @@ impl Tokens {
/// token.push(curr);
/// tokens.push(curr_joint)
/// ```
+ #[inline]
pub fn was_joint(&mut self, yes: bool) {
let idx = self.len();
if yes && idx > 0 {
self.set_joint(idx - 1);
}
}
+ #[inline]
pub fn push_ident(&mut self, contextual_kw: SyntaxKind) {
self.push_impl(SyntaxKind::IDENT, contextual_kw)
}
+ #[inline]
fn push_impl(&mut self, kind: SyntaxKind, contextual_kw: SyntaxKind) {
let idx = self.len();
if idx % (bits::BITS as usize) == 0 {
@@ -80,7 +84,7 @@ impl Tokens {
(idx, b_idx)
}
- pub fn len(&self) -> usize {
+ fn len(&self) -> usize {
self.kind.len()
}
pub(crate) fn get(&self, idx: usize) -> Token {