From 4cdd68c1e0a2b774c04bb251ad788ccfd958660e Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 19 May 2019 07:18:06 +1000 Subject: [PATCH] updates --- 00-TODO | 22 +++++++++++++++++----- 01-TOFIX | 8 ++++++++ Ocean-operators | 14 ++++++++++++++ Ocean-types | 6 ++++++ 4 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 01-TOFIX diff --git a/00-TODO b/00-TODO index 58dae9c..b89cc9f 100644 --- a/00-TODO +++ b/00-TODO @@ -1,16 +1,26 @@ This is a living document - delete things when done. Avoid discussion. +NOW: + - handle free_type more cleanly?? + - rethink line-like parsing. Should element also start a line? + - review simple/complex parsing options in various situations + Current version (Jamison Creek) -- global consts + - clean up + +Next version ?? +- spaces in numbers +- # not comment?? - automatic if used as a mark. +- can I move 'ok' into the parse context? Then error functions can set it. +- allow something so I don't need to call config2context so often + Some code stanza to be added to do_reduce() - structs - - const or variable fields - - initial value + - const fields - anonymous field - array or struct (or pointer to these) + multiple anon struct ar allowed if they don't conflict - [] can apply to anon array field - anon struct field gets fields interpolated -Next version ?? - - change 'labels' to only be created for 'use' - handle syntax errors better - recover quickly. - manifest values for arrays and structs [a,b,c] @@ -27,6 +37,8 @@ Next version ?? - array buffer - can be added to and grows. - char, string search, regexp search +- allow "do stuff" as a stand-allow statement (scope) + Much later - functions and procedures diff --git a/01-TOFIX b/01-TOFIX new file mode 100644 index 0000000..361c4f9 --- /dev/null +++ b/01-TOFIX @@ -0,0 +1,8 @@ +------------ +This: + const pie ::= "I like Pie"; + cake ::= "The cake is" + ++ " a lie" + +gives a parse error. It thinks the NEWLINE after "The cake is" +terminates something, but I'm not sure it should at that point. diff --git a/Ocean-operators b/Ocean-operators index 12b60e2..7c75e61 100644 --- a/Ocean-operators +++ b/Ocean-operators @@ -77,3 +77,17 @@ What types do operators act one? convert error to type !error test if value is error ?value extract error code value! + + +PROBLEM?? + + a if c else b +could have a natural precedence: + + A if C else B if q else a if c else b +would be + A if C else (B if q else (a if c else b)) +Hmm.. not what I imagined. But what I imaging suggested that left-association what + a op b op c -> (a op b) op c +requires that we reduce even when we could shift, ... maybe .... I should leave this +until I do precedence. diff --git a/Ocean-types b/Ocean-types index 4aa4e89..1671480 100644 --- a/Ocean-types +++ b/Ocean-types @@ -298,3 +298,9 @@ So I guess: or const { name ::= value ; name ::= value } + +-------------- +I'm in the middle of stage-1 on structures. + +I need a type to parse the declaration into. It needs to be a linked list +of fields, each of which is a type, a name, and an initial value. i.e. a 'struct field'. -- 2.43.0