{"id":25044686,"url":"https://github.com/blad/lain-syntax-web","last_synced_at":"2025-03-30T23:44:44.321Z","repository":{"id":191073525,"uuid":"675393594","full_name":"blad/lain-syntax-web","owner":"blad","description":"Lain Syntax Highlighter for Browser ","archived":false,"fork":false,"pushed_at":"2023-08-28T03:16:09.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T05:19:01.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/blad.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":"2023-08-06T19:05:46.000Z","updated_at":"2023-08-28T00:29:27.000Z","dependencies_parsed_at":"2023-08-28T02:24:14.557Z","dependency_job_id":"47174915-8ed6-4352-9ba4-02ad73df0b5b","html_url":"https://github.com/blad/lain-syntax-web","commit_stats":null,"previous_names":["blad/lain-syntax-web"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blad%2Flain-syntax-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blad%2Flain-syntax-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blad%2Flain-syntax-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blad%2Flain-syntax-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blad","download_url":"https://codeload.github.com/blad/lain-syntax-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246395572,"owners_count":20770240,"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":[],"created_at":"2025-02-06T05:19:03.132Z","updated_at":"2025-03-30T23:44:44.299Z","avatar_url":"https://github.com/blad.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lain Syntax for Web\n\nThis library provides a lexer and parser that aids in generating an AST (Abstract Syntax Tree) \nrepresentation that can then be used to create a syntax highlighting or other\ncode-analysis tools.\n\n\n## Grammar\n\n```\n\u003csign\u003e               ::= + | - \n\u003cdigit\u003e              ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 \n\u003cdigits\u003e             ::= \u003cdigit\u003e \u003cdigits\u003e | \u003cdigit\u003e\n\u003cinteger\u003e            ::= [\u003csign\u003e] \u003cdigits\u003e \n\u003cfloat\u003e              ::= \u003cinteger\u003e . \u003cdigits\u003e \n\u003cnumber\u003e             ::= \u003cinteger\u003e | \u003cfloat\u003e\n\n\u003cany-char\u003e           ::= /* any-character */\n\n\u003cupper-char\u003e         ::= A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z\n\u003clower-char\u003e         ::= a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z \n\u003cspace\u003e              ::= _\n\u003cstring\u003e             ::= \u003clower-char\u003e \u003cstring\u003e | \u003cupper-char\u003e \u003cstring\u003e | \u003cspace\u003e \u003cstring\u003e | ε\n\n\u003cname-rest\u003e          ::= \u003cname\u003e | \u003cdigit\u003e \u003cname\u003e | - \u003cname-rest\u003e | _ \u003cname-rest\u003e | ε\n\u003cname\u003e               ::= \u003cupper-char\u003e \u003cname-rest\u003e | \u003clower-char\u003e \u003cname-rest\u003e\n\n# Lang Features:\n\u003cquoted-string\u003e      ::= \" \u003cany-char\u003e \"\n\n\u003cif-body\u003e            ::= if \u003cexpression\u003e \u003cexpression\u003e [\u003cexpression\u003e]\n\n\u003cbinding-expression\u003e ::= ( \u003cname\u003e \u003cexpression\u003e ) [binding-expression]\n\u003clet-name-bindings\u003e  ::= ( binding-expression )\n\u003clet-body\u003e           ::= let \u003clet-name-bindings\u003e \u003cexpression\u003e\n\n\u003cparams-list\u003e        ::= \u003cname\u003e [\u003cname\u003e]\n\u003cparams\u003e             ::= ( [\u003cparam-list\u003e] )\n\n\u003clambda-body\u003e        ::= lambda \u003cparams-list\u003e \u003cexpression\u003e \n\n\u003cdef-body\u003e           ::= def \u003cname\u003e \u003cexpression\u003e\n\n\u003cdefn-body\u003e          ::= defn \u003cname\u003e \u003cparams-list\u003e \u003cexpression\u003e\n\n\u003csingle-item\u003e        ::= \u003cname\u003e \n                       | \u003cquoted-string\u003e \n                       | \u003cnumber\u003e\n\n\u003carg-list\u003e           ::= \u003csingle-item\u003e [\u003carg-list\u003e]\n                       | \u003cname\u003e [\u003carg-list\u003e]\n                       | \u003cexpression\u003e [\u003carg-list\u003e]\n\n\u003cfunction-invoke\u003e    ::= \u003cname\u003e [\u003cargs-list\u003e]\n\n\u003clist-body\u003e          ::= \u003cif-body\u003e \n                       | \u003clet-body\u003e \n                       | \u003clambda-body\u003e \n                       | \u003cdefn-body\u003e \n                       | \u003cdef-body\u003e \n                       | \u003cfunction-invoke\u003e\n                       | \u003csingle-item\u003e \n                       | \u003csingle-item\u003e \u003clist-body\u003e\n\n\u003creference\u003e          ::= \u003cname\u003e \n                       | \u003cname\u003e : \u003cname\u003e \n                       | \u003cname\u003e : \u003cinteger\u003e\n\n\u003cexpression-body\u003e    ::= \u003clist-body\u003e \n                       | \u003cexpression\u003e\n\n\u003cexpression\u003e         ::= ( \u003cexpression-body\u003e ) [\u003cexpression\u003e] \n                       | \u003creference\u003e\n\n```\n\n\n### Example CSS for Generated HTML\n\n```\n.token-comment {\n  color: #bbb;\n}\n\n.token-parenthesis {\n  color: #999;\n}\n\n.token-name {\n  color: #0A0;\n}\n\n.token-access {\n  color: #aa0;  \n}\n\n.token-number {\n  color: #0AA;\n}\n\n.token-string {\n  color: #AA0;\n}\n\n.token-invalidtoken {\n  color: #F00;\n  display: inline-block;\n  position: relative;\n}\n\n.token-invalidtoken:before {\n  content: \"~~~~~~~~~~~~\";\n  font-size: 0.6em;\n  font-weight: 700;\n  font-family: Times New Roman, Serif;\n  color: #F00;\n  width: 100%;\n  position: absolute;\n  top: 10px;\n  left: -1px;\n  overflow: hidden;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblad%2Flain-syntax-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblad%2Flain-syntax-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblad%2Flain-syntax-web/lists"}