Permalink
Browse files

[feature] compiler, database: Inspect the next node when seletc id fo…

…r compute default values
  • Loading branch information...
1 parent ecce968 commit 7fa0a5d52f23152b26b2f46ba05fa584d7638037 @BourgerieQuentin BourgerieQuentin committed Apr 16, 2012
Showing with 14 additions and 5 deletions.
  1. +14 −5 libqmlcompil/dbGen/dbGen_private.ml
View
19 libqmlcompil/dbGen/dbGen_private.ml
@@ -102,11 +102,20 @@ module Default = struct
H.make_dot ~ty (expr_aux sch (E.src e)) (SchemaGraphLib.fieldname_of_edge e)
else
match (V.label n).C.nlabel with
- | C.Multi -> (match SchemaGraphLib.multi_key sch n with
- | C.Kint -> H.make_record ["empty", H.make_record []]
- | C.Kstring -> H.make_record ["empty", H.make_record []]
- | C.Kfields _ -> H.make_record ["empty", H.make_record []]
- (* TODO - ... *))
+ | C.Multi ->
+ begin match select with
+ | DbAst.SStar | DbAst.SNil ->
+ begin match SchemaGraphLib.multi_key sch n with
+ | C.Kint -> H.make_record ["empty", H.make_record []]
+ | C.Kstring -> H.make_record ["empty", H.make_record []]
+ | C.Kfields _ -> H.make_record ["empty", H.make_record []]
+ end
+ | DbAst.SSlice _ | DbAst.SFlds _ ->
+ OManager.i_error
+ "On compute default value unexpected selection on a multi node"
+ | DbAst.SId (_, select) -> expr_aux ~select sch (SchemaGraph.unique_next sch n)
+
+ end
| C.Hidden -> expr_aux sch (SchemaGraph.unique_next sch n)
| C.Sum -> H.convert_case_to_sum ty (expr_aux sch (E.dst (Schema_private.find_nonrec_child_edge sch n)))
| C.Product ->

0 comments on commit 7fa0a5d

Please sign in to comment.