Commit 1a5dc6d
committed
Add Chialisp (cl-26) language support
Chialisp is the smart-contract language of the Chia blockchain — an
s-expression language compiled to CLVM. This adds it as a first-class indexed
language.
Grammar: a clean-room tree-sitter grammar (github.com/irulast/tree-sitter-chialisp,
MIT) — a generic s-expression core (list/symbol/number/hex/string/comment)
authored against the clvm_tools_rs compiler frontend; parses the full cl-26
surface (mod / defun / defmacro / defconstant / assign / lambda / include /
embed-file / namespace / ...).
Wiring mirrors the existing Scheme lisp-family path (list/symbol nodes; zero new
extractor functions):
- CBM_LANG_CHIALISP enum + lang_specs row; .clsp/.clib/.clinc extension mapping.
- CBM_LANG_CHIALISP added to the four lisp-family extractor gates
(extract_defs / extract_calls / extract_imports / extract_unified).
Chialisp-correct graph extraction:
- def heads: defun, defun-inline, defmacro, defmac, defconstant, defconst, mod,
namespace, export, embed-file, compile-file.
- mod/export named by filename (their child(1) is the arg list, not a name).
- CLVM primitive operators (the 49-entry clvm_tools_rs keyword table) filtered
from CALLS, so (sha256 ...) / (+ ...) / (c ...) don't create phantom edges;
sha256tree (a real defun) is kept.
- dialect sigils (include *standard-cl-26*) are not import edges (they select a
dialect, not a file); (include "x.clib") is.
- quoted bodies (q ...)/(quote ...)/(qq ...) are data, not descended.
- embed-file/compile-file emit a Constant node + a file-dependency edge.
Verified against a 313-file cl-26 corpus: 514 Functions, 469 Constants; CALLS to
real helpers only (zero primitive phantoms); imports to real .clib only (zero
dialect-sigil phantoms). Clean -Werror build; Scheme/Clojure/CommonLisp
regressions unchanged. MANIFEST.md updated (grammar entry + custom-handling row).1 parent f092d92 commit 1a5dc6d
14 files changed
Lines changed: 1498 additions & 22 deletions
File tree
- internal/cbm
- vendored/grammars
- chialisp
- tree_sitter
- src/discover
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
497 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
498 | 554 | | |
499 | 555 | | |
500 | 556 | | |
| |||
503 | 559 | | |
504 | 560 | | |
505 | 561 | | |
506 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
507 | 572 | | |
508 | 573 | | |
509 | 574 | | |
| |||
1061 | 1126 | | |
1062 | 1127 | | |
1063 | 1128 | | |
1064 | | - | |
1065 | | - | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1066 | 1132 | | |
1067 | 1133 | | |
1068 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6024 | 6024 | | |
6025 | 6025 | | |
6026 | 6026 | | |
| 6027 | + | |
| 6028 | + | |
| 6029 | + | |
| 6030 | + | |
| 6031 | + | |
| 6032 | + | |
| 6033 | + | |
| 6034 | + | |
| 6035 | + | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
| 6039 | + | |
| 6040 | + | |
| 6041 | + | |
| 6042 | + | |
| 6043 | + | |
| 6044 | + | |
| 6045 | + | |
| 6046 | + | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + | |
| 6050 | + | |
| 6051 | + | |
| 6052 | + | |
| 6053 | + | |
| 6054 | + | |
| 6055 | + | |
| 6056 | + | |
| 6057 | + | |
| 6058 | + | |
| 6059 | + | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
| 6069 | + | |
| 6070 | + | |
| 6071 | + | |
| 6072 | + | |
| 6073 | + | |
| 6074 | + | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
| 6081 | + | |
| 6082 | + | |
| 6083 | + | |
| 6084 | + | |
| 6085 | + | |
| 6086 | + | |
| 6087 | + | |
| 6088 | + | |
| 6089 | + | |
| 6090 | + | |
| 6091 | + | |
| 6092 | + | |
| 6093 | + | |
| 6094 | + | |
| 6095 | + | |
| 6096 | + | |
| 6097 | + | |
| 6098 | + | |
| 6099 | + | |
| 6100 | + | |
| 6101 | + | |
| 6102 | + | |
| 6103 | + | |
| 6104 | + | |
| 6105 | + | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + | |
| 6109 | + | |
| 6110 | + | |
| 6111 | + | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
6027 | 6115 | | |
6028 | 6116 | | |
| 6117 | + | |
6029 | 6118 | | |
6030 | 6119 | | |
6031 | 6120 | | |
6032 | | - | |
6033 | | - | |
| 6121 | + | |
| 6122 | + | |
6034 | 6123 | | |
6035 | 6124 | | |
6036 | | - | |
6037 | | - | |
6038 | | - | |
6039 | | - | |
6040 | | - | |
6041 | | - | |
6042 | | - | |
| 6125 | + | |
| 6126 | + | |
| 6127 | + | |
| 6128 | + | |
6043 | 6129 | | |
6044 | | - | |
| 6130 | + | |
| 6131 | + | |
| 6132 | + | |
6045 | 6133 | | |
6046 | 6134 | | |
6047 | | - | |
| 6135 | + | |
| 6136 | + | |
| 6137 | + | |
| 6138 | + | |
| 6139 | + | |
| 6140 | + | |
| 6141 | + | |
| 6142 | + | |
| 6143 | + | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
| 6154 | + | |
| 6155 | + | |
| 6156 | + | |
| 6157 | + | |
6048 | 6158 | | |
6049 | 6159 | | |
6050 | 6160 | | |
6051 | 6161 | | |
6052 | 6162 | | |
6053 | 6163 | | |
6054 | | - | |
6055 | | - | |
6056 | | - | |
| 6164 | + | |
| 6165 | + | |
| 6166 | + | |
| 6167 | + | |
| 6168 | + | |
| 6169 | + | |
| 6170 | + | |
| 6171 | + | |
| 6172 | + | |
| 6173 | + | |
| 6174 | + | |
| 6175 | + | |
| 6176 | + | |
| 6177 | + | |
6057 | 6178 | | |
6058 | 6179 | | |
6059 | 6180 | | |
| |||
6242 | 6363 | | |
6243 | 6364 | | |
6244 | 6365 | | |
6245 | | - | |
| 6366 | + | |
6246 | 6367 | | |
6247 | 6368 | | |
| 6369 | + | |
| 6370 | + | |
| 6371 | + | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
| 6376 | + | |
| 6377 | + | |
| 6378 | + | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
6248 | 6382 | | |
6249 | 6383 | | |
6250 | 6384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
1791 | 1827 | | |
1792 | 1828 | | |
1793 | 1829 | | |
| |||
2852 | 2888 | | |
2853 | 2889 | | |
2854 | 2890 | | |
| 2891 | + | |
2855 | 2892 | | |
2856 | 2893 | | |
2857 | 2894 | | |
| |||
0 commit comments