Skip to content

Instantly share code, notes, and snippets.

// Dummy - Define ctor
var Dummy$ctor = {};
// Dummy - Constructors body
Dummy$ctor[""] = function() {}
// Dummy - Init
function Dummy() {
var _nw_self = this;
// Dummy - Properties

| | Grouping ||

First Header Second Header Third Header
Content Long Cell
Content Cell Cell

New section | More | Data | And more | And more | [Prototype table]

private __GENERATED_PEG__RULE__startx__(position : int, text : string) : int
{
unchecked
{
mutable (c : char);
_ = c;
{
mutable token_1;
if (__GENERATED_PEG__Memeoize_Pos__start__ == position)
private __GENERATED_PEG__RULE__sumOrSubx__(position : int, text : string) : int * int
{
mutable result;
def p = unchecked
{
mutable (c : char);
_ = c;
{
_ = "CaptureH[sumOrSub](CaptureA[(int, List[(Chars, Void, int)])](CaptureA[(int, List[(Chars, Void, int)])](CaptureA[int](mulOrDiv) CaptureA[List[(Chars, Void, int)]](CaptureA[(Chars, Void, int)](CaptureA[(Chars, Void, int)](CaptureA[Chars]('+' / '-') CaptureA[Void](spaces) CaptureA[int](mulOrDiv)))*))))";
// Calculator.CalcParser
private mutable mutable __GENERATED_PEG__Memeoize_Pos__start__ : int
// Calculator.CalcParser
private mutable mutable __GENERATED_PEG__Memeoize_End__start__ : int
// Calculator.CalcParser
private mutable mutable __GENERATED_PEG__Memeoize_Res__start__ : int
// Calculator.CalcParser
Main() : void
{
def type = "A.B`2+C`1";
def args = ["X", "Y", "Z"].ToList();
def re = Regex(@"`(\d)");
def sp = re.Split(type.Replace('+', '.'), int.MaxValue);
def sb = StringBuilder();
@NN---
NN--- / gist:4445011
Last active December 10, 2015 14:08
/// <summary>
/// Transforms system type identifier with generic arguments to the parse-tree expression.
/// Number of elemnts in args must match number of generic parameters in the systemType.
/// </summary>
/// <example>
/// "NS.A`2+B`1", ["X", "Y", "Z"] ==> <[ NS.A.[X, Y].B.[Z] ]>
/// </example>
public static FromSystemType(manager : ManagerClass, systemType : string, args : list[string]) : PExpr
{
if (string.IsNullOrEmpty (systemType)) <[]>
class XInt { public F() : void {} }
class XString { public G() : void {} }
class XObject
{
public static @()(_ : XObject, x : int) : XInt { XInt(); }
public static @()(_ : XObject, x : int) : XString { XString(); }
public X() : void {}
}
public class NameListPage
{
public Name : string
{
mutable _name : string;
get
{
server.GetName(name => { ServerName = name });
_name
}
using System;
using System.Console;
using M;
class Test
{
public static @()(this _ : this, s : string) : void
{
}
}