{"id":47730534,"url":"https://github.com/shakna-israel/mex","last_synced_at":"2026-04-02T21:26:21.998Z","repository":{"id":148494453,"uuid":"143798444","full_name":"shakna-israel/mex","owner":"shakna-israel","description":"A simple macro system for Fortran 77","archived":false,"fork":false,"pushed_at":"2018-08-07T06:09:00.000Z","size":21,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T00:08:09.462Z","etag":null,"topics":["expander","f77","fortran","macro"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shakna-israel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-08-07T00:37:36.000Z","updated_at":"2018-08-07T04:48:25.000Z","dependencies_parsed_at":"2023-05-28T03:00:42.863Z","dependency_job_id":null,"html_url":"https://github.com/shakna-israel/mex","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"0b74766a6601063282e73ae9df9cd7b4bc759f84"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/shakna-israel/mex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakna-israel%2Fmex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakna-israel%2Fmex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakna-israel%2Fmex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakna-israel%2Fmex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shakna-israel","download_url":"https://codeload.github.com/shakna-israel/mex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shakna-israel%2Fmex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31316730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"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":["expander","f77","fortran","macro"],"created_at":"2026-04-02T21:26:21.184Z","updated_at":"2026-04-02T21:26:21.982Z","avatar_url":"https://github.com/shakna-israel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# James Milne's mex\n\n## A simple macro-expander for Fortran 77\n\n---\n\n## Usage:\n\nThe command:\n\n```\nmex file.mf\n```\n\nWill produce the file: ```file.f```.\n\n---\n\n## Install:\n\nYou can use the provided Makefile:\n\n```\nmake install\n```\n\nYou can also tweak the install location by setting PREFIX, and BIN.\n\nUninstall is similar:\n\n```\nmake uninstall\n```\n\nIf you changed any value on install, make sure you also change it on uninstall.\n\n*(mex is also self-contained. Copy it to anywhere in PATH if you would rather.)*\n\n---\n\n## Macro Language\n\nThe language is exceptionally simple, and without syntax checking.\n\nIf a line begins with '#', then it is converted to a comment.\n\ne.g.\n\n```\n\u003e # Hello, World!\nc Hello, World!\n```\n\nIf a line begins with a number, it is treated as a line number.\n\ne.g.\n\n```\n\u003e 100 print *, \"This has a line number\"\n 100  print *,\"This has a line number\"\n```\n\nOtherwise, mex assumes we have a valid expression.\n\ne.g.\n\n```\n\u003e print *, \"Hello, World!\"\n      print *, \"Hello, World!\"\n```\n\nSee also, [comparators](#comparators)\n\n### Macros\n\nmex also supports user-defined macros, but only simple ones. Find and replace.\n\nIf a ```.mex``` file exists, then each line is treated as a space-seperated key-value pair.\n\nThe given source file is checked for each key, pre- and appended with an underscore, and then if found, the value is replaced.\n\ne.g.\n\n.mex:\n\n```\nx 27\n```\n\nsomefile.mf:\n\n```\nreal x\nx=_x_\n```\n\nTurns into:\n\nsomefile.f:\n\n```\nreal x\nx=27\n```\n\n### Comparators\n\nmex also supports symbols as comparators, replacing them rather naively. But basically:\n\n| Symbol | Fortran Equivalent | Plain English         |\n| ------ | ------------------ | --------------------- |\n| \u003e      | .gt.               | Greater Than          |\n| \u003c      | .lt.               | Less Than             |\n| \u003c=     | .le.               | Less Than or Equal    |\n| \u003e=     | .ge.               | Greater Than or Equal |\n| ==     | .eq.               | Equal                 |\n| !=     | .ne.               | Not Equal             |\n| \u0026\u0026     | .and.              | And                   |\n| \\|\\|     | .or.               | Or                    |\n| !      | .not.              | Not                   |\n| \\|^     | .xor.              | Exclusive Or          |\n| ~=     | .eqv.              | Equivalent            |\n| ~!     | .neqv.             | Not Equivalent        |\n\n\n---\n\n## License\n\nmex is released under Creative Commons 0 license, as close to Public Domain as I can.\n\nThe exact legal code can be found in the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakna-israel%2Fmex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshakna-israel%2Fmex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshakna-israel%2Fmex/lists"}