Skip to content

Instantly share code, notes, and snippets.

@gabrfarina
gabrfarina / fizz_buzz_generator.rs
Created October 26, 2017 20:33
FizzBuzzGenerator
#![feature(inclusive_range_syntax, generators, generator_trait, never_type)]
use std::ops::{Generator, GeneratorState};
fn is_div_by(n: u64, modulus: u64) -> bool {
if n % modulus == 0 {
true
} else {
false
}

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?