sqruff-lib-core 0.20.2
“Core library that underpins the sqruff library.”
Contains an unbounded block loopRust test marker or harness
SHA-256a9ab6ae9a2afb331f5aa2cfd97f6c1367fc99cdcfaa2deb8cb7e38133e6fbd4a
MaleculeH(Db₂)Md₂(InPa)
Evidence
767:13… m = SyntaxKind;
768
769 fn next(&mut self) -> Option<Self::Item> {
770 loop {
771 let slice = self.set.0.get_mut(self.index as usize)?;
772 let bit = slice.trailing_zeros() as u16;
773
774 …
776:54… LICE_BITS + bit;
777 return Some(unsafe { std::mem::transmute::<u16, SyntaxKind>(value) });
778 }
779
⋯6 lines
1use std::iter::zip;
2use std::ops::{Deref, DerefMut};
3
4use ahash::AHashSet;
5
6use crate::dialects::syntax::{SyntaxKind, SyntaxSet};
7use crate::errors::SQLParseError;
8use crate::helpers::ToMatchable;
9use crate::parser::context::ParseContext;
10use crate::parser::match_algorithms::{
11 resolve_bracket, skip_start_index_forward_to_code, skip_stop_index_backward_to_code,
12 trim_to_terminator,
13};
14use crate::parser::match_result::{MatchResult, Matched, Span};
15use crate::parser::matchable::{
16 next_matchable_cache_key, Matchable, MatchableCacheKey, MatchableTrait,
17};
18use crate::parser::segments::base::ErasedSegment;
19use crate::parser::types::ParseMode;
20
21fn flush_metas(
22 tpre_nc_idx: u32,
23 post_nc_idx: u32,
24 meta_buffer: Vec<SyntaxKind>, …
596:22… | "block_end" | "block_start" | "block_mid"
597 )
598 }
599}
600
601#[cfg(test)]
602mod tests {
603 use super::*;
604
605 #[test]
606 fn test_indices_of_newlines() {
607 vec![
608 ("", vec![]),
609 ("foo", vec![]),
610 ("foo\nbar …
36:24…
37 .map(|x| x.as_ref().to_string())
38 .collect()
39}
40
41#[cfg(test)]
42mod tests {
43 #[test]
44 fn dialect_readout_is_alphabetically_sorted() {
45 let readout = super::dialect_readout();
⋯7 lines
Showing the top 5 files — 4 more files (49 regions) not shown.
No evidence locations were recorded for this file. Raw result