This example compiles a simple function using the LLVM C API through the llvm-sys crate.
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
| [package] | |
| name = "oni" | |
| version = "0.1.0" | |
| authors = ["Ian Pickering <[email protected]>"] | |
| [dependencies] | |
| onig = "1.4" | |
| [[bin]] | |
| name = "oni" |
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
| [package] | |
| name = "yop" | |
| version = "0.1.0" | |
| authors = ["Will Speak <[email protected]>"] | |
| [dependencies] | |
| [[bin]] | |
| name = "yop" | |
| path = "yop.rs" |
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
| #![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 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
| [package] | |
| name = "parsetest" | |
| version = "0.1.0" | |
| authors = ["Will Speak <[email protected]>"] | |
| [dependencies] | |
| [[bin]] | |
| name = "parsetest" | |
| path = "main.rs" |
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
| abstract class TZ | |
| { | |
| public abstract TimeSpan UTCOffset { get; } | |
| } | |
| sealed class BST : TZ | |
| { | |
| public override TimeSpan UTCOffset => TimeSpan.FromHours(1); | |
| } |
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
| class Euler12 { | |
| construct new(cutoff) { | |
| _cutoff = cutoff | |
| } | |
| find_divisors(n) { | |
| var nod = 0 | |
| var sqrt = n.sqrt.floor | |
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
| [package] | |
| name = "euler12" | |
| version = "0.1.0" | |
| [[bin]] | |
| name = "euler12" | |
| path = "euler12.rs" |
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
| target |
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
| #include <string> | |
| #include <iostream> | |
| #define CAPTURE_TOKEN(t) \ | |
| token->value = std::string(ts, te-ts); \ | |
| token->type = Token::t | |
| %%{ | |
| machine ExampleLexer; |