{"id":21965750,"url":"https://github.com/arkaeriit/preforth","last_synced_at":"2026-01-04T15:54:05.567Z","repository":{"id":119304060,"uuid":"251365188","full_name":"Arkaeriit/preforth","owner":"Arkaeriit","description":"A Forth preprocessor written in Forth","archived":false,"fork":false,"pushed_at":"2024-11-22T11:44:25.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T01:27:07.553Z","etag":null,"topics":["forth","preprocessors"],"latest_commit_sha":null,"homepage":null,"language":"Forth","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/Arkaeriit.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-30T16:34:26.000Z","updated_at":"2024-12-01T01:47:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"c59150e2-9e32-46b1-98c0-b80b7acb2c70","html_url":"https://github.com/Arkaeriit/preforth","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/Arkaeriit%2Fpreforth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkaeriit%2Fpreforth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkaeriit%2Fpreforth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Arkaeriit%2Fpreforth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Arkaeriit","download_url":"https://codeload.github.com/Arkaeriit/preforth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245023440,"owners_count":20548729,"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":["forth","preprocessors"],"created_at":"2024-11-29T12:51:33.077Z","updated_at":"2026-01-04T15:54:05.530Z","avatar_url":"https://github.com/Arkaeriit.png","language":"Forth","readme":"# Preforth\n\nA Forth preprocessor written in Forth.\n\n## User manual\n### Usage  \n```\npreforth \u003cinput file\u003e \u003coutput file\u003e\n```\nThis program parse the input file, searching for some tags. If no tags are found at the beginning of a line, the line is copied on the output file.\nList of tags:\n* `\\ #IN filename` : include non-recursively. Dump the content of `filename` in the output file.\n* `\\ #IR filename` : include recursively. Process `filename` and put the result in the output file. Similar to #include in C preprocessors.\n* `\\ #SI` : stop the inclusion. Stop the preprocessing of the file. Useful when used alongside `#IR`.\n\n### Example\nLet's imagine we have three files.\nfile1\n```\nSome text 1\n\\ #IN file2\nSome text 2\n\\ #IR file2\nSome text 3\n```\nfile2\n```\nSome text 4\n\\ #IN file3\nSome text 5\n\\ #SI\nSome text 6\n```\n\nfile3\n```\nSome text 7\n```\n\nIf you typed `./preforth file1 file4` the content of file4 would be:\n```\nSome text 1\nSome text 4\n\\ #IN file3\nSome text 5\n\\ #SI\nSome text 6\nSome text 2\nSome text 4\nSome text 7\nSome text 5\nSome text 3\n```\nWhen we included file2 with the tag #IN the tags #IN and #SI inside of file2 were ignored. But when we included it with #IR they were taken into account.\n\n## Utilisation and installation\n\nPreforth is meant to be run with [Gforth](https://gforth.org) or [SEForth](https://github.com/Arkaeriit/SEForth) but it could works with other Forth implementation. A version working with Ciforth can be found in the git branch named `ciforth`.\n\nHere is how you can install it if you want to use Gforth:\n```sh\nsudo cp preforth.frt /usr/local/bin/\nprintf '#!/bin/sh\\n/usr/bin/env gforth /usr/local/bin/preforth.frt \"$@\"\\n' | sudo tee /usr/local/bin/preforth \u003e /dev/null\nsudo chmod +x /usr/local/bin/preforth\n```\n\nHere is how you can install it if you want to use SEForth:\n```sh\nprintf '#!/usr/bin/env seforth\\n' | sudo tee /usr/local/bin/preforth \u003e /dev/null\ncat preforth.frt | sudo tee -a /usr/local/bin/preforth \u003e /dev/null\nsudo chmod +x /usr/local/bin/preforth\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkaeriit%2Fpreforth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farkaeriit%2Fpreforth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkaeriit%2Fpreforth/lists"}