internal CodeReader CreateReader(CodeReader reader) { string text = ""; CodeReader r = reader.Copy(); while (!r.Done) { string line = r.NextLine(); if (line.StartsWith("def ")) { continue; } var matches = definitions.Where(d => d.IsMatch(line)); foreach (var match in matches) { line = match.Apply(line); } text += line + "\n"; } return(CodeReader.FromText(text)); }
public static bool TryScan(CodeReader reader, out IScanable scanned) { string line = reader.NextLine(); return(TryScan(line, out scanned)); }