This file contains hidden or 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
let mut file = std::fs::OpenOptions::new() | |
.write(true) | |
.append(false) | |
.create(true) | |
.open("/home/ebresafegaga/server.log") | |
.unwrap(); | |
let data = format!("{:?}", linearization.linearization); | |
std::io::Write::write(&mut file, data.as_ref()).unwrap(); |
This file contains hidden or 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
fn parse_crate<'a, I>(chs: &'a mut I) -> Option<char> | |
where | |
I: Iterator<Item = char>, | |
{ | |
fn is_for_crate<'a, I>(c: char, chs: &'a mut I) -> bool | |
where | |
I: Iterator<Item = char>, | |
{ | |
if c == '[' || c == ']' { | |
true |
This file contains hidden or 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
let path: String = path.chars().skip_while(|ch| !(ch.is_alphanumeric() || *ch == '-' || *ch == '_')).collect(); | |
// | |
// ("Paren before ident", "(record", vec!["record"]) |
This file contains hidden or 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
let (next, _) = linearization.get_items_adjacent(parent.id); | |
let next = next.and_then(|item| match item.kind { | |
TermKind::RecordField { | |
ident, | |
record, | |
value: ValueState::Known(value), | |
.. | |
} if value == parent.id => Some((ident, record)), | |
_ => None, | |
}); |
This file contains hidden or 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
(* camel_to_kebab('CamelCaseString') == 'camel-case-string' | |
camel_to_kebab('CamelCaseStringWithABREV') == 'camel-case-string-with-abrev' | |
camel_to_kebab('CamelCaseStringWithABREVInCenter') == 'camel-case-string-with-abrev-in-center' *) | |
(* words = re.findall('([A-Z][a-z]+)|([A-Z]+(?=[A-Z][a-z]+))', s) *) | |
type state = | |
| Start | |
| InsideCamel | |
| InsideAbrev |
This file contains hidden or 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
type stack = int array | |
type machine = { ip : int; sp : int; mutable stack : stack } | |
(* Machine stack *) | |
module type S = sig | |
type t | |
type index | |
type elem |
This file contains hidden or 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
let long_computation () = | |
for i = 0 to 1_000_000_000 do | |
() | |
done | |
(* No parallelism *) | |
(* | |
________________________________________________________ | |
Executed in 36.09 secs fish external | |
usr time 36.08 secs 1.27 millis 36.08 secs |
OlderNewer