From: NeilBrown Date: Sun, 28 Apr 2019 00:24:38 +0000 (+1000) Subject: oceani: := is no longer a token. X-Git-Tag: JamisonCreek-3~39 X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=commitdiff_plain;h=4564083edac88eb2ed552217a09e5a409b110a12 oceani: := is no longer a token. It was always intended that a type could come between the : and = of a declaration. It makes more sense, and simplifies the grammar, if we stop treating := as ever being a token. So now : and = are separate tokens. If the parse sees ":=", it will happily treat that as two separate tokens, which is what we want. Signed-off-by: NeilBrown --- diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index 430c29f..df9a5c5 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -1589,7 +1589,7 @@ link to find the primary instance. ###### Grammar $*var - VariableDecl -> IDENTIFIER := ${ { + VariableDecl -> IDENTIFIER : = ${ { struct variable *v = var_decl(config2context(config), $1.txt); $0 = new_pos(var, $1); $0->var = v; @@ -1604,7 +1604,7 @@ link to find the primary instance. v->where_decl, Tnone, 0, Tnone); } } }$ - | IDENTIFIER ::= ${ { + | IDENTIFIER :: = ${ { struct variable *v = var_decl(config2context(config), $1.txt); $0 = new_pos(var, $1); $0->var = v;