{"id":25814563,"url":"https://github.com/giorgosk/simple_lexer_parser","last_synced_at":"2026-05-15T14:08:28.255Z","repository":{"id":278052875,"uuid":"151980459","full_name":"GiorgosK/simple_lexer_parser","owner":"GiorgosK","description":"Simple lexer parser as Drupal 8 service module","archived":false,"fork":false,"pushed_at":"2019-01-16T06:13:20.000Z","size":13,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T10:18:52.119Z","etag":null,"topics":["calculator","drupal","drupal-8","drupal-module","formatter","lexer","lexer-parser","parse"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/GiorgosK.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-07T20:03:47.000Z","updated_at":"2023-03-04T17:47:57.000Z","dependencies_parsed_at":"2025-02-17T19:22:56.662Z","dependency_job_id":"45b6a0dc-94b9-4dbb-94fa-3aa2a3113af0","html_url":"https://github.com/GiorgosK/simple_lexer_parser","commit_stats":null,"previous_names":["giorgosk/simple_lexer_parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GiorgosK/simple_lexer_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiorgosK%2Fsimple_lexer_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiorgosK%2Fsimple_lexer_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiorgosK%2Fsimple_lexer_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiorgosK%2Fsimple_lexer_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GiorgosK","download_url":"https://codeload.github.com/GiorgosK/simple_lexer_parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GiorgosK%2Fsimple_lexer_parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33068947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["calculator","drupal","drupal-8","drupal-module","formatter","lexer","lexer-parser","parse"],"created_at":"2025-02-28T03:30:54.113Z","updated_at":"2026-05-15T14:08:28.236Z","avatar_url":"https://github.com/GiorgosK.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Lexer Parser\n\nA simple lexer and parser that can compute simple mathematical operations using the most basic operators `+, -, *, /` and can correctly handle parentheses `()` and floating point operations (decimal numbers).  It can NOT currently handle negative numbers or unary operations.\n\nIt is implemented as a Drupal 8 service module and provides a text field formatter.\n\nThe formatter currently displays errors inline.\n\n## Requirements\n\n* Drupal 8\n\n## Installation\n\nDownload, install and enable as you normally install a Drupal 8 module hosted on github.\n\n```bash\ncd modules/contrib\ngit clone git@github.com:GiorgosK/simple_lexer_parser.git\ndrush en simple_lexer_parser\n```\n\n## Usage\n\nAfter enabling the module create a `text field` in your content type and choose `Simple lexer parser formatter` as a formatter at `admin/structure/types/manage/CONTENT_TYPE/display`\n\nThe formatter will display both the expression and the result (or error message)\n\n```\n(1 + 2) * 4  = 12\n```\n\nThe result will be revealed on hover with a delayed css animation\n\n## Unit testing\n\nRun test cases for this module using `phpunit` (tested with phpunit 6.5)\n\n```\ncd web\n../vendor/bin/phpunit -c core/phpunit.xml.dist modules/contrib/simple_lexer_parser/tests/src/Calculator/CalculatorTest.php\n```\n\nYou should get 10 tests and 10 assertions\n\nif `phpnunit` is not in the bin folder try with `../vendor/phpunit/phpunit/phpunit` instead\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiorgosk%2Fsimple_lexer_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiorgosk%2Fsimple_lexer_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiorgosk%2Fsimple_lexer_parser/lists"}