Skip to content

Instantly share code, notes, and snippets.

@smietanka
smietanka / rison.cs
Last active June 18, 2018 11:32
Rewritten https://github.com/Nanonid/rison to C# language
public class Rison
{
private string currentString;
private int index = 0;
private string next_id_rgx = @"[^-0123456789 '!:(),*@$][^ '!:(),*@$]*";
private Dictionary<char, Func<object>> Table;
private Dictionary<char, Func<Rison, object>> Bands = new Dictionary<char, Func<Rison, object>>()
{
{ 't', (x) => { return true; } },
{ 'f', (x) => { return false; } },