nrcc_core

Crates.ionrcc_core
lib.rsnrcc_core
version0.1.1
sourcesrc
created_at2023-06-30 06:23:26.338123
updated_at2023-06-30 11:29:24.742246
descriptionA code counter.
homepage
repositoryhttps://github.com/Embers-of-the-Fire/nrcc-core
max_upload_size
id904153
size64,453
Embers-of-the-Fire (Embers-of-the-Fire)

documentation

README

NRCC-Core

Chinese 中文

NRCC is a code counting tool written in Rust language. This repository contains its core parsing library.

How to Use

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.

About Counting Rules

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.

License

MIT

Apache 2.0

Commit count: 12

cargo fmt