Skip to content

SAWScript type constructor applications are parsed as right-associative #2755

@samcowger

Description

@samcowger

While updating the SAWScript parser in #2748, I realized that we parse SAWScript types as right-associative in constructor applications - so a type written as TopLevel Int Int (such as in intTests/test_type_errors/err034.saw) is parsed as TopLevel (Int Int). Pre-#2748, TopLevel Int Int wouldn't make it past the parser, but with that PR's changes, it will.

I think we'd much rather treat type constructor applications as left-associative, and I think err034.saw as written already expects that we do that. I don't think we have any * -> * -> * types, but if we did, it would seem pretty odd to mandate that they be written out as (TC t1) t2, rather than allowing TC t1 t2.

With #2748's changes to the AppliedType parsing rule (in Parser.y), changing this associativity should be pretty trivial.

Metadata

Metadata

Assignees

Labels

subsystem: saw-scriptIssues related to the SAWScript language and/or its interpretation and executiontype: bugIssues reporting bugs or unexpected/unwanted behavior

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions