[svn] r7063: nemerle/trunk/ncc/typing/Macros.n
nazgul
svnadmin at nemerle.org
Wed Dec 6 19:09:06 CET 2006
Log:
Add error message for pattern matching on quoted typed nodes
Author: nazgul
Date: Wed Dec 6 19:09:04 2006
New Revision: 7063
Modified:
nemerle/trunk/ncc/typing/Macros.n
Modified: nemerle/trunk/ncc/typing/Macros.n
==============================================================================
--- nemerle/trunk/ncc/typing/Macros.n (original)
+++ nemerle/trunk/ncc/typing/Macros.n Wed Dec 6 19:09:04 2006
@@ -537,10 +537,9 @@
| PExpr.Spliced (e) => e
- | PExpr.Wildcard => <[ ManagerClass.Instance.Solver.FreshTyVar () ]>
+ | PExpr.Wildcard => <[ Manager.Solver.FreshTyVar () ]>
- | PExpr.Ellipsis (ar) =>
- <[ MType.Tuple ($(quoted_ttype (ar))) ]>
+ | PExpr.Ellipsis (ar) => <[ MType.Tuple ($(quoted_ttype (ar))) ]>
| PExpr.Typed => Util.ice ("You've got beer from me for generating such a code...");
@@ -788,8 +787,8 @@
<[ Literal.Integer ($v, $n, _) ]>
| <[ $constr (.. $pars) ]> =>
- def (con, name) = Option.UnSome (Util.qidl_of_expr (constr));
- def last = List.Last (con);
+ def (con, name) = Option.UnSome (Util.QidOfExpr (constr));
+ def last = con.Last;
match (name.context.LookupType (con)) {
| Some (tcon) =>
def convert_params (pars : list [PExpr], mems : list[IField], acc) {
@@ -849,6 +848,8 @@
| None when last.EndsWith ("ExactPath") => PExpr.Wildcard ()
+ | None when last.EndsWith ("TypedChoose") => Message.FatalError ("typed tree cannot be used in pattern matching")
+
| None when last.StartsWith ("From") =>
<[ Literal.Integer ($(last.Replace ("From", "As") : dyn)
= Some ($(patternize_quotation (List.Head (pars))))) ]>
More information about the svn
mailing list