Skip to content

Parse infix constructors #16

@noughtmare

Description

@noughtmare

I've implemented a level oriented breadth first renumbering algorithm, but I didn't like how I had to write the semantic rules for Leaf:

sem Bin
  | Leaf lhs.res = { Leaf @x }
         (loc.x, lhs.xss) = { let ((x:xs):xss) = @lhs.xss in (x, (x+1:xs):xss) }

I would like to write this instead:

sem Bin
  | Leaf lhs.res = { Leaf @x }
         loc.((x : xs) : xss) = @lhs.xss
         lhs.xss = ((@x+1) : @xs) : @xss

But UUAGC doesn't parse infix constructors yet:

Main.ag:23:18: error: parser expecting symbol ) or @ or (symbol , ...)*
pattern  : 
help     : 
action   : deleting: symbol : at line 23, column 18 of file "Main.ag"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions