From ee3f2919c6676f88b4ed3162274fbe016f5accde Mon Sep 17 00:00:00 2001 From: Jacob Date: Sat, 21 Dec 2024 11:10:01 -0500 Subject: [PATCH] Update README.md. Updated main.c. --- README.md | 15 ++++++++++++--- src/main.c | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 17c7016..97c5f4a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ # SCL: Simple CAS Language -## Syntax +## Current State + +The following things are possible: + 1. Floating-point numbers + 2. Negative numbers + 3. Addition + 4. Subtraction + 5. Multiplication + +## Syntax (Planned) As one would expect, you can evaluate simple infix expressions: @@ -20,9 +29,9 @@ You can also define your own functions: Symbolic algebra is done in the following manner: ```scl -> f(x) = e^x +> f(x) = x^4 > diff(f, x:sym, 2) -= e^x += 12x^2 ``` SCL will dynamically decide on types, but you can state them explicitly as diff --git a/src/main.c b/src/main.c index 8ad0a28..6133c80 100644 --- a/src/main.c +++ b/src/main.c @@ -41,11 +41,14 @@ int main(int argc, char** argv) { if (ln->ln > 0) { inp = ln->buf; - if (yyparse() == 0) printf("Parsed successfully!\n"); - else printf("Parse error.\n"); + if (yyparse() == 0) { + log_dbg("Parsed successfully!\n"); + } else printf("Parse error.\n"); exec_print(exec_expr(root)); +#ifdef DBG ast_print(root); +#endif } dstr_destroy(ln);