-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'guido_range' of github:FStarLang/FStar
- Loading branch information
Showing
109 changed files
with
2,241 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include FStar_Compiler_Range_Type | ||
include FStar_Compiler_Range_Ops |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
exception UnsupportedJson | ||
|
||
type json = | ||
| JsonNull | ||
| JsonBool of bool | ||
| JsonInt of Z.t | ||
| JsonStr of string | ||
| JsonList of json list | ||
| JsonAssoc of (string * json) list | ||
|
||
let json_of_yojson yjs: json option = | ||
let rec aux yjs = | ||
match yjs with | ||
| `Null -> JsonNull | ||
| `Bool b -> JsonBool b | ||
| `Int i -> JsonInt (Z.of_int i) | ||
| `String s -> JsonStr s | ||
| `List l -> JsonList (List.map aux l) | ||
| `Assoc a -> JsonAssoc (List.map (fun (k, v) -> (k, aux v)) a) | ||
| _ -> raise UnsupportedJson in | ||
try Some (aux yjs) with UnsupportedJson -> None | ||
|
||
let rec yojson_of_json js = | ||
match js with | ||
| JsonNull -> `Null | ||
| JsonBool b -> `Bool b | ||
| JsonInt i -> `Int (Z.to_int i) | ||
| JsonStr s -> `String s | ||
| JsonList l -> `List (List.map yojson_of_json l) | ||
| JsonAssoc a -> `Assoc (List.map (fun (k, v) -> (k, yojson_of_json v)) a) | ||
|
||
let json_of_string str : json option = | ||
let open Yojson.Basic in | ||
try | ||
json_of_yojson (Yojson.Basic.from_string str) | ||
with Yojson.Json_error _ -> None | ||
|
||
let string_of_json json = | ||
Yojson.Basic.to_string (yojson_of_json json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
type __range = FStar_Compiler_Range.range | ||
type __range = FStar_Compiler_Range_Type.range | ||
type range = __range | ||
|
||
let mk_range f a b c d = FStar_Compiler_Range.mk_range f {line=a;col=b} {line=c;col=d} | ||
let mk_range f a b c d = FStar_Compiler_Range_Type.mk_range f {line=a;col=b} {line=c;col=d} | ||
let range_0 : range = let z = Prims.parse_int "0" in mk_range "<dummy>" z z z z | ||
|
||
type ('Ar,'Amsg,'Ab) labeled = 'Ab |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.