Crates.io | powr-tokenizer |
lib.rs | powr-tokenizer |
version | 0.3.0 |
source | src |
created_at | 2022-12-01 00:01:49.932688 |
updated_at | 2022-12-01 00:01:49.932688 |
description | converts JS/TS code into tokens. part of the power project. |
homepage | |
repository | https://github.com/minsk-dev/power |
max_upload_size | |
id | 727168 |
size | 19,727 |
power-tokenizer
this is both a cli and a library.
tokenizes a string of characters. based on ECMAScript.
assumes you have cargo/rustup installed.
cargo install power-tokenizer
power-tokenizer "const one_plus_one = 1 + 1"
expected output:
Const
Identifier(
[
'o',
'n',
'e',
'_',
'p',
'l',
'u',
's',
'_',
'o',
'n',
'e',
],
)
Assign
Identifier(
[
'1',
],
)
Plus
Identifier(
[
'1',
],
)
EndOfFile