KarolS/millfork

compiler accepts 'array(type)' but not 'array (type)'

retrac0 opened this issue · 0 comments

Small edge case. Compiler does not accept a space between 'array' and '('. This seems inconsistent with parentheses syntax elsewhere. All but last line are accepted:

segment(foo) some_func (arg) // ok
segment (foo) some_func(arg) // ok
segment array(byte) foo[10]    // ok
segment (baz) array(word) foo[10]  // ok 
const array(int24) foo[10] // ok
array (byte) foo[10] // error - Syntax error: array definition expected

I think it's line 407 in MfParser.scala:

elementType <- ("(" ~/ AWS ~/ identifier ~ AWS ~ ")").? ~/ HWS