Frozenset literals and comprehensions

Thanks for catching my error above. I think, its is really necessary to provide a rule that there must not be a whitespace between the two {{ and the two }}. Unfortunately, the PEG parser generator does not provide such a command. I changed Parser/parser.c by hand to accept '{' '{' star_named_expressions '}' '}' only if there is no whitespace between the two opening and the two closing braces. In this case:

  • {{ {a,b,c} }} is a frozen set of a set (thus invalid)
  • { {{a,b,c}} } is a set of a frozen set (valid)
  • {{ {a,b,c}} } is a set of a set of a set (invalid)
  • {{{a,b,c}}} is parsed as a frozen set of a set (thus invalid) as I would usually expect.
  • {{{a,b}},{{c}}} is parsed as a set of two frozen sets (valid).