Subject: Re: [ast-developers] Parse error in type definition
--------
> Here is another problem:
>
> typeset -T A_t=(
> xxx
>
> function f
> {
> (( n = 0 ))
> }
> )
>
> This produces the error message
>
> t: syntax error at line 6: `((' unexpected
>
> The error occurs if xxx is a normal (non-declaration) statement, and
> also, unfortunately, in some cases where xxx is a user-defined type in a
> file xxx reachable via FPATH.
>
> If 'function f' is replaced by 'f()', the message changes to
>
> t: syntax error at line 4: `(' unexpected
>
>
> Regards,
> Bernd
>
> --
> Bernd Eggink
> [EMAIL PROTECTED]
> http://sudrala.de
The shell is processing
(...)
as a compound command and since the first token is not a typename or
a declaration command or a function definition, it assumes that
it is an array assignment. If fails when it finds the first token
that would make it an invalid array assignment.
However, since an array assignment is not valid for a type definition,
I added another state to the parser so that it produces an error if
the first token is not valid.
I now get:
syntax error at line 2: `xxx' unexpected
in both cases.
Thanks for reporting this.
David Korn
[EMAIL PROTECTED]
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers