feat(v4.0.0): reading a line and splitting it into words and numbers
The first layer of the compiler capsule, on the host node: TIB >IN SPAN SOURCE BL EXPECT QUERY WORD ENCLOSE CONVERT NUMBER and the comment words. The definitions are text, v4/capsule/core.v4 (the core words they rest on) and v4/capsule/input.v4, assembled by the text assembler, which can now read a file. EXPECT, QUERY, WORD and ENCLOSE behave as v3's. CONVERT and NUMBER are FORTH-79 (ruled 2026-10-04): any BASE, a double in the standard order, and NUMBER returns a signed double or sets NODE-ERROR. Executed at both cell widths against C and against values recorded from the v3 binary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
31fcdcd0a3
commit
443439c3d2
@@ -101,7 +101,7 @@ typedef struct {
|
||||
|
||||
unsigned line;
|
||||
int failed;
|
||||
char message[160];
|
||||
char message[224];
|
||||
} v4_text;
|
||||
|
||||
/* Start assembling at word address `origin` of node `n`. */
|
||||
@@ -115,6 +115,9 @@ void v4_text_constant(v4_text *t, const char *name, v4_cell value);
|
||||
* has been no error. */
|
||||
int v4_text_assemble(v4_text *t, const char *source);
|
||||
|
||||
/* The same for the text in the file at `path`. Its errors name the file. */
|
||||
int v4_text_assemble_file(v4_text *t, const char *path);
|
||||
|
||||
/* Finish: every branch must have found its target. Returns 1 if there has
|
||||
* been no error. Assembling may continue afterwards. */
|
||||
int v4_text_finish(v4_text *t);
|
||||
|
||||
Reference in New Issue
Block a user