feat: P16 syntastica syntax highlighting prototype
985f3e8a78115fbb4c342fd94290a7d5d75a9f6e
HallucyGenie Agent <agent@hallucygenie.local> ·
SSH signature · not checked
Browse filesCompare with HEAD
9/9 tests pass on Android/Termux with runtime-c2rust (zero C deps):
- T1: Rust highlighting (ANSI terminal output)
- T2: Lua highlighting (agent plugin code)
- T3: JavaScript highlighting
- T4: TypeScript highlighting
- T5: File type detection via tft (.rs/.lua/.js → Lang)
- T6: Processor reuse (Rust+Lua+JS on single Processor)
- T7: Multiple themes (gruvbox dark, onedark, onelight)
- T8: Custom theme via theme! macro
- T9: HTML rendering with HtmlRenderer
Key findings:
- runtime-c2rust feature: pure Rust, no C deps, Android safe
- 29MB debug binary (tree-sitter grammars)
- syntastica-parsers (crates.io): no TOML parser
- tft file type detection: .ts/.tsx returns None (use explicit Lang)
- 53s first compile, 1.5s incremental
Changed files (3)
prototypes/p16-syntastica/Cargo.lock
Addednew file mode 100644+1399 / −0 text lines
8+source = "registry+https://github.com/rust-lang/crates.io-index" 9+checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" 15+name = "android_system_properties" 17+source = "registry+https://github.com/rust-lang/crates.io-index" 18+checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 26+source = "registry+https://github.com/rust-lang/crates.io-index" 27+checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" 35+source = "registry+https://github.com/rust-lang/crates.io-index" 36+checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" 41+source = "registry+https://github.com/rust-lang/crates.io-index" 42+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 47+source = "registry+https://github.com/rust-lang/crates.io-index" 48+checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" 56+source = "registry+https://github.com/rust-lang/crates.io-index" 57+checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" 62+source = "registry+https://github.com/rust-lang/crates.io-index" 63+checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" 66+name = "c2rust-bitfields" 68+source = "registry+https://github.com/rust-lang/crates.io-index" 69+checksum = "eb34f0c0ace43530b2df7f18bc69ee0c4082158aa451ece29602f8c841e73764" 71+ "c2rust-bitfields-derive", 75+name = "c2rust-bitfields-derive" 77+source = "registry+https://github.com/rust-lang/crates.io-index" 78+checksum = "3dd1601a7b828ab874d890e5a895563ca8ad485bdd3d2a359f148c8b72537241" 88+source = "registry+https://github.com/rust-lang/crates.io-index" 89+checksum = "8e779867f62d81627d1438e0d3fb6ed7d7c9d64293ca6d87a1e88781b94ece1c" 97+source = "registry+https://github.com/rust-lang/crates.io-index" 98+checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" 107+source = "registry+https://github.com/rust-lang/crates.io-index" 108+checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" 113+source = "registry+https://github.com/rust-lang/crates.io-index" 114+checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" 123+name = "core-foundation-sys" 125+source = "registry+https://github.com/rust-lang/crates.io-index" 126+checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 131+source = "registry+https://github.com/rust-lang/crates.io-index" 132+checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" 139+name = "darling_core" 141+source = "registry+https://github.com/rust-lang/crates.io-index" 142+checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" 152+name = "darling_macro" 154+source = "registry+https://github.com/rust-lang/crates.io-index" 155+checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" 165+source = "registry+https://github.com/rust-lang/crates.io-index" 166+checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" 175+source = "registry+https://github.com/rust-lang/crates.io-index" 176+checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" 181+source = "registry+https://github.com/rust-lang/crates.io-index" 182+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 187+source = "registry+https://github.com/rust-lang/crates.io-index" 188+checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" 193+source = "registry+https://github.com/rust-lang/crates.io-index" 194+checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" 197+name = "find-msvc-tools" 199+source = "registry+https://github.com/rust-lang/crates.io-index" 200+checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" 203+name = "futures-core" 205+source = "registry+https://github.com/rust-lang/crates.io-index" 206+checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" 209+name = "futures-task" 211+source = "registry+https://github.com/rust-lang/crates.io-index" 212+checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" 215+name = "futures-util" 217+source = "registry+https://github.com/rust-lang/crates.io-index" 218+checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" 229+source = "registry+https://github.com/rust-lang/crates.io-index" 230+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" 240+source = "registry+https://github.com/rust-lang/crates.io-index" 241+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 246+source = "registry+https://github.com/rust-lang/crates.io-index" 247+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" 252+source = "registry+https://github.com/rust-lang/crates.io-index" 253+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 258+source = "registry+https://github.com/rust-lang/crates.io-index" 259+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 264+source = "registry+https://github.com/rust-lang/crates.io-index" 265+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 268+name = "iana-time-zone" 270+source = "registry+https://github.com/rust-lang/crates.io-index" 271+checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" 273+ "android_system_properties", 274+ "core-foundation-sys", 275+ "iana-time-zone-haiku", 283+name = "iana-time-zone-haiku" 285+source = "registry+https://github.com/rust-lang/crates.io-index" 286+checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 294+source = "registry+https://github.com/rust-lang/crates.io-index" 295+checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 300+source = "registry+https://github.com/rust-lang/crates.io-index" 301+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 311+source = "registry+https://github.com/rust-lang/crates.io-index" 312+checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" 323+source = "registry+https://github.com/rust-lang/crates.io-index" 324+checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" 329+source = "registry+https://github.com/rust-lang/crates.io-index" 330+checksum = "142bc4740e452c1e57ade0cbc129f139c9093e354346f0872ef985f4f5cf5f11" 341+source = "registry+https://github.com/rust-lang/crates.io-index" 342+checksum = "6bae91019476d3ec7147de9aa291cadb6d870abf2f3015d2da73a90325ac1496" 344+ "lazy-regex-proc_macros", 350+name = "lazy-regex-proc_macros" 352+source = "registry+https://github.com/rust-lang/crates.io-index" 353+checksum = "4de9c1e1439d8b7b3061b2d209809f447ca33241733d9a3c01eabf2dc8d94358" 364+source = "registry+https://github.com/rust-lang/crates.io-index" 365+checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" 370+source = "registry+https://github.com/rust-lang/crates.io-index" 371+checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 376+source = "registry+https://github.com/rust-lang/crates.io-index" 377+checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" 382+source = "registry+https://github.com/rust-lang/crates.io-index" 383+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" 388+source = "registry+https://github.com/rust-lang/crates.io-index" 389+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 397+source = "registry+https://github.com/rust-lang/crates.io-index" 398+checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" 401+name = "p16-syntastica" 405+ "syntastica-parsers", 406+ "syntastica-themes", 413+source = "registry+https://github.com/rust-lang/crates.io-index" 414+checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6" 422+name = "palette_derive" 424+source = "registry+https://github.com/rust-lang/crates.io-index" 425+checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30" 436+source = "registry+https://github.com/rust-lang/crates.io-index" 437+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" 439+ "phf_macros 0.10.0", 440+ "phf_shared 0.10.0", 447+source = "registry+https://github.com/rust-lang/crates.io-index" 448+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" 450+ "phf_macros 0.11.3", 451+ "phf_shared 0.11.3", 457+source = "registry+https://github.com/rust-lang/crates.io-index" 458+checksum = "913273894cec178f401a31ec4b656318d95473527be05c0752cc41cdc32be8b7" 460+ "phf_macros 0.12.1", 461+ "phf_shared 0.12.1", 466+name = "phf_generator" 468+source = "registry+https://github.com/rust-lang/crates.io-index" 469+checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" 471+ "phf_shared 0.10.0", 476+name = "phf_generator" 478+source = "registry+https://github.com/rust-lang/crates.io-index" 479+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" 481+ "phf_shared 0.11.3", 486+name = "phf_generator" 488+source = "registry+https://github.com/rust-lang/crates.io-index" 489+checksum = "2cbb1126afed61dd6368748dae63b1ee7dc480191c6262a3b4ff1e29d86a6c5b" 492+ "phf_shared 0.12.1", 498+source = "registry+https://github.com/rust-lang/crates.io-index" 499+checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" 501+ "phf_generator 0.10.0", 502+ "phf_shared 0.10.0", 512+source = "registry+https://github.com/rust-lang/crates.io-index" 513+checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" 515+ "phf_generator 0.11.3", 516+ "phf_shared 0.11.3", 525+source = "registry+https://github.com/rust-lang/crates.io-index" 526+checksum = "d713258393a82f091ead52047ca779d37e5766226d009de21696c4e667044368" 528+ "phf_generator 0.12.1", 529+ "phf_shared 0.12.1", 538+source = "registry+https://github.com/rust-lang/crates.io-index" 539+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" 547+source = "registry+https://github.com/rust-lang/crates.io-index" 548+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" 556+source = "registry+https://github.com/rust-lang/crates.io-index" 557+checksum = "06005508882fb681fd97892ecff4b7fd0fee13ef1aa569f8695dae7ab9099981" 563+name = "pin-project-lite" 565+source = "registry+https://github.com/rust-lang/crates.io-index" 566+checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" 571+source = "registry+https://github.com/rust-lang/crates.io-index" 572+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 577+source = "registry+https://github.com/rust-lang/crates.io-index" 578+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" 584+name = "proc-macro-hack" 585+version = "0.5.20+deprecated" 586+source = "registry+https://github.com/rust-lang/crates.io-index" 587+checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" 590+name = "proc-macro-utils" 592+source = "registry+https://github.com/rust-lang/crates.io-index" 593+checksum = "eeaf08a13de400bc215877b5bdc088f241b12eb42f0a548d3390dc1c56bb7071" 603+source = "registry+https://github.com/rust-lang/crates.io-index" 604+checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" 612+source = "registry+https://github.com/rust-lang/crates.io-index" 613+checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" 621+source = "registry+https://github.com/rust-lang/crates.io-index" 622+checksum = "9619db1197b497a36178cfc736dc96b271fe918875fbf1344c436a7e93d0321e" 629+name = "quote-use-macros" 631+source = "registry+https://github.com/rust-lang/crates.io-index" 632+checksum = "82ebfb7faafadc06a7ab141a6f67bcfb24cb8beb158c6fe933f2f035afa99f35" 643+source = "registry+https://github.com/rust-lang/crates.io-index" 644+checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" 654+source = "registry+https://github.com/rust-lang/crates.io-index" 655+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 664+source = "registry+https://github.com/rust-lang/crates.io-index" 665+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 673+source = "registry+https://github.com/rust-lang/crates.io-index" 674+checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" 680+name = "ref-cast-impl" 682+source = "registry+https://github.com/rust-lang/crates.io-index" 683+checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" 693+source = "registry+https://github.com/rust-lang/crates.io-index" 694+checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" 703+name = "regex-automata" 705+source = "registry+https://github.com/rust-lang/crates.io-index" 706+checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" 714+name = "regex-syntax" 716+source = "registry+https://github.com/rust-lang/crates.io-index" 717+checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 722+source = "registry+https://github.com/rust-lang/crates.io-index" 723+checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" 728+source = "registry+https://github.com/rust-lang/crates.io-index" 729+checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" 740+source = "registry+https://github.com/rust-lang/crates.io-index" 741+checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" 752+source = "registry+https://github.com/rust-lang/crates.io-index" 753+checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" 762+source = "registry+https://github.com/rust-lang/crates.io-index" 763+checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" 769+name = "serde_derive" 771+source = "registry+https://github.com/rust-lang/crates.io-index" 772+checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" 782+source = "registry+https://github.com/rust-lang/crates.io-index" 783+checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" 794+name = "serde_spanned" 796+source = "registry+https://github.com/rust-lang/crates.io-index" 797+checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" 805+source = "registry+https://github.com/rust-lang/crates.io-index" 806+checksum = "e72c1c2cb7b223fafb600a619537a871c2818583d619401b785e7c0b746ccde2" 818+ "serde_with_macros", 823+name = "serde_with_macros" 825+source = "registry+https://github.com/rust-lang/crates.io-index" 826+checksum = "b90c488738ecb4fb0262f41f43bc40efc5868d9fb744319ddf5f5317f417bfac" 837+source = "registry+https://github.com/rust-lang/crates.io-index" 838+checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 843+source = "registry+https://github.com/rust-lang/crates.io-index" 844+checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 849+source = "registry+https://github.com/rust-lang/crates.io-index" 850+checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" 855+source = "registry+https://github.com/rust-lang/crates.io-index" 856+checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" 861+source = "registry+https://github.com/rust-lang/crates.io-index" 862+checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" 865+name = "streaming-iterator" 867+source = "registry+https://github.com/rust-lang/crates.io-index" 868+checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" 873+source = "registry+https://github.com/rust-lang/crates.io-index" 874+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 879+source = "registry+https://github.com/rust-lang/crates.io-index" 880+checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" 883+ "strum_macros 0.25.3", 889+source = "registry+https://github.com/rust-lang/crates.io-index" 890+checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" 893+ "strum_macros 0.27.2", 897+name = "strum_macros" 899+source = "registry+https://github.com/rust-lang/crates.io-index" 900+checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" 910+name = "strum_macros" 912+source = "registry+https://github.com/rust-lang/crates.io-index" 913+checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" 924+source = "registry+https://github.com/rust-lang/crates.io-index" 925+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 935+source = "registry+https://github.com/rust-lang/crates.io-index" 936+checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" 946+source = "registry+https://github.com/rust-lang/crates.io-index" 947+checksum = "89cfdd436fd6a3fc131ef0e88b975f27253e50632a89539a14e1eca1ddd97788" 951+ "syntastica-highlight", 956+name = "syntastica-core" 958+source = "registry+https://github.com/rust-lang/crates.io-index" 959+checksum = "18eef9c6378a47d72d7fa5bd61d4efea9353376fb02f620e40af8171f9c4e1d6" 962+ "syntastica-highlight", 966+ "tree-sitter-c2rust", 970+name = "syntastica-highlight" 972+source = "registry+https://github.com/rust-lang/crates.io-index" 973+checksum = "47d2d7e8224fd9620bf0049e58f53859ca6435822ec1705ff5bc505b106fc33f" 976+ "streaming-iterator", 979+ "tree-sitter-c2rust", 983+name = "syntastica-macros" 985+source = "registry+https://github.com/rust-lang/crates.io-index" 986+checksum = "a3f4cecd4c3f12e273ee60437eb7629738dbacda368bdcda741d130b90cfd05a" 999+name = "syntastica-parsers" 1001+source = "registry+https://github.com/rust-lang/crates.io-index" 1002+checksum = "e4e42c13d12899524acf6ef438cf3829aa4aa00f70d65c25ca044b9de81c5bee" 1007+ "syntastica-macros", 1008+ "syntastica-queries", 1009+ "tree-sitter-bash", 1010+ "tree-sitter-javascript", 1011+ "tree-sitter-json", 1013+ "tree-sitter-rust", 1014+ "tree-sitter-typescript", 1018+name = "syntastica-queries" 1020+source = "registry+https://github.com/rust-lang/crates.io-index" 1021+checksum = "a39185b86d0392cc01484934e2e6dfad5126e953aa2b9bff4dacc703d7b018fb" 1024+name = "syntastica-themes" 1026+source = "registry+https://github.com/rust-lang/crates.io-index" 1027+checksum = "e244c89b937d4482eb21ef8a3cf62e9f6323271e287131e582f66cef111da49d" 1035+source = "registry+https://github.com/rust-lang/crates.io-index" 1036+checksum = "20c332ca98090a971a2e4739239bbd6aa8012d54140902170a01ab7d543629bd" 1052+source = "registry+https://github.com/rust-lang/crates.io-index" 1053+checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" 1059+name = "thiserror-impl" 1061+source = "registry+https://github.com/rust-lang/crates.io-index" 1062+checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" 1072+source = "registry+https://github.com/rust-lang/crates.io-index" 1073+checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" 1087+source = "registry+https://github.com/rust-lang/crates.io-index" 1088+checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" 1091+name = "time-macros" 1093+source = "registry+https://github.com/rust-lang/crates.io-index" 1094+checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" 1103+source = "registry+https://github.com/rust-lang/crates.io-index" 1104+checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" 1110+name = "tinyvec_macros" 1112+source = "registry+https://github.com/rust-lang/crates.io-index" 1113+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1118+source = "registry+https://github.com/rust-lang/crates.io-index" 1119+checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" 1128+name = "toml_datetime" 1130+source = "registry+https://github.com/rust-lang/crates.io-index" 1131+checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" 1139+source = "registry+https://github.com/rust-lang/crates.io-index" 1140+checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" 1153+source = "registry+https://github.com/rust-lang/crates.io-index" 1154+checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" 1157+name = "tree-sitter" 1159+source = "registry+https://github.com/rust-lang/crates.io-index" 1160+checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" 1166+ "streaming-iterator", 1167+ "tree-sitter-language", 1171+name = "tree-sitter-bash" 1173+source = "registry+https://github.com/rust-lang/crates.io-index" 1174+checksum = "871b0606e667e98a1237ebdc1b0d7056e0aebfdc3141d12b399865d4cb6ed8a6" 1177+ "tree-sitter-language", 1181+name = "tree-sitter-c2rust" 1183+source = "registry+https://github.com/rust-lang/crates.io-index" 1184+checksum = "6e1e4909668d7a5e0eb8d66bd9fe2e789106066626056d3bead80dc6b9d5aeee" 1186+ "c2rust-bitfields", 1190+ "streaming-iterator", 1191+ "tree-sitter-language", 1195+name = "tree-sitter-javascript" 1197+source = "registry+https://github.com/rust-lang/crates.io-index" 1198+checksum = "bf40bf599e0416c16c125c3cec10ee5ddc7d1bb8b0c60fa5c4de249ad34dc1b1" 1201+ "tree-sitter-language", 1205+name = "tree-sitter-json" 1207+source = "registry+https://github.com/rust-lang/crates.io-index" 1208+checksum = "4d727acca406c0020cffc6cf35516764f36c8e3dc4408e5ebe2cb35a947ec471" 1211+ "tree-sitter-language", 1215+name = "tree-sitter-language" 1217+source = "registry+https://github.com/rust-lang/crates.io-index" 1218+checksum = "009994f150cc0cd50ff54917d5bc8bffe8cad10ca10d81c34da2ec421ae61782" 1221+name = "tree-sitter-lua" 1223+source = "registry+https://github.com/rust-lang/crates.io-index" 1224+checksum = "5cdb9adf0965fec58e7660cbb3a059dbb12ebeec9459e6dcbae3db004739641e" 1227+ "tree-sitter-language", 1231+name = "tree-sitter-rust" 1233+source = "registry+https://github.com/rust-lang/crates.io-index" 1234+checksum = "4b9b18034c684a2420722be8b2a91c9c44f2546b631c039edf575ccba8c61be1" 1237+ "tree-sitter-language", 1241+name = "tree-sitter-typescript" 1243+source = "registry+https://github.com/rust-lang/crates.io-index" 1244+checksum = "6c5f76ed8d947a75cc446d5fccd8b602ebf0cde64ccf2ffa434d873d7a575eff" 1247+ "tree-sitter-language", 1251+name = "unicode-ident" 1253+source = "registry+https://github.com/rust-lang/crates.io-index" 1254+checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" 1258+version = "0.11.1+wasi-snapshot-preview1" 1259+source = "registry+https://github.com/rust-lang/crates.io-index" 1260+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" 1263+name = "wasm-bindgen" 1265+source = "registry+https://github.com/rust-lang/crates.io-index" 1266+checksum = "3ed04576f974d2b2fba0f38c51dbc5518011e38c36bf1143164be765528fd409" 1271+ "wasm-bindgen-macro", 1272+ "wasm-bindgen-shared", 1276+name = "wasm-bindgen-macro" 1278+source = "registry+https://github.com/rust-lang/crates.io-index" 1279+checksum = "916151b09da36bd82f6615cbf3a419e2f0ba23a03c6160e8e92eb6bd4aa1dec6" 1282+ "wasm-bindgen-macro-support", 1286+name = "wasm-bindgen-macro-support" 1288+source = "registry+https://github.com/rust-lang/crates.io-index" 1289+checksum = "299047362ccbfce148b67ab7e73349f77748e00c8296f9542adfad2ad82c5c5e" 1295+ "wasm-bindgen-shared", 1299+name = "wasm-bindgen-shared" 1301+source = "registry+https://github.com/rust-lang/crates.io-index" 1302+checksum = "9a929b2c61f11ba3e9bc35b50c1f25cb38e0e892c0c231ae2b8cf78d5dad4437" 1308+name = "windows-core" 1310+source = "registry+https://github.com/rust-lang/crates.io-index" 1311+checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" 1313+ "windows-implement", 1314+ "windows-interface", 1321+name = "windows-implement" 1323+source = "registry+https://github.com/rust-lang/crates.io-index" 1324+checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" 1332+name = "windows-interface" 1334+source = "registry+https://github.com/rust-lang/crates.io-index" 1335+checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" 1343+name = "windows-link" 1345+source = "registry+https://github.com/rust-lang/crates.io-index" 1346+checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 1349+name = "windows-result" 1351+source = "registry+https://github.com/rust-lang/crates.io-index" 1352+checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" 1358+name = "windows-strings" 1360+source = "registry+https://github.com/rust-lang/crates.io-index" 1361+checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" 1369+source = "registry+https://github.com/rust-lang/crates.io-index" 1370+checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" 1378+source = "registry+https://github.com/rust-lang/crates.io-index" 1379+checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" 1385+name = "zerocopy-derive" 1387+source = "registry+https://github.com/rust-lang/crates.io-index" 1388+checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" 1398+source = "registry+https://github.com/rust-lang/crates.io-index" 1399+checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" prototypes/p16-syntastica/Cargo.toml
Addednew file mode 100644+12 / −0 text lines
2+name = "p16-syntastica" 7+syntastica = { version = "0.6", default-features = false, features = ["runtime-c2rust"] } 8+syntastica-parsers = { version = "0.6", features = [ 9+ "rust", "lua", "javascript", "typescript", "bash", "json", 11+syntastica-themes = "0.6" prototypes/p16-syntastica/src/main.rs
Addednew file mode 100644+290 / −0 text lines
3+use syntastica::renderer::TerminalRenderer; 4+use syntastica::Processor; 5+use syntastica::language_set::SupportedLanguage; 6+use syntastica_parsers::{Lang, LanguageSetImpl}; 9+ println!("=== P16: syntastica syntax highlighting prototype ===\n"); 24+ test_file_type_detection(); 27+ test_processor_reuse(); 30+ test_multiple_themes(); 38+ println!("\n=== ALL 9 TESTS PASSED ==="); 42+ let code = r#"fn main() { 43+ let agent = Agent::new("smith"); 45+ Ok(result) => println!("Result: {result}"), 46+ Err(e) => eprintln!("Error: {e}"), 50+ let output = syntastica::highlight( 53+ &LanguageSetImpl::new(), 54+ &mut TerminalRenderer::new(None), 55+ syntastica_themes::gruvbox::dark(), 56+ ).unwrap_or_else(|err| panic!("[FAIL] Rust highlighting: {err}")); 58+ println!("T1 Rust:"); 59+ println!("{output}"); 60+ assert!(!output.is_empty(), "[FAIL] Rust output empty"); 61+ println!("T1 ✅ PASS\n"); 65+ let code = r#"-- Lua plugin for smith 66+local function tool_call_transform(name, args) 67+ if name == "bash" then 68+ return string.format("exec: %s %s", name, args) 75+ tool_call = tool_call_transform, 76+ context = function(ctx) return ctx end, 80+ let output = syntastica::highlight( 83+ &LanguageSetImpl::new(), 84+ &mut TerminalRenderer::new(None), 85+ syntastica_themes::gruvbox::dark(), 86+ ).unwrap_or_else(|err| panic!("[FAIL] Lua highlighting: {err}")); 89+ println!("{output}"); 90+ assert!(!output.is_empty(), "[FAIL] Lua output empty"); 91+ println!("T2 ✅ PASS\n"); 94+fn test_javascript() { 95+ let code = r#"const express = require('express'); 96+const app = express(); 98+app.get('/api/agent', (req, res) => { 99+ const { model, provider } = req.query; 100+ res.json({ status: 'ok', model }); 105+ let output = syntastica::highlight( 108+ &LanguageSetImpl::new(), 109+ &mut TerminalRenderer::new(None), 110+ syntastica_themes::one::dark(), 111+ ).unwrap_or_else(|err| panic!("[FAIL] JS highlighting: {err}")); 113+ println!("T3 JavaScript:"); 114+ println!("{output}"); 115+ assert!(!output.is_empty(), "[FAIL] JS output empty"); 116+ println!("T3 ✅ PASS\n"); 119+fn test_typescript() { 120+ let code = r#"interface AgentConfig { 126+const createAgent = (config: AgentConfig): Agent => { 127+ return new Agent(config.model, config.provider); 130+ let output = syntastica::highlight( 133+ &LanguageSetImpl::new(), 134+ &mut TerminalRenderer::new(None), 135+ syntastica_themes::one::dark(), 136+ ).unwrap_or_else(|err| panic!("[FAIL] TS highlighting: {err}")); 138+ println!("T4 TypeScript:"); 139+ println!("{output}"); 140+ assert!(!output.is_empty(), "[FAIL] TS output empty"); 141+ println!("T4 ✅ PASS\n"); 144+fn test_file_type_detection() { 146+ let ft = tft::detect("main.rs", ""); 147+ let lang = Lang::for_file_type(ft, &()).expect("[FAIL] no lang for .rs"); 148+ assert!(matches!(lang, Lang::Rust), "[FAIL] expected Rust, got {lang:?}"); 150+ let ft_lua = tft::detect("plugin.lua", ""); 151+ let lang_lua = Lang::for_file_type(ft_lua, &()).expect("[FAIL] no lang for .lua"); 152+ assert!(matches!(lang_lua, Lang::Lua), "[FAIL] expected Lua, got {lang_lua:?}"); 155+ let ft_tsx = tft::detect("App.tsx", ""); 156+ let lang_tsx = Lang::for_file_type(ft_tsx, &()); 157+ println!(" .tsx detection: {lang_tsx:?}"); 160+ let ft_ts = tft::detect("index.ts", ""); 161+ let lang_ts = Lang::for_file_type(ft_ts, &()); 162+ println!(" .ts detection: {lang_ts:?}"); 166+ let ft_unknown = tft::detect("data.xyz", ""); 167+ let lang_unknown = Lang::for_file_type(ft_unknown, &()); 168+ assert!(lang_unknown.is_none(), "[FAIL] expected None for .xyz, got {lang_unknown:?}"); 170+ println!("T5 File type detection: ✅ PASS (.rs→Rust, .lua→Lua, .xyz→None)\n"); 173+fn test_processor_reuse() { 174+ let language_set = LanguageSetImpl::new(); 175+ let mut processor = Processor::new(&language_set); 177+ let rust_hl = processor.process( 178+ "fn hello() -> String { \"world\".to_string() }", 180+ ).unwrap_or_else(|err| panic!("[FAIL] processor Rust: {err}")); 182+ let lua_hl = processor.process( 185+ ).unwrap_or_else(|err| panic!("[FAIL] processor Lua: {err}")); 187+ let js_hl = processor.process( 190+ ).unwrap_or_else(|err| panic!("[FAIL] processor JS: {err}")); 192+ let rust_out = syntastica::render(&rust_hl, &mut TerminalRenderer::new(None), syntastica_themes::gruvbox::dark()); 193+ let lua_out = syntastica::render(&lua_hl, &mut TerminalRenderer::new(None), syntastica_themes::gruvbox::dark()); 194+ let js_out = syntastica::render(&js_hl, &mut TerminalRenderer::new(None), syntastica_themes::one::dark()); 196+ assert!(!rust_out.is_empty()); 197+ assert!(!lua_out.is_empty()); 198+ assert!(!js_out.is_empty()); 200+ println!("T6 Processor reuse (Rust+Lua+JS on one processor):"); 201+ println!(" Rust: {rust_out}"); 202+ println!(" Lua: {lua_out}"); 203+ println!(" JS: {js_out}"); 204+ println!("T6 ✅ PASS\n"); 207+fn test_multiple_themes() { 208+ let highlights = Processor::process_once( 209+ "fn main() { println!(\"Hello, smith!\"); }", 211+ &LanguageSetImpl::new(), 212+ ).unwrap_or_else(|err| panic!("[FAIL] process_once: {err}")); 214+ let gruvbox = syntastica::render(&highlights, &mut TerminalRenderer::new(None), syntastica_themes::gruvbox::dark()); 215+ let onedark = syntastica::render(&highlights, &mut TerminalRenderer::new(None), syntastica_themes::one::dark()); 216+ let onelight = syntastica::render(&highlights, &mut TerminalRenderer::new(None), syntastica_themes::one::light()); 218+ assert!(!gruvbox.is_empty()); 219+ assert!(!onedark.is_empty()); 220+ assert!(!onelight.is_empty()); 222+ assert_ne!(gruvbox, onedark, "[FAIL] dark themes should differ"); 223+ assert_ne!(gruvbox, onelight, "[FAIL] dark vs light should differ"); 225+ println!("T7 Multiple themes (same code, 3 themes):"); 226+ println!(" gruvbox dark: {gruvbox}"); 227+ println!(" onedark: {onedark}"); 228+ println!(" onelight: {onelight}"); 229+ println!("T7 ✅ PASS (all different)\n"); 232+fn test_custom_theme() { 233+ use syntastica::theme; 235+ let theme = theme! { 236+ "keyword": "#c678dd", 237+ "function": "#61afef", 238+ "string": "#98c379", 239+ "comment": "#5c6370", 241+ "punctuation": "#abb2bf", 242+ "constant": "#d19a66", 243+ "variable": "#abb2bf", 244+ "operator": "#d19a66", 247+ let output = syntastica::highlight( 248+ r#"/// A doc comment 249+fn greet(name: &str) -> String { 250+ let msg = format!("Hello, {}!", name); 254+ &LanguageSetImpl::new(), 255+ &mut TerminalRenderer::new(None), 257+ ).unwrap_or_else(|err| panic!("[FAIL] custom theme: {err}")); 259+ println!("T8 Custom theme:"); 260+ println!("{output}"); 261+ assert!(!output.is_empty(), "[FAIL] custom theme output empty"); 262+ println!("T8 ✅ PASS\n"); 265+fn test_html_render() { 266+ use syntastica::renderer::HtmlRenderer; 268+ let code = "fn add(a: i32, b: i32) -> i32 { a + b }"; 269+ let highlights = Processor::process_once( 272+ &LanguageSetImpl::new(), 273+ ).unwrap_or_else(|err| panic!("[FAIL] process for HTML: {err}")); 275+ let html = syntastica::render( 277+ &mut HtmlRenderer::new(), 278+ syntastica_themes::gruvbox::dark(), 281+ assert!(!html.is_empty(), "[FAIL] HTML output empty"); 282+ assert!(html.contains("<span"), "[FAIL] HTML should contain <span> tags"); 283+ assert!(html.contains("style"), "[FAIL] HTML should contain style attributes"); 284+ assert!(html.contains("fn"), "[FAIL] HTML should contain code text"); 286+ println!("T9 HTML render: ✅ PASS ({} bytes, contains <span>)", html.len());