{"id":15101778,"url":"https://github.com/iambnlvn/sig-parser","last_synced_at":"2026-02-15T20:31:41.855Z","repository":{"id":215361098,"uuid":"735066713","full_name":"iambnlvn/sig-parser","owner":"iambnlvn","description":"A manual Recursive-descent parser for Sig(Programming language)","archived":false,"fork":false,"pushed_at":"2025-02-09T23:51:33.000Z","size":53,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T08:42:47.136Z","etag":null,"topics":["bunjs","parser","recursive-descent-parser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/iambnlvn.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-23T14:45:34.000Z","updated_at":"2025-02-09T23:51:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"a47ab950-0027-4a38-990f-5f7b814054ef","html_url":"https://github.com/iambnlvn/sig-parser","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"8e9d3231d3ce30dbe575b67cdc1a068609113535"},"previous_names":["iambnlvn/sig-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iambnlvn/sig-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambnlvn%2Fsig-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambnlvn%2Fsig-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambnlvn%2Fsig-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambnlvn%2Fsig-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iambnlvn","download_url":"https://codeload.github.com/iambnlvn/sig-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iambnlvn%2Fsig-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29488549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"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":["bunjs","parser","recursive-descent-parser"],"created_at":"2024-09-25T18:40:33.065Z","updated_at":"2026-02-15T20:31:41.839Z","avatar_url":"https://github.com/iambnlvn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sig Parser\n\n## Description\n\nThis is a simple parser for the Sig file format. It is used to parse the Sig files and return an AST of the file.\n\n**This uses the Bun runtime**\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Language Syntax](#language-syntax)\n\n## Installation\n\n```bash\n# Clone the repo\n$ git clone https://github.com/iambnlvn/sig-parser.git \u0026\u0026 cd sig-parser\n$ bun install\n```\n\n## Usage\n\n### Direct usage (without executable)\n\nCreate a file with a `.sigx` extension and ensure it follows the Sig Syntax.\n\nCommand format:\n\n```bash\n$ bun ./cli/main.ts [options] \u003cpath-to-file | inline-string-input\u003e\n```\n\nExample with file input:\n\n```bash\n$ bun ./cli/main.ts -f hello.sigx\n```\n\nExample with inline string input:\n\n```bash\n$ bun ./cli/main.ts -i \"class User { let name = \"Sig\"; }\"\n```\n\n**Options**\n\n- `-f, --file` : path to the file to be parsed\n- `-o, --output` : output the AST to a file\n- `-i, --inline` : inline string input to be parsed\n- `-s, --spacing` : spacing to be used for the output\n- `-h, --help` : display help for command\n- `-V, --version` : output the version number\n\n_Note that the CLI prioritizes file inputs when both inline string \u0026 file are entered._\n\n### Executable usage\n\nTo build an executable (output file = `sig`), run:\n\n```bash\n$ bun execute\n```\n\nCommand format:\n\n```bash\n$ ./sig [options] \u003cpath-to-file | inline-string-input\u003e\n```\n\nExample with file input:\n\n```bash\n$ ./sig -f hello.sigx\n```\n\nExample with inline input:\n\n```bash\n$ ./sig -i \"let a = 11;\"\n```\n\n## Language Syntax\n\nSig syntax is similar to JavaScript syntax. Refer to parser tests for more details.\n\n### Comments\n\nSig supports single-line comments and multi-line comments.\n\n```javascript\n// Single-line comment\n/**\n * Multi-line comment\n */\n```\n\n### Variables\n\nSig supports variable declaration and assignment. Only the `let` keyword is supported for variable declaration. Semicolons are required for every expression.\n\n```javascript\nlet a, b = 12;\nlet a = new Thing();\nlet a = 10;\nlet b = \"hello\";\nlet c = true;\nlet d = false;\nlet e = 10.5;\nlet k = l = 89;\nlet m = 23 \u003e a; // boolean\nlet n = 25 \u003c b; // boolean\nlet q = 77 == a; // boolean\nlet r = 234 != a; // boolean\nlet s = 2 || d;\nlet t = 2 \u0026\u0026 d;\nlet u = nill; // that's how you declare null; kinda way cooler than null\nlet v, w, x, y, z = 10; // multiple declaration\n```\n\n### Functions\n\n```rust\nfn log(name) {\n  return name;\n}\nlog(\"error\");\n\nfn sayHi() {\n  return \"Hi, mom\";\n}\nsayHi();\n\nfn add(a, b, c) {\n  return a + b + c;\n}\nadd(13, 12, 2);\n```\n\n### Classes\n\n```javascript\nclass Person {\n  // Properties are declared as variables\n  // Methods are declared as functions\n}\n\nclass User extends Person {\n  // Constructor not supported yet so the parser will treat it as a function\n  let a = 10;\n  this.saySomethingNice() {\n  }\n  fn method() {\n    return nill;\n  }\n  super();\n}\n\nlet user = new User();\nuser.method(); // non-computed values\nuser[\"method\"](); // computed values\n```\n\n### Comparisons\n\n```javascript\nx \u003e y;\nx \u003c y;\nx \u003e= y;\nx \u003c= y;\nx == y;\nx != y;\n```\n\n### Loops\n\n```javascript\nfor (let i = 0; i \u003c 10; ++i) {\n  // do something\n}\nfor (;;) {\n  // do something\n}\nwhile (x \u003e 1) {\n  print(x);\n  ++x;\n}\ndo {\n  print(x);\n  ++x;\n} while (x \u003e 1);\n```\n\n### Conditionals\n\n```javascript\nif (x \u003e 1) {\n  print(x);\n} else if (x \u003c 1) {\n  print(x * 2);\n} else {\n  print(x);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambnlvn%2Fsig-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiambnlvn%2Fsig-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiambnlvn%2Fsig-parser/lists"}