Oceani - Cataract Creek version Clean up text, rearrange code a little and provide new name. Change for this version include: - functions - references - better test coverage - .name for labels - "and then" and "if else" gone - "?" and "??" - better handling of indents in parser - "program" no longer exists Signed-off-by: NeilBrown <neil@brown.name>
oceani: don't let error in one statement hides errors in next. The error state from one statement is still visible in the next, which can upset the reporting of errors. So provide a clean error state for each new statement. Signed-off-by: NeilBrown <neil@brown.name>
oceani: remove "and then" and "or else" I can't think of any reason that "and" and "or" shouldn't be short-circuit operators, so change them to do what "and then" and "or else" currently do, and discard the latter. Signed-off-by: NeilBrown <neil@brown.name>
oceani-tests: Add testing for --bracket printing. Make sure that printing with --bracket is still parseable, and double-printing doesn't change from single. Signed-off-by: NeilBrown <neil@brown.name>
oceani: last fixes for UNTESTED for now. I still don't get 100% due to some case labels which gcov think are not tested, but I don't understand why. Signed-off-by: NeilBrown <neil@brown.name>
oceani: exercise more parsing options for blocks. This tests some untested code. Signed-off-by: NeilBrown <neil@brown.name>
oceani: test UNTESTED parsing of structures Signed-off-by: NeilBrown <neil@brown.name>
oceani: remove all UNTESTED again. Maybe there are still more to find - we don't have 100% yet.. Signed-off-by: NeilBrown <neil@brown.name>
oceani: handle some more untested code. The mark-untested filter was removing some annotations that are valid... I'm not sure of this 'switch' syntax ... need to think about that one day. Signed-off-by: NeilBrown <neil@brown.name>
oceani: remove the last of the UNTESTED - for now. I think there are more lines that aren't being tested though... Signed-off-by: NeilBrown <neil@brown.name>
oceani: fix parsing of error in struct field. If there is an error - we violated our segments. Signed-off-by: NeilBrown <neil@brown.name>
oceani: more test coverage Signed-off-by: NeilBrown <neil@brown.name>
oceani: more test coverage. Signed-off-by: NeilBrown <neil@brown.name>
oceani: improve test coverage Various little changes to reduce number of lines that aren't tested. Signed-off-by: NeilBrown <neil@brown.name>
oceani: use new slice syntax for argv argument. Rather than "argv:[argc::]string", the argv parameter is now "argv:[]string" This will be the syntax for general array references. Signed-off-by: NeilBrown <neil@brown.name>
oceani: add a 'length' operator array[] will now return the length of the array. Signed-off-by: NeilBrown <neil@brown.name>
oceani: add transparent AddressOf operator for function parameters. If a function parameters is a declared as an reference, and the passed argument is not, then we insert the new AddressOf operator so that the correct value is passed. This allow "var" parameters much like Pascal - though with completely different syntax. Signed-off-by: NeilBrown <neil@brown.name>
oceani: assignment to a pointer can take an address. If the non-pointer is assigned to a pointer, and the non-pointer is provided as an lval, the address is now assigned - rather than causing an error. Signed-off-by: NeilBrown <neil@brown.name>
oceani: add type entry for new structs early. When a 'struct foo' declaration is found, add the type when 'foo' is seen rather than when the whole declaration is seen. This keeps the order of types stable Signed-off-by: NeilBrown <neil@brown.name>
oceani: move the 'info:' report for assignments. When we provide info about where the type of the assigned variable was set, make sure that happens *after* any error was reported. Signed-off-by: NeilBrown <neil@brown.name>