]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: allow spaces in numbers.
[ocean] / csrc / oceani.mdc
index a3eba942acbd3cd92e407ee61b83446e1893bbf0..86b3e3cb844ddd5fde3ffe8c9243bb21e962a735 100644 (file)
@@ -169,8 +169,9 @@ structures can be used.
                struct parse_context context = {
                        .config = {
                                .ignored = (1 << TK_line_comment)
-                                        | (1 << TK_block_comment),
-                               .number_chars = ".,_+-",
+                                        | (1 << TK_block_comment)
+                                        | (1 << TK_mark),
+                               .number_chars = ".,_+- ",
                                .word_start = "_",
                                .word_cont = "_",
                        },
@@ -1034,7 +1035,6 @@ Each variable records a scope depth and is in one of four states:
   in scope.  It is permanently out of scope now and can be removed from
   the "in scope" stack.
 
-
 ###### variable fields
        int depth, min_depth;
        enum { OutScope, PendingScope, CondScope, InScope } scope;
@@ -1491,7 +1491,6 @@ in `val` or the pointer to a value in `lval`.  If `lval` is set, but a
 simple value is required, `inter_exec()` will dereference `lval` to
 get the value.
 
-
 ###### core functions
 
        struct lrval {
@@ -2948,7 +2947,6 @@ precedence is handled better I might be able to discard this.
                rv.str = text_join(left.str, right.str);
                break;
 
-
 ###### value functions
 
        static struct text text_join(struct text a, struct text b)
@@ -3605,7 +3603,6 @@ defined.
                        var_block_close(config2context(config), CloseElse);
                }$
 
-
        $*exec
        // These scopes are closed in CondSuffix
        ForPart -> for OpenScope SimpleStatements ${
@@ -4056,7 +4053,6 @@ analysis is a bit more interesting at this level.
                        c->prog = $<1;
        } }$
 
-
        $*binode
        Program -> program OpenScope Varlist Block OptNL ${
                $0 = new(binode);
@@ -4191,7 +4187,7 @@ things which will likely grow as the languages grows.
 ###### demo: hello
 
        const:
-               pi ::= 3.1415926
+               pi ::= 3.141_592_6
                four ::= 2 + 2 ; five ::= 10/2
        const pie ::= "I like Pie";
                cake ::= "The cake is"
@@ -4280,7 +4276,7 @@ things which will likely grow as the languages grows.
                // Dad taught me - the first one I ever heard of.
                for i:=1; then i = i + 1; while i < size:
                        n := list[i-1] * list[i-1]
-                       list[i] = (n / 100) % 10000
+                       list[i] = (n / 100) % 10 000
 
                print "Before sort:",
                for i:=0; then i = i + 1; while i < size: