Skip to content

Instantly share code, notes, and snippets.

View saibatizoku's full-sized avatar

Joaquín Rosales saibatizoku

View GitHub Profile
@saibatizoku
saibatizoku / parsers.lalrpop
Last active August 11, 2017 23:37
initial parser for RTD EZO commands
/// Public Commands API
#[derive(Debug, PartialEq)]
pub enum ApiCommand {
Baud(BpsRate),
Calibrate(f64),
CalClear,
CalStatus,
Export,
ExportInfo,
Import(String),
@saibatizoku
saibatizoku / gist:de8755c8add61607594bd4da4f96c3c6
Created August 1, 2017 23:01
macro that creates a command struct & impl with #[doc=...], with example of usage on another crate
#[macro_export]
macro_rules! define_command {
// DOCUMENTED COMMANDS
// ===================
// {
// doc: "docstring",
// Name, cmd_string_block, delay
// }
(doc: $doc:tt,
$name:ident, $command_string:block, $delay:expr) => {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
http://pastie.org/private/256ggjh9wgl8qhypn4au5w