{"id":15470472,"url":"https://github.com/sile/erl_pp","last_synced_at":"2025-07-08T20:36:15.347Z","repository":{"id":57625721,"uuid":"93923308","full_name":"sile/erl_pp","owner":"sile","description":"Erlang source code preprocessor written in Rust ","archived":false,"fork":false,"pushed_at":"2021-10-17T23:46:14.000Z","size":69,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T14:51:13.587Z","etag":null,"topics":["erlang","preprocessor","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/sile.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}},"created_at":"2017-06-10T07:30:38.000Z","updated_at":"2022-09-30T17:28:00.000Z","dependencies_parsed_at":"2022-08-30T12:50:17.069Z","dependency_job_id":null,"html_url":"https://github.com/sile/erl_pp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_pp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_pp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_pp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Ferl_pp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/erl_pp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249207753,"owners_count":21230130,"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":["erlang","preprocessor","rust"],"created_at":"2024-10-02T02:04:53.049Z","updated_at":"2025-04-22T12:08:53.129Z","avatar_url":"https://github.com/sile.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"erl_pp\n======\n\n[![erl_pp](https://img.shields.io/crates/v/erl_pp.svg)](https://crates.io/crates/erl_pp)\n[![Documentation](https://docs.rs/erl_pp/badge.svg)](https://docs.rs/erl_pp)\n[![Actions Status](https://github.com/sile/erl_pp/workflows/CI/badge.svg)](https://github.com/sile/erl_pp/actions)\n[![Coverage Status](https://coveralls.io/repos/github/sile/erl_pp/badge.svg?branch=master)](https://coveralls.io/github/sile/erl_pp?branch=master)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nAn Erlang source code preprocessor written in Rust.\n\n[Documentation](https://docs.rs/erl_pp)\n\nReferences\n----------\n\n- [Erlang Reference Manual -- Preprocessor](http://erlang.org/doc/reference_manual/macros.html)\n\nExamples\n--------\n\nPreprocesses an Erlang source code snippet.\n\n```rust\nuse erl_pp::Preprocessor;\nuse erl_tokenize::Lexer;\n\nlet src = r#\"-define(FOO(A), {A, ?LINE}). io:format(\"Hello: ~p\", [?FOO(bar)]).\"#;\nlet pp = Preprocessor::new(Lexer::new(src));\nlet tokens = pp.collect::\u003cResult\u003cVec\u003c_\u003e, _\u003e\u003e().unwrap();\n\nassert_eq!(tokens.iter().map(|t| t.text()).collect::\u003cVec\u003c_\u003e\u003e(),\n           [\"io\", \":\", \"format\", \"(\", r#\"\"Hello: ~p\"\"#, \",\",\n            \"[\", \"{\", \"bar\", \",\", \"1\", \"}\", \"]\", \")\", \".\"]);\n```\n\nExecutes the example `pp` command:\n\n```bash\n$ cargo run --example pp -- /dev/stdin \u003c\u003cEOS\n-define(FOO, foo).\n-define(BAR(A), {bar, A}).\n\n-ifdef(FOO).\n\nfoo() -\u003e\n  ?FOO + ?BAR(baz).\n\n-endif.\nEOS\n\n[Position { filepath: Some(\"stdin\"), offset: 61, line: 6, column: 1 }] \"foo\"\n[Position { filepath: Some(\"stdin\"), offset: 64, line: 6, column: 4 }] \"(\"\n[Position { filepath: Some(\"stdin\"), offset: 65, line: 6, column: 5 }] \")\"\n[Position { filepath: Some(\"stdin\"), offset: 67, line: 6, column: 2 }] \"-\u003e\"\n[Position { filepath: Some(\"stdin\"), offset: 13, line: 1, column: 2 }] \"foo\"\n[Position { filepath: Some(\"stdin\"), offset: 77, line: 7, column: 2 }] \"+\"\n[Position { filepath: Some(\"stdin\"), offset: 35, line: 2, column: 2 }] \"{\"\n[Position { filepath: Some(\"stdin\"), offset: 36, line: 2, column: 3 }] \"bar\"\n[Position { filepath: Some(\"stdin\"), offset: 39, line: 2, column: 6 }] \",\"\n[Position { filepath: Some(\"stdin\"), offset: 84, line: 7, column: 7 }] \"baz\"\n[Position { filepath: Some(\"stdin\"), offset: 42, line: 2, column: 3 }] \"}\"\n[Position { filepath: Some(\"stdin\"), offset: 88, line: 7, column: 11 }] \".\"\nTOKEN COUNT: 12\nELAPSED: 0.001244 seconds\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Ferl_pp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Ferl_pp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Ferl_pp/lists"}