public static void Generate( this NeuCodeGenerator generator, NeuKeyword keyword) { switch (keyword.KeywordType) { case NeuKeywordType.Func: generator.Append($"{keyword.Source} "); return; /// case NeuKeywordType.Return: generator.Append($"\n {keyword.Source} "); return; /// case NeuKeywordType.True: generator.Append($"{keyword.Source}"); return; /// default: throw new Exception(); } }
public static void Generate( this NeuCodeGenerator generator, NeuPunc p) { switch (p.PuncType) { case NeuPuncType.Arrow: generator.Append($" {p.Source} "); return; /// case NeuPuncType.LeftBrace: generator.Append($" {p.Source}\n"); return; /// case NeuPuncType.RightBrace: generator.Append($"\n{p.Source}"); return; /// default: generator.Append($"{p.Source}"); return; } }
public static void Generate( this NeuCodeGenerator generator, NeuIdentifier id) { generator.Append($"{id.Source}"); }