diff options
| author | Pierre Letouzey | 2014-02-17 14:32:50 +0100 |
|---|---|---|
| committer | Pierre Letouzey | 2015-01-11 09:49:32 +0100 |
| commit | d15d8cc0ce584a6d80d878faf84314c6712ccf69 (patch) | |
| tree | 0042925526cfd801451cdbe5472f44cd2169a57c /plugins/extraction/common.ml | |
| parent | b858f939f33dc4bc4c8e470ed62310ef15c59a99 (diff) | |
Extraction: minor tweaks to ease ongoing experiments about Lambda
- Common.get_native_char instead of just a pp function of this char
- Enrich the record projection table
Diffstat (limited to 'plugins/extraction/common.ml')
| -rw-r--r-- | plugins/extraction/common.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index 135d3fc7cd..4f78ffe978 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -642,11 +642,13 @@ let is_native_char = function MutInd.equal kn ind_ascii && check_extract_ascii () && is_list_cons l | _ -> false -let pp_native_char c = +let get_native_char c = let rec cumul = function | [] -> 0 | MLcons(_,ConstructRef(_,j),[])::l -> (2-j) + 2 * (cumul l) | _ -> assert false in let l = match c with MLcons(_,_,l) -> l | _ -> assert false in - str ("'"^Char.escaped (Char.chr (cumul l))^"'") + Char.chr (cumul l) + +let pp_native_char c = str ("'"^Char.escaped (get_native_char c)^"'") |
