{"id":15144213,"url":"https://github.com/smoeding/tree-sitter-pic","last_synced_at":"2026-02-25T19:11:32.180Z","repository":{"id":248988108,"uuid":"829919023","full_name":"smoeding/tree-sitter-pic","owner":"smoeding","description":"Tree-sitter grammar for the PIC language","archived":false,"fork":false,"pushed_at":"2025-01-02T11:29:54.000Z","size":3453,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T22:47:45.887Z","etag":null,"topics":["pic","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smoeding.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":"2024-07-17T08:51:42.000Z","updated_at":"2025-01-09T18:44:43.000Z","dependencies_parsed_at":"2025-01-02T12:26:01.534Z","dependency_job_id":"d539789d-1ea6-4387-a83c-f0dcb4a8b3c2","html_url":"https://github.com/smoeding/tree-sitter-pic","commit_stats":{"total_commits":77,"total_committers":1,"mean_commits":77.0,"dds":0.0,"last_synced_commit":"b866e4f310a40a279bd1b5803c7eba9d457dbea5"},"previous_names":["smoeding/tree-sitter-pic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Ftree-sitter-pic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Ftree-sitter-pic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Ftree-sitter-pic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smoeding%2Ftree-sitter-pic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smoeding","download_url":"https://codeload.github.com/smoeding/tree-sitter-pic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517922,"owners_count":20951716,"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":["pic","tree-sitter"],"created_at":"2024-09-26T10:22:46.780Z","updated_at":"2025-10-26T16:11:42.809Z","avatar_url":"https://github.com/smoeding.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree-sitter grammar for the PIC language\n\n[![License](https://img.shields.io/github/license/smoeding/tree-sitter-pic.svg)](https://raw.githubusercontent.com/smoeding/tree-sitter-pic/master/LICENSE)\n[![Build Status](https://github.com/smoeding/tree-sitter-pic/actions/workflows/ci.yaml/badge.svg)](https://github.com/smoeding/tree-sitter-pic/actions/workflows/ci.yaml)\n\nPic is a domain-specific language by Brian W. Kernighan for specifying diagrams. It is mostly used in combination with the [groff](https://www.gnu.org/software/groff/) typesetting system but is also a valid input format for some programs found in the [plotutils](https://www.gnu.org/software/plotutils/) package.\n\nA typical document preparation workflow using the PIC preprocessor could look like this:\n\n![PIC demo](https://github.com/smoeding/tree-sitter-pic/blob/main/doc/demo.png?raw=true)\n\nThe following input was used to create this picture:\n\n``` pic\n.PS\nellipse \"document\"\narrow\nbox \"PIC\"\narrow\nbox \"TBL/EQN\" \"(optional)\" dashed\narrow\nbox \"TROFF\"\narrow\nellipse \"typesetter\"\n.PE\n```\n\n## Limitations\n\nThe following limitations are known.\n\n#### Macros definitions and macro parameters may be parsed incorrectly\n\nMacros are not part of the Pic language. When the scanner finds a macro call, it does a simple text replacement using the macro parameters. Neither the macro definition nor the macro call needs to be a correct Pic statement or expression. This makes is impossible to parse all macros correctly.\n\nSee the following example which is perfectly legal code for `pic`:\n\n``` pic\ndefine foo { circle at $1 $2 }\nfoo((2,2), diam 1)\nfoo((3,5), rad 1)\n```\n\n#### The copy thru statement may be parsed incorrectly\n\nConsider the following piece of code:\n\n``` pic\ncopy thru X\n  box \"$1\"\nX\n10\n```\n\nWhen GNU pic parses this code, it checks if `X` has been defined as a macro. If it is a macro, then it is called using the following three lines as data. If `X` is not defined as a macro, then it is parsed as a character delimiter and the block between the two `X` characters is used as an inline macro.\n\nThe tree-sitter implementation doesn't record the defined macros and may therefore parse this specific piece of code differently. You can use longer macro names and non-alphabetic letters as inline macro delimiters to avoid this ambiguity.\n\n## References\n\n1. Brian W. Kernighan, [PIC - A Graphics Language for Typesetting - User Manual](https://raw.githubusercontent.com/smoeding/tree-sitter-pic/main/doc/PIC_-_A_Graphics_Language_for_Typesetting_-_User_Manual.pdf)\n1. Eric S. Raymond, [Making Pictures with GNU PIC](https://raw.githubusercontent.com/smoeding/tree-sitter-pic/main/doc/Making_Pictures_with_GNU_PIC.pdf)\n1. W. Richard Stevens, [Examples of pic Macros](https://raw.githubusercontent.com/smoeding/tree-sitter-pic/main/doc/Examples_of_pic_Macros.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmoeding%2Ftree-sitter-pic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmoeding%2Ftree-sitter-pic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmoeding%2Ftree-sitter-pic/lists"}