{"id":18453237,"url":"https://github.com/wesleyac/lemonscript-transpiler","last_synced_at":"2025-07-13T10:33:08.618Z","repository":{"id":89702754,"uuid":"59229592","full_name":"WesleyAC/lemonscript-transpiler","owner":"WesleyAC","description":"Generates C++ files from a very simple DSL","archived":false,"fork":false,"pushed_at":"2017-07-27T14:20:58.000Z","size":72,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T11:59:22.752Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WesleyAC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2016-05-19T17:55:46.000Z","updated_at":"2023-10-02T12:25:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"357de34a-e2a6-49b5-8b95-a845ed52e0e0","html_url":"https://github.com/WesleyAC/lemonscript-transpiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WesleyAC/lemonscript-transpiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WesleyAC%2Flemonscript-transpiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WesleyAC%2Flemonscript-transpiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WesleyAC%2Flemonscript-transpiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WesleyAC%2Flemonscript-transpiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WesleyAC","download_url":"https://codeload.github.com/WesleyAC/lemonscript-transpiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WesleyAC%2Flemonscript-transpiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265128211,"owners_count":23715621,"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-11-06T07:35:36.640Z","updated_at":"2025-07-13T10:33:08.347Z","avatar_url":"https://github.com/WesleyAC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lemonscript-transpiler [![Build Status](https://travis-ci.org/WesleyAC/lemonscript-transpiler.svg)](https://travis-ci.org/WesleyAC/lemonscript-transpiler) [![Coverage Status](https://coveralls.io/repos/github/WesleyAC/lemonscript-transpiler/badge.svg?branch=master)](https://coveralls.io/github/WesleyAC/lemonscript-transpiler?branch=master) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)\n\nThis is a script that converts .func files into a .h and .cpp file to be used with lemonscript.\n\n## `.func` file format\n\n`transpile.py` takes in a directory containing all the `.func` files that you want to compile, and outputs a `auto_functions.cpp` and `auto_functions.h` file to be used in the robot code. Here's an example of a valid `.func` file:\n\n```\nWait(float time)\n\ninclude {\n  \"muan/utils/timing_utils.h\"\n}\n\nglobal {\n  float start_time\n}\n\ninit {\n  start_time = muan::now();\n  return false;\n}\n\nperiodic {\n  return (muan::now() - start_time \u003e time);\n}\n```\n\nA few things to keep in mind:\n\n* The first line of the file must have the name of the auto function, and all of it's arguments on it.\n* You cannot have indentation before `include`, `global`, `init`, or `periodic`.\n* All files to include must be on a different line in the `include` block.\n* If you try to break the transpiler, you will be able to. It should handle any reasonable file, but don't try to break it.\n\n## Supported units\n\nLemonscript treats all arguments as void pointers, and internally converts them to the correct units. Because of this, only the following types are supported as arguments to auto functions:\n\n* `int`\n* `bool`\n* `float`\n* `std::string`\n\n## Arguments\n\n`transpile.py` has the following flags:\n\n| flag              | function |\n| ----------------- | -------- |\n| `--input-files`   | A list of `.func` files to compile. |\n| `--output-header` | A name of a file to put the transpiled .cpp code in. |\n| `--output-cpp`    | A name of a file to put the transpiled .h code in. |\n| `--format`        | Use `clang-format` to make the generated code pretty. |\n| `-v`              | Sets log level to be more verbose. You may use more than one, but the default is everything but debug, so that's pretty useless. |\n| `-q`              | Sets log level to be less verbose. You may use more than one. For example `-qq` will hide everything except errors. `-qqq` **should** result in no output to stdout. |\n\n## Testing\n\nTo simply run the tests:\n\n```\npy.test ./tests\n```\n\nIf you want coverage information as well:\n\n```\ncoverage run -m py.test ./tests/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleyac%2Flemonscript-transpiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesleyac%2Flemonscript-transpiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesleyac%2Flemonscript-transpiler/lists"}