feat(stdlib): Mid M4 csv and thickened text helpers

Add lib/csv parse/stringify and expand lib/text with contains,
replace, case, pad, and related golds plus public demos.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-07 20:27:19 +08:00
1 parent 08384c7540
commit 506de65dae
22 files changed
+766 -15

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
---
title: Mid stdlib — csv and text
description: lib/csv + thickened lib/text (Mid M4)
import csv:lib/csv.mq.md
import text:lib/text.mq.md
---
# CSV cleaning with text helpers
Parse a tiny CSV, normalize a field, print — no plugins.
# main
*raw = "name,city\nAda,london\nBob,PARIS\n"*
*rows = > csv.parse text=`raw`*
*r0 = > at value=`rows` index=0*
*city = > text.to_upper text=`r0`[^city]*
> print text=`r0`[^name]
> print text=`city`
*n = > len `rows`*
1. `n` == 2
> print text=mid-m4-ok
2. *
> print text=mid-m4-fail
+24
View File
@@ -0,0 +1,24 @@
---
title: 中层标准库 — 逗号表与文本
description: lib/逗号表 + 加厚 lib/文本(中层 M4)
导入 逗号表:lib/逗号表.mq.md
导入 文本:lib/文本.mq.md
---
# 用文本助手清洗 CSV
解析小表、规范化字段、打印 — 无需插件。
# main
*raw = "name,city\nAda,london\nBob,PARIS\n"*
*rows = > 逗号表.解析 内容=`raw`*
*r0 = > at value=`rows` index=0*
*city = > 文本.大写 内容=`r0`[^city]*
> 打印 内容=`r0`[^name]
> 打印 内容=`city`
*n = > 长度 `rows`*
1. `n` == 2
> 打印 内容=mid-m4-ok
2. *
> 打印 内容=mid-m4-fail