8000 Ambiguous parsing · Issue #6 · PLTools/Lama · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Ambiguous parsing #6
Open
Open
@egormkn

Description

@egormkn

Problem
I found a bug in lama parser, that is somehow connected to ambiguous grammar rules for case expression and infix operators.

Example code

infix | at ++ (lhs, rhs) {
  lhs ++ rhs
}

infix -> at ++ (lhs, rhs) {
  lhs ++ rhs
}

(* Prints "WAT" *)
printf ("%s\n", 
  case "?" of
    "?" -> "W" 
  | "A" -> "T"
  esac.string
);

(* Prints W *)
printf ("%s\n", 
  case "?" of
    "?" -> "W" 
  | "A" -> "T"
  esac
)

Expected behaviour
Both outputs are quite reasonable but they should be the same for both expressions.

Environment

Metadata

Metadata

Assignees

Labels

test caseWitnesses an error in other library

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0