Skip to content

Commit

Permalink
[feature] compiler, database: Added the any field in the db ast
Browse files Browse the repository at this point in the history
  • Loading branch information
BourgerieQuentin committed May 15, 2012
1 parent 1e8eaa8 commit 4c92182
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libqmlcompil/qmlAst.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ end
module Db = module Db =
struct struct


type 'epath field = type 'epath field = [
[`string of string | `expr of 'epath] list `string of string
| `expr of 'epath
| `any
] list


type ('epath, 'expr) fields = type ('epath, 'expr) fields =
('epath field * 'expr) list ('epath field * 'expr) list
Expand Down Expand Up @@ -274,6 +277,7 @@ struct
| `string t0::((_::_) as q) -> pp fmt "%s.%a" t0 (pp_field pp_expr) q | `string t0::((_::_) as q) -> pp fmt "%s.%a" t0 (pp_field pp_expr) q
| `expr t0::q -> pp fmt "[%a]%a" pp_expr t0 (pp_field pp_expr) q | `expr t0::q -> pp fmt "[%a]%a" pp_expr t0 (pp_field pp_expr) q
| `string t0::[] -> pp fmt "%s" t0 | `string t0::[] -> pp fmt "%s" t0
| `any::q -> pp fmt "[_]%a" (pp_field pp_expr) q
| [] -> pp fmt "" | [] -> pp fmt ""


let rec pp_update pp_expr fmt = function let rec pp_update pp_expr fmt = function
Expand Down Expand Up @@ -461,7 +465,7 @@ struct
let rebuild, subs = let rebuild, subs =
List.fold_left List.fold_left
(fun (rebuild, subs) -> function (fun (rebuild, subs) -> function
| `string s -> (fun x -> `string s::rebuild x), subs | (`string _ | `any) as fragment -> (fun x -> fragment::rebuild x), subs
| `expr e -> | `expr e ->
let unsub, list = sub_epath e in let unsub, list = sub_epath e in
let length = List.length list in let length = List.length list in
Expand Down

0 comments on commit 4c92182

Please sign in to comment.