浏览代码

fix empty tuple pattern

Getty Ritter 3 年之前
父节点
当前提交
0f3a9627e4
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/grammar.lalrpop

+ 1 - 0
src/grammar.lalrpop

@@ -137,6 +137,7 @@ pub Pat: Pat = {
     "_" => Pat::Wildcard,
     "_" => Pat::Wildcard,
     <Literal> => Pat::Lit(<>),
     <Literal> => Pat::Lit(<>),
     <Name> => Pat::Var(<>),
     <Name> => Pat::Var(<>),
+    "<" ">" => Pat::Tup(Vec::new()),
     "<" <mut ps:(<Pat> ",")*> <p:Pat> ">" => {
     "<" <mut ps:(<Pat> ",")*> <p:Pat> ">" => {
         ps.push(p);
         ps.push(p);
         Pat::Tup(ps)
         Pat::Tup(ps)