This example compiles a simple function using the LLVM C API through the llvm-sys
crate.
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
[alias] | |
stat = status -sb | |
graph = log --oneline --decorate --graph --topo-order | |
desc = log -1 --decorate | |
leaderboard = shortlog -sne | |
sync = !git pull --rebase && git push | |
[push] | |
default = simple |
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
#include <string> | |
#include <iostream> | |
#define CAPTURE_TOKEN(t) \ | |
token->value = std::string(ts, te-ts); \ | |
token->type = Token::t | |
%%{ | |
machine ExampleLexer; |
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
target |
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
[package] | |
name = "euler12" | |
version = "0.1.0" | |
[[bin]] | |
name = "euler12" | |
path = "euler12.rs" |
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
class Euler12 { | |
construct new(cutoff) { | |
_cutoff = cutoff | |
} | |
find_divisors(n) { | |
var nod = 0 | |
var sqrt = n.sqrt.floor | |
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
abstract class TZ | |
{ | |
public abstract TimeSpan UTCOffset { get; } | |
} | |
sealed class BST : TZ | |
{ | |
public override TimeSpan UTCOffset => TimeSpan.FromHours(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
[package] | |
name = "parsetest" | |
version = "0.1.0" | |
authors = ["Will Speak <[email protected]>"] | |
[dependencies] | |
[[bin]] | |
name = "parsetest" | |
path = "main.rs" |
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
#![feature(inclusive_range_syntax)] | |
/// Steps At | |
/// | |
/// Returns the number of combinations of steps which can be made | |
/// where the top step is a given size. This is used as the recursive | |
/// step. | |
/// | |
/// # Arguments | |
/// |
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
[package] | |
name = "yop" | |
version = "0.1.0" | |
authors = ["Will Speak <[email protected]>"] | |
[dependencies] | |
[[bin]] | |
name = "yop" | |
path = "yop.rs" |