{"id":24624749,"url":"https://github.com/xfnty/calc","last_synced_at":"2025-10-06T16:32:01.417Z","repository":{"id":195400668,"uuid":"685216901","full_name":"xfnty/calc","owner":"xfnty","description":"Simple mathematical expression solver that supports operator priorities.","archived":false,"fork":false,"pushed_at":"2024-01-28T07:41:47.000Z","size":1113,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"stable","last_synced_at":"2024-01-28T08:28:32.552Z","etag":null,"topics":["ast","beginner-project","calculator","lexer","parser"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xfnty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-30T18:55:47.000Z","updated_at":"2023-09-20T03:23:10.000Z","dependencies_parsed_at":"2023-10-02T22:20:24.674Z","dependency_job_id":null,"html_url":"https://github.com/xfnty/calc","commit_stats":null,"previous_names":["xfnty/calc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfnty%2Fcalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfnty%2Fcalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfnty%2Fcalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xfnty%2Fcalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xfnty","download_url":"https://codeload.github.com/xfnty/calc/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235534362,"owners_count":19005470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","beginner-project","calculator","lexer","parser"],"created_at":"2025-01-25T04:06:21.721Z","updated_at":"2025-10-06T16:31:55.187Z","avatar_url":"https://github.com/xfnty.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Calculator in C++\n\n![preview.gif](.github/preview.gif)\n\nMuch simpler [python version](https://github.com/xfnty/calc/tree/simple_version) (140 loc)\n\n## Features\n- REPL\n- Floating-point numbers\n- Mathematical constants: `Pi`, `e`\n- Operators: `+`, `-`, `*`, `/`, `^`, `%`, `!`\n- Grouping expressions: `(...)`, `|...|`\n\n## Building and Running\n- Configure, build and run (after cloning the repo): `make`\n- Configure CMake: `make c`\n- Build the project: `make b`, `make build`\n- Build and run: `make args=\"'-2 * 2 + 1.5!'\"`\n- Run: `make r ...`\n- Run using gdb: `make d args=\"'1+5!'\"`\n\n`make configure build_type=Release` will disable debug messages.\n\n## Credits \u0026 References\n- [Crafting Interpreters](https://craftinginterpreters.com/) by Bob Nystrom\n- [Catch2](https://github.com/catchorg/Catch2/)\n- [expected](https://github.com/TartanLlama/expected)\n- [fmt](https://github.com/fmtlib/fmt)\n- [spdlog](https://github.com/gabime/spdlog)\n- [cpp-linenoise](https://github.com/yhirose/cpp-linenoise)\n\n## TODO\n- Parser error messages\n- Make macros in `Util.h` an inline functions\n- Better stack-related error handling\n- Remove `else` blocks at the end of functions in `ExpressionEvaluator`\n- Fix `^` operator and increase its precedence\n- Better `std::string` usage\n- Builtin functions: `sin()`, `ctan()`, `ln()`, `floor()`, `ceil()` ...\n- Fix Windows build\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfnty%2Fcalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxfnty%2Fcalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxfnty%2Fcalc/lists"}