public void TokenHandleReturnsEmptyStringOnceItIsRunOut() { var th = new TokenizerHandle("hello" + Environment.NewLine + "world"); th.Advance(); th.CurrentLine.ShouldBeEqualTo("hello"); th.CurrentHandled(); th.Advance(); th.CurrentLine.ShouldBeEqualTo("world"); th.CurrentHandled(); th.Advance(); th.CurrentLine.ShouldBeNull(); }
protected void extractScript(TokenizerHandle h) { h.CurrentHandled(); h.Advance(); var rEnd = new Regex(@"\s*" + Terminator); var b = new StringBuilder(); while (!rEnd.IsMatch(h.CurrentLine)) { b.AppendLine(h.CurrentLine); h.CurrentHandled(); h.Advance(); } Script = b.ToString(); }
private static AnyToken asNodeWithOptions(AbstractDefinedValueToken varToken) { var h = new TokenizerHandle(varToken.Value); h.Advance(); var anyToken = new AnyToken(); anyToken = (AnyToken) anyToken.Check(h); if (anyToken == null) throw new ArgumentException("Value to " + varToken.VariableName + " could not be understood."); return anyToken; }