Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
vkobinski committed Aug 16, 2024
1 parent 15dba16 commit 724c69e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Binary file added Cactui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# CalcTui 🦀
# CacTui

CalcTui is a terminal-based Excel clone written in Rust. It leverages vim motions for efficient navigation and editing, providing a powerful and familiar interface for users who are comfortable with vim.
<img src="./Cactui.png" width="200"/>


CacTui is a terminal-based Excel clone written in Rust. It leverages vim motions for efficient navigation and editing, providing a powerful and familiar interface for users who are comfortable with vim.

## Features


- **Calc Language**: A domain-specific language to run Excel-like expressions.
- **Cac Language**: A domain-specific language to run Excel-like expressions.
- **Vim-like Navigation**: Navigate through cells using vim motions.
- **Multiple Modes**: Switch between Normal, Insert, Visual, Command, and Exit modes.
- **Terminal-Based**: Run entirely in the terminal, making it lightweight and fast.
Expand All @@ -14,7 +17,7 @@ CalcTui is a terminal-based Excel clone written in Rust. It leverages vim motion

## Installation

To install CalcTui, you need to have Rust and Cargo installed on your system. You can install Rust using `rustup`:
To install CacTui, you need to have Rust and Cargo installed on your system. You can install Rust using `rustup`:

```sh
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Expand All @@ -23,24 +26,24 @@ $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Once Rust is installed, clone the repository and build the project:

```sh
$ git clone https://github.com/vkobinski/CalcTui.git
$ cd CalcTui
$ git clone https://github.com/vkobinski/CacTui.git
$ cd CacTui
$ cargo build --release
```

## Usage

To run CalcTui, use the following command:
To run CacTui, use the following command:

```sh
$ cargo run --release
```

### Modes

## The Calc Language
## The Cac Language

CalcTui includes a domain-specific language called Calc Language for running Excel-like expressions. This language allows you to perform calculations directly within cells using familiar syntax.
CacTui includes a domain-specific language called Cac Language for running Excel-like expressions. This language allows you to perform calculations directly within cells using familiar syntax.

### Examples

Expand All @@ -49,7 +52,7 @@ CalcTui includes a domain-specific language called Calc Language for running Exc
- **Conditional Expressions**: `=IF(A1 > 10, "High", "Low")`
- **Range**: `=A1:A10`, get values from A1 to A10

The Calc Language supports a variety of functions and operations, making it a powerful tool for data manipulation and analysis within the terminal.
The Cac Language supports a variety of functions and operations, making it a powerful tool for data manipulation and analysis within the terminal.

- **Normal Mode**: Default mode for navigation.
- **Insert Mode**: Mode for editing cell values.
Expand Down Expand Up @@ -77,4 +80,4 @@ This project is licensed under the MIT License. See the LICENSE file for details
- Inspired by vim and its powerful navigation capabilities.
- Built with Rust for performance and safety.

Enjoy using CalcTui!
Enjoy using CacTui!
5 changes: 3 additions & 2 deletions src/calc/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ impl<'a> Interpreter<'a> {
var_value: Interpret,
) -> Result<Interpret, InterpretError> {
let closure = closure.as_closure();

if let Expr::BinOp(body) = *closure.body.clone() {
let new_bin_op = Expr::BinOp(BinOp {
left: Box::new(Expr::Literal(Literal::Number(var_value.as_number()))),
Expand Down Expand Up @@ -402,7 +403,7 @@ mod tests {

let inter = Interpreter::new(&sheet);

let expr = Parser::parse_string("(A1:A2)".to_string()).unwrap();
let expr = Parser::parse_string("A1:A2".to_string()).unwrap();
let expr = inter.interpret(&expr).unwrap().to_string();

let expected = String::from("10,20");
Expand Down Expand Up @@ -431,7 +432,7 @@ mod tests {

let inter = Interpreter::new(&sheet);

let expr = Parser::parse_string("count((A1:A2))".to_string()).unwrap();
let expr = Parser::parse_string("count(A1:A2)".to_string()).unwrap();
let expr = inter.interpret(&expr).unwrap().to_string();

let expected = String::from("30");
Expand Down

0 comments on commit 724c69e

Please sign in to comment.