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 net.raboof.parser | |
// based on http://blogs.msdn.com/b/lukeh/archive/2007/08/19/monadic-parser-combinators-using-c-3-0.aspx | |
data class Result<TInput, TValue>(val value: TValue, val rest: TInput) | |
class Parser<TInput, TValue>(val f: (TInput) -> Result<TInput, TValue>?) { | |
operator fun invoke(input: TInput): Result<TInput, TValue>? = f(input) | |
infix fun or(other: Parser<TInput, TValue>): Parser<TInput, TValue> { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<META http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>MonoGame.Tests.MacOS</title> | |
<style> | |
.plus { | |
display: inline-block; |