Commit Graph
21 Commits
Author SHA1 Message Date
ozzy 48a9837bef feat(eval): add rounding functions
added:
- `round(num, dec)` -> rounds `num` to `dec` amount of decimal places with `RoundingStrategy::MidpointAwayFromZero`
- `floor(num)` -> floors `num` to the nearest integer
- `ceil(num)` -> ceils `num` to the nearest integer
fixed:
- use proper function types instead of function pointers for the util functions in the builtin function registry
2026-09-28 19:51:56 -05:00
ozzy 143a1ee22f refactor(eval): move to context system
started the move to a context based system
this is so that user defined variables and functions can be added in the future, as well as scripting
2026-09-28 19:32:31 -05:00
ozzy 1b3ae22707 test(lexer): add decimal tests
add tests for implicit 0 decimals and normal decimals
2026-09-28 08:32:34 -05:00
ozzy 0ce0d65e51 test(parser): add implicit multiplication tests
added tests:
- implicit multiplication between a number + variable
- implicit multiplication between two paren groups
2026-09-28 08:20:32 -05:00
ozzy ddbddb4036 docs(readme): update readme
another readme change
fixed a formatting issue
added another item to the list of features
2026-09-27 15:34:37 -05:00
ozzy 41d3462f09 docs(readme): update readme
added installation, building, and contribution details to the readme
2026-09-27 15:29:01 -05:00
ozzy 9b1217cf2e docs(readme): add readme 2026-09-27 15:24:48 -05:00
ozzy dbc14d0403 feat(cli): create proper cli
made a proper cli using clap
2026-09-27 15:09:57 -05:00
ozzy fdf4464edb refactor(eval): rename math_constants to constants 2026-09-27 14:26:55 -05:00
ozzy 62070919eb feat(tests): add tests
added tests for the struct displays, eval function, lexer, and parser
2026-09-27 14:23:23 -05:00
ozzy d5397d1591 fix(parser): allow negative numbers
made adding a minus sign before a group/primary expression implicitly multiply by -1
2026-09-27 13:26:47 -05:00
ozzy bbc0ef6045 feat(eval): add functions and constants
added constants pi, e
added functions sin, cos, tan, asin, acos, atan, abs, and sqrt
fixed displaying decimals without normalizing them
todo: add imaginary number support
2026-09-26 15:31:33 -05:00
ozzy 234b2ef2dc feat(eval): add extremely basic evaluation
added a basic `eval_expr` function that evaluates an expression.
it still does not reduce/simplify anything, and it cannot evaluate to fractions yet
2026-09-26 14:51:33 -05:00
ozzy b68b1db2f6 fix(parser): fix for implicit multiplication
fixed implicit multiplication parsing going to `parse_primary` instead of `parse_additive`
2026-09-26 14:23:02 -05:00
ozzy 7eaf7c4097 feat(types): remove some redundant parenthesis 2026-09-26 14:19:01 -05:00
ozzy 3a6f556935 fix(repo): remove random file 2026-09-25 21:21:56 -05:00
ozzy 1488a51081 fix(parser): fix many bugs in parser
fixed bugs relating to parsing order and unreliable token advancement for parenthesis
2026-09-25 21:20:08 -05:00
ozzy 64d6f8f095 feat(types): implement display
implement display on expression and operator so that math expressions can be turned back into strings that could theoretically be parsed again
2026-09-25 20:46:43 -05:00
ozzy 66da876e2a feat(parser): add parser
added a basic ast parser that is likely riddled with bugs
2026-09-25 20:29:43 -05:00
ozzy 26e85652af feat(lexer): add lexer
added basic lexer
2026-09-25 19:16:52 -05:00
ozzy acd053dfb5 initial commit
initialize cargo + just
2026-09-23 15:46:11 -05:00