]> ocean-lang.org Git - ocean/commit
oceani: remove the need for 'then' in function declarations.
authorNeilBrown <neil@brown.name>
Wed, 10 Nov 2021 10:27:50 +0000 (21:27 +1100)
committerNeilBrown <neil@brown.name>
Sat, 13 Nov 2021 22:50:56 +0000 (09:50 +1100)
commit69756809ef2d0324ec94b277f9750f92db4ae416
tree7b97b4baa86318a54cdbd8718d2ecf2347db5b62
parent17b2c8c16fd6dadf052fefc20e2ee8c7f8c3da0b
oceani: remove the need for 'then' in function declarations.

Previously an IN had to follow a terminal because it would never for a
reduce.
This made is a problem for
    func FuncName
          arguments
    do
          code

as the IN follows FuncName - a non-terminal.

Fix this by allowing an IN to force a reduce if nothing at all can be
shifted.
After "func IDENTIFIER", nothing can be shifted.  The IDENTIFIER must be
reduced to FuncName.  At that point, the IN is expected, so it won't be
ignored.

This allows the 'then' to be dropped.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani-tests.mdc
csrc/oceani.mdc
csrc/parsergen.mdc