Skip to content

prohibit keywords as identifier

I generated some tests and noticed that there is a small chance to generate reserved keywords as identifiers. This obviously should be a almost every time a parsing failure.

Minified example:

# RUN: choco-opt %s | filecheck %s
while not (True[False] > for if A if B if "C" else D else E else F):
    pass

was generated as

# CHECK-NEXT:             "choco.ast.id_expr"() <{"id" = "for"}> : () -> ()

BTW really nice program :)

Merge request reports

Loading