Crates.io | nrcc_core |
lib.rs | nrcc_core |
version | 0.1.1 |
source | src |
created_at | 2023-06-30 06:23:26.338123 |
updated_at | 2023-06-30 11:29:24.742246 |
description | A code counter. |
homepage | |
repository | https://github.com/Embers-of-the-Fire/nrcc-core |
max_upload_size | |
id | 904153 |
size | 64,453 |
NRCC is a code counting tool written in Rust language. This repository contains its core parsing library.
If you are a user who wants to use this tool, please go to the NRCC repository to get a tool that can be used as a CLI.
If you are a developer, you can use this repository to provide code counting functionality for your project.
If you want to contribute to this repository, please check CONTRIBUTING for more information.
Compared with other code counting tools (such as Tokei), this repository (currently only) provides code counting as blocks. Traditional counting algorithms (as optional replacements) are planned in the development.
"Code counting as blocks" means that code blocks (including comment blocks) are not counted as independent physical lines, but as "blocks". Only blank lines are plain with physical lines.
For example, the following (Rust) code:
fn main() {
call1(); /* Inline comment! */ call2();
/// Independent document comment
}
will produce the following result:
code: 4
blank: 1
all: 5
comment:
doc: 1
normal: 1
doc_quote: 0
sub_language: {}
It should also be noted that this parsing library ignores the last suffix line of the file, that is, it ignores the last '\r\n'
and other line ending symbols without producing an extra blank line.