{"id":13744518,"url":"https://github.com/Xorcerer/zexpression","last_synced_at":"2025-05-09T03:32:10.165Z","repository":{"id":5555540,"uuid":"6760099","full_name":"Xorcerer/zexpression","owner":"Xorcerer","description":"A library to parse and evalate math expression with functions and variables.","archived":false,"fork":false,"pushed_at":"2014-03-04T08:18:11.000Z","size":231,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T05:04:24.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","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/Xorcerer.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}},"created_at":"2012-11-19T12:38:59.000Z","updated_at":"2020-12-12T12:20:13.000Z","dependencies_parsed_at":"2022-07-10T17:17:43.312Z","dependency_job_id":null,"html_url":"https://github.com/Xorcerer/zexpression","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xorcerer%2Fzexpression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xorcerer%2Fzexpression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xorcerer%2Fzexpression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xorcerer%2Fzexpression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xorcerer","download_url":"https://codeload.github.com/Xorcerer/zexpression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224811020,"owners_count":17373902,"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":[],"created_at":"2024-08-03T05:01:11.035Z","updated_at":"2024-11-15T16:31:03.701Z","avatar_url":"https://github.com/Xorcerer.png","language":"ActionScript","readme":"# zExpression\n\nA library to parse and evalate math expression with functions and\nvariables.\n\n### Example:\n\nActionScript 3:\n```actionscript\n\t\t\tvar c:Number = 1\n\n\t\t\tvar expSet:ExpressionSet = new ExpressionSet\n\n\t\t\t// Step 1: Parse expression strings.\n\t\t\texpSet.putExp('b', '1 + c + 100 * min(a, 100) / 2')\n\t\t\texpSet.putExp('a', 'min(1, 10)')\n\n\t\t\t// Step 2: Set variables and functions\n\t\t\texpSet.setVariable('c', c)\n\t\t\texpSet.setFunction('min', Math.min) // min() is built-in actually, example only.\n\n\t\t\t// Step 3: Get the result. Step 2, 3 could be done repeatly.\n\t\t\ttrace('b = ', expSet.getValue('b'))\n```\n\nOptional i18n variables support, by replacing the letterValidator, you\ncan make it support any language:\n\n```actionscript\n\t\t\tvar expSet:ExpressionSet = new ExpressionSet\n\n\t\t\t// Set a custom letter validator\n\t\t\texpSet.letterValidator = CnUtils.isLetterOrCnChar\n\n\t\t\texpSet.putExp('面包', '面粉 * 水')\n\t\t\texpSet.putExp('家庭', '爱情 + 面包')\n\t\t\texpSet.setVariable('爱情', 99)\n\t\t\texpSet.setVariable('面粉', 1)\n\t\t\texpSet.setVariable('水', 1)\n\n\t\t\ttrace('家庭 = ', expSet.getValue('家庭'))\n```\n\n### Supported languages:\n* ActionScript 3\n\n### TODO:\n* C# support.\n* C++ support.\n* More test cases.\n","funding_links":[],"categories":["Utilities"],"sub_categories":["Math"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXorcerer%2Fzexpression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXorcerer%2Fzexpression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXorcerer%2Fzexpression/lists"}