-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement some error recovery logic to parser
- Loading branch information
Showing
190 changed files
with
3,839 additions
and
875 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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/*.bk": true, | ||
}, | ||
"[rust]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"rust.rustflags": "--cfg procmacro2_semver_exempt", | ||
// Important | ||
"rust.cfg_test": false, | ||
"rust-client.revealOutputChannelOn": "warn", | ||
"rust-client.logToFile": true, | ||
"editor.formatOnSave": true, | ||
|
||
} | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/*.bk": true | ||
}, | ||
"[rust]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"[typescript]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"rust.rustflags": "--cfg procmacro2_semver_exempt", | ||
// Important | ||
"rust.cfg_test": false, | ||
"rust-client.revealOutputChannelOn": "warn", | ||
"rust-client.logToFile": true, | ||
"editor.formatOnSave": true, | ||
"git.ignoreLimitWarning": true | ||
} |
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
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
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,48 @@ | ||
pub trait IteratorExt: Iterator { | ||
/// Copied from https://stackoverflow.com/a/49456265/6193633 | ||
fn chain_with<F, I>(self, f: F) -> ChainWith<Self, F, I::IntoIter> | ||
where | ||
Self: Sized, | ||
F: FnOnce() -> I, | ||
I: IntoIterator<Item = Self::Item>, | ||
{ | ||
ChainWith { | ||
base: self, | ||
factory: Some(f), | ||
iterator: None, | ||
} | ||
} | ||
} | ||
|
||
impl<I: Iterator> IteratorExt for I {} | ||
|
||
pub struct ChainWith<B, F, I> { | ||
base: B, | ||
factory: Option<F>, | ||
iterator: Option<I>, | ||
} | ||
|
||
impl<B, F, I> Iterator for ChainWith<B, F, I::IntoIter> | ||
where | ||
B: Iterator, | ||
F: FnOnce() -> I, | ||
I: IntoIterator<Item = B::Item>, | ||
{ | ||
type Item = I::Item; | ||
fn next(&mut self) -> Option<Self::Item> { | ||
if let Some(b) = self.base.next() { | ||
return Some(b); | ||
} | ||
|
||
// Exhausted the first, generate the second | ||
|
||
if let Some(f) = self.factory.take() { | ||
self.iterator = Some(f().into_iter()); | ||
} | ||
|
||
self.iterator | ||
.as_mut() | ||
.expect("There must be an iterator") | ||
.next() | ||
} | ||
} |
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,2 +1,3 @@ | ||
pub mod iter; | ||
pub mod map; | ||
pub mod move_map; |
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
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
Oops, something went wrong.