{"id":13803844,"url":"https://github.com/dlang-community/libdparse","last_synced_at":"2026-04-01T20:57:42.641Z","repository":{"id":18079388,"uuid":"21142714","full_name":"dlang-community/libdparse","owner":"dlang-community","description":"Library for lexing and parsing D source code","archived":false,"fork":false,"pushed_at":"2026-02-27T19:23:51.000Z","size":4300,"stargazers_count":121,"open_issues_count":30,"forks_count":61,"subscribers_count":15,"default_branch":"master","last_synced_at":"2026-02-27T23:48:27.438Z","etag":null,"topics":["ast","d","dlang","parser","parsing","syntax-tree"],"latest_commit_sha":null,"homepage":"https://libdparse.dlang.io","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dlang-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_1_0.txt","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":"2014-06-23T21:20:45.000Z","updated_at":"2026-02-27T19:22:29.000Z","dependencies_parsed_at":"2023-02-10T01:00:48.368Z","dependency_job_id":"71858fde-8000-49d3-a35a-da57db51ccfe","html_url":"https://github.com/dlang-community/libdparse","commit_stats":null,"previous_names":[],"tags_count":129,"template":false,"template_full_name":null,"purl":"pkg:github/dlang-community/libdparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Flibdparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Flibdparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Flibdparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Flibdparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dlang-community","download_url":"https://codeload.github.com/dlang-community/libdparse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dlang-community%2Flibdparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31013964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T02:58:54.984Z","status":"ssl_error","status_checked_at":"2026-03-27T02:58:46.993Z","response_time":164,"last_error":"SSL_read: 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":["ast","d","dlang","parser","parsing","syntax-tree"],"created_at":"2024-08-04T01:00:38.370Z","updated_at":"2026-03-27T03:15:26.232Z","avatar_url":"https://github.com/dlang-community.png","language":"D","readme":"libdparse\n=========\nLibrary for lexing and parsing D source code.\n\n# Documentation\n\nOnline documentation is available [here](http://libdparse.dlang.io).\n\nA HTML version of libdparse's grammar is also [automatically generated](http://libdparse.dlang.io/grammar.html).\n\n# Testing\n[![CI Status](https://travis-ci.org/dlang-community/libdparse.svg)](https://travis-ci.org/dlang-community/libdparse)\n\nTests are present in the test directory. To run them execute the run\\_tests.sh\nscript. Running the tests on Windows is not currently supported.\n\n# Differences with the official grammar\n* [Static array initialization syntax](http://dlang.org/arrays.html#static-init-static). Due to ambiguities they are supported when the expression that gives the elements indexes is not an array. In the opposite case they are parsed as associative array literals.\n\n# Unsupported Syntax\n* [Class allocators](http://dlang.org/class.html#allocators). These are deprecated in D2.\n* [Class deallocators](http://dlang.org/class.html#deallocators). These are deprecated in D2.\n\n# Example\n\n```d\n/+dub.sdl:\ndependency \"libdparse\" version=\"~\u003e0.7\"\n+/\nimport dparse.ast;\nimport std.stdio, std.range;\n\nclass TestVisitor : ASTVisitor\n{\n    alias visit = ASTVisitor.visit;\n    int indentLevel;\n\n    override void visit(const FunctionDeclaration decl)\n    {\n        writeln(' '.repeat(indentLevel * 4), decl.name.text);\n        indentLevel++;\n        scope (exit) indentLevel--;\n        decl.accept(this);\n    }\n}\n\nvoid main()\n{\n    import dparse.lexer;\n    import dparse.parser : parseModule;\n    import dparse.rollback_allocator : RollbackAllocator;\n\n    auto sourceCode = q{\n        void foo() @safe {\n            void bar();\n        }\n    };\n    LexerConfig config;\n    auto cache = StringCache(StringCache.defaultBucketCount);\n    auto tokens = getTokensForParser(sourceCode, config, \u0026cache);\n\n    RollbackAllocator rba;\n    auto m = parseModule(tokens, \"test.d\", \u0026rba);\n    auto visitor = new TestVisitor();\n    visitor.visit(m);\n}\n```\n[![Open on run.dlang.io](https://img.shields.io/badge/run.dlang.io-open-blue.svg)](https://run.dlang.io/is/qZsGDD)\n","funding_links":[],"categories":["Lexers, Parsers, Parser Generators","Tools and Frameworks"],"sub_categories":["Bare metal / kernel development","D"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlang-community%2Flibdparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlang-community%2Flibdparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlang-community%2Flibdparse/lists"}