mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 00:44:27 +00:00
a standard library in Finch: path, time, proc, json
import json import path import time import proc -- found in std/ after the program's own files, so a program's own json.fch always wins. path: join, base, dir, ext, stem, parts, clean, is_abs. time: now, millis, sleep, date, local, format, days_in_month (clock_gettime, strftime through C import). proc: run, output (an error with the command's output when it fails), env, pid, cwd. json: parse (errors with line and column), stringify, pretty, new_*, get/at/set/push/has/names and str_or/int_or/float_or/bool_or; \u escapes with surrogate pairs. The C importer now leaves a plain (non-const) char * parameter a ptr[char], a buffer C writes into; only const char * is text going in. str(ptr) and str([]u8) are in the self-hosted compiler. boot.sh: 40 passed, 0 failed.
This commit is contained in:
parent
04eb0cce55
commit
ea6d2a57e5
13 changed files with 929 additions and 9 deletions
9
tests/new/std_time_proc.out
Normal file
9
tests/new/std_time_proc.out
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
1971 1 1 1 1 1 5 1
|
||||
29 28 28 29 30
|
||||
true
|
||||
true true
|
||||
hello
|
||||
world
|
||||
3
|
||||
'echo oops; exit 2' exited with code 2: oops
|
||||
fallback true true
|
||||
Loading…
Reference in a new issue