Skip to main content

Crate sloc_languages

Crate sloc_languages 

Source

Re-exports§

pub use style::IndentStyle;
pub use style::StyleAnalysis;
pub use style::StyleGuideScore;
pub use style::StyleSignal;

Modules§

style
Multi-language style-guide analysis. Dispatch entry: analyze_style(language, text) -> Option<StyleAnalysis>.

Structs§

AnalysisOptions
IEEE 1045-1992 counting options passed from sloc-core (built from AnalysisConfig).
RawFileAnalysis
RawLineCounts

Enums§

Language
LineCategory
Coarse per-physical-line classification used by the code-ownership attribution pass in sloc-core. Deliberately three-way (blame is physical-line based, and the ownership view only needs code / comment / blank) so that per-author tallies sum exactly to a file’s physical line count. This is not the IEEE policy classifier — it does not collapse continuation lines or split the fine-grained mixed/docstring buckets.
LslocStrategy
Strategy for computing Logical SLOC (LSLOC) from a physical-line scan.
ParseMode
StyleLangScope
Which language families receive style-guide heuristic analysis.

Functions§

analyze_text
classify_physical_lines
Classify every physical line of text (for language) into exactly one LineCategory, returning one entry per physical line in source order. Reuses the same lexical scanner as analyze_text so block-comment / string state is tracked identically, but assigns a category to each physical line without continuation collapsing — keeping the result aligned one-to-one with git blame’s per-line output. Blank lines inside a block comment are reported as Comment, matching the IEEE default.
detect_language
looks_like_cpp
Best-effort test: does this source text use C++-only constructs?
supported_languages