Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from hferee/master
Make find_binding match annotated declarations
- Loading branch information
Showing
21 changed files
with
259 additions
and
0 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
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 @@ | ||
let foo (x : int) : int = x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
let foo (x : int) = x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
let foo x : int = x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
let foo = function | x -> x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
let foo x = x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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 @@ | ||
let foo = fun x -> x + 1 |
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,38 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found a toplevel definition for " | ||
}, | ||
{ | ||
"text": "foo", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
tests/test_find_binding/repo/exercises/find_binding/descr.html
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,3 @@ | ||
<p> | ||
This exercise is just a test for the <code>find_binding</code> function. | ||
</p> |
2 changes: 2 additions & 0 deletions
2
tests/test_find_binding/repo/exercises/find_binding/meta.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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"learnocaml_version":"1","kind":"exercise","stars":0, | ||
"title":"Demo of the exercise environment"} |
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 @@ | ||
|
Empty file.
1 change: 1 addition & 0 deletions
1
tests/test_find_binding/repo/exercises/find_binding/solution.ml
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 @@ | ||
let foo x = x + 1 |
1 change: 1 addition & 0 deletions
1
tests/test_find_binding/repo/exercises/find_binding/template.ml
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 @@ | ||
let foo x = x + 1 |
10 changes: 10 additions & 0 deletions
10
tests/test_find_binding/repo/exercises/find_binding/test.ml
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,10 @@ | ||
open Test_lib | ||
open Report | ||
|
||
let () = | ||
set_result @@ | ||
ast_sanity_check code_ast @@ fun () -> | ||
[ Section | ||
([ Text "Function:" ; Code "foo" ], | ||
find_binding code_ast "foo" (fun _ -> [Message ([Text "Found"], Success 1)])); | ||
] |
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,5 @@ | ||
{ "learnocaml_version": "1", | ||
"groups": | ||
{ "demo": | ||
{ "title": "Test find_binding", | ||
"exercises": [ "find_binding" ] } } } |