[erlang-bugs] Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

Kostis Sagonas kostis@REDACTED
Sun Nov 16 19:37:19 CET 2014


On 11/16/2014 07:15 PM, PAILLEAU Eric wrote:
>
> 1>  #test{a=2}#test{a=3}.
> #test{a = 3,b = 6}
>
> but
>
> 2> {test, 2,6}{test, 3, 6}.
> * 1: syntax error before: '{'
>
> ---8<------------------------------------------------------------------
> 10.8  Internal Representation of Records
>
> Record expressions are translated to tuple expressions during
> compilation. A record defined as
>
> -record(Name, {Field1,...,FieldN}).
>
> is internally represented by the tuple
>
> {Name,Value1,...,ValueN}
>
> where each ValueI is the default value for FieldI.
> ---8<------------------------------------------------------------------
>
> I don't have any opinion on whether this syntax should be allowed or
> not, but parser should not fail on second notation in such case.

FWIW, I am of the same opinion here.  Currently, there is some 
inconsistency that should not be there.

Kostis





More information about the erlang-bugs mailing list