Clean
This commit is contained in:
parent
0d3fe99ef9
commit
13009e52a5
3 changed files with 12 additions and 13 deletions
|
|
@ -77,7 +77,7 @@ static vector<string> list_directory(string dir_name) {
|
|||
}
|
||||
|
||||
static string src_dir() {
|
||||
const char * dir = getenv("TREESITTER_DIR");
|
||||
const char *dir = getenv("TREESITTER_DIR");
|
||||
if (!dir) dir = getenv("PWD");
|
||||
return dir;
|
||||
}
|
||||
|
|
@ -90,9 +90,8 @@ vector<TestEntry> test_entries_for_language(string language) {
|
|||
for (string &filename : filenames) {
|
||||
ifstream file(filename);
|
||||
std::string content((istreambuf_iterator<char>(file)), istreambuf_iterator<char>());
|
||||
for (TestEntry entry : get_test_entries_from_string(content)) {
|
||||
for (TestEntry &entry : get_test_entries_from_string(content))
|
||||
result.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ barf
|
|||
==========================================
|
||||
recovers from errors inside arrays
|
||||
==========================================
|
||||
[1,,2]
|
||||
[1, , 2]
|
||||
---
|
||||
(value (array
|
||||
(value (number))
|
||||
|
|
@ -25,7 +25,7 @@ recovers from errors inside arrays
|
|||
==========================================
|
||||
recovers from errors inside objects
|
||||
==========================================
|
||||
{ "key1": 1, 5 }
|
||||
{ "key1": 1, oops }
|
||||
---
|
||||
(value (object (string) (value (number)) (ERROR)))
|
||||
|
||||
|
|
@ -37,4 +37,4 @@ recovers from errors inside nested objects
|
|||
(value (object
|
||||
(string) (value (object (string) (value (number)) (ERROR)))
|
||||
(ERROR)
|
||||
(string) (value (number))))
|
||||
(string) (value (number))))
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
====================
|
||||
parses empty objects
|
||||
====================
|
||||
{}
|
||||
---
|
||||
(value (object))
|
||||
|
||||
===================
|
||||
parses empty arrays
|
||||
===================
|
||||
|
|
@ -33,6 +26,13 @@ parses arrays
|
|||
))
|
||||
))
|
||||
|
||||
====================
|
||||
parses empty objects
|
||||
====================
|
||||
{}
|
||||
---
|
||||
(value (object))
|
||||
|
||||
===================
|
||||
parses long objects
|
||||
===================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue