Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuuki1578/calium
https://github.com/yuuki1578/calium
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yuuki1578/calium
- Owner: Yuuki1578
- License: mit
- Created: 2024-10-15T12:41:36.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-21T16:33:02.000Z (26 days ago)
- Last Synced: 2024-10-22T05:01:15.584Z (25 days ago)
- Language: Rust
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Calium: REPL Lexer
## [⚠️] Disclaimer
This project is currently unstable and may break
in the next version, so is up to you.## Core types
Here are list of types, used in this project1. `Scanner<'a>`
This type is built on top of the `Chars<'a>` type.
it also implements the trait `Deref`
and `DerefMut` as well.2. `TokenKind`
This type is an `enum` that represent a token for
a single symbols.
The token maybe a little bit messy when it comes to
scan an integer, represented by `Number(u128)`.### Variants
1. `Number(u128)`, represent decimal number
2. `Add`, represent _addition_ `(+)`
3. `Sub`, represent _substraction_ `(-)`
4. `Mul`, represent _multiplication_ `(*)`
5. `Div`, represent _division_ `(/)`
6. `Rem`, represent _remainder_ `(%)`
7. `Pow`, represent _power_ `(^)`
8. `EOL`, end of line `(;)`3. `SyntaxError`
This type act as an error reporter for the user.
This type encapsulate crucial data like where the error
occures like the line of code, or the column.
This type implement `Display`, just like the `Error` from the
standard library.