public void Simple() { TokenChecker .Of("hello") .Nl(" bar") .Raw(NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, INDENT, NORMAL, NL, DEDENT, EOF_TOKEN); }
public void IgnoreEofNoDedent() { TokenChecker .Of("hello") .Raw(NORMAL, EOF_TOKEN) .IgnoreEof() .Dented(NORMAL, EOF_TOKEN); }
public void MultipleDedentsToEof() { TokenChecker .Of("hello") .Nl(" line2") .Nl(" line3") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, INDENT, NORMAL, INDENT, NORMAL, NL, DEDENT, DEDENT, EOF_TOKEN); }
public void IgnoreEofWithDedent() { TokenChecker .Of("hello") .Nl(" world") .Raw(NORMAL, NL, NORMAL, EOF_TOKEN) .IgnoreEof() .Dented(NORMAL, INDENT, NORMAL, EOF_TOKEN); }
public void WithReturn() { TokenChecker .Of("hello") .Nl("world") .Rf("dolly") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, NL, NORMAL, NL, NORMAL, NL, EOF_TOKEN); }
public void HalfDent() { TokenChecker .Of("hello") .Nl(" world") .Nl(" boom") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, INDENT, NORMAL, NL, DEDENT, INDENT, NORMAL, NL, DEDENT, EOF_TOKEN); }
public void StartIndentedThenEmptyLines() { TokenChecker .Of(" hello") .Nl(" line2") .Nl("") .Raw(NORMAL, NL, NORMAL, NL, EOF_TOKEN) .Dented(INDENT, NORMAL, NL, NORMAL, NL, DEDENT, EOF_TOKEN); }
public void AllIndented() { TokenChecker .Of(" hello") .Nl(" line2") .Nl(" line3") .Nl(" ") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, NL, EOF_TOKEN) .Dented(INDENT, NORMAL, NL, NORMAL, INDENT, NORMAL, NL, DEDENT, DEDENT, EOF_TOKEN); }
public void SimpleWithNLs() { TokenChecker .Of("hello") .Nl("world") .Nl(" tab1") .Nl(" tab2") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, NL, NORMAL, INDENT, NORMAL, NL, NORMAL, NL, DEDENT, EOF_TOKEN); }
public void TabIndents() { TokenChecker .Of("{") .Nl("\t\tline1") .Nl("\t\tline2") .Nl("}") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, INDENT, NORMAL, NL, NORMAL, NL, DEDENT, NORMAL, NL, EOF_TOKEN); }
public void DedentToNegative() { // this shouldn't explode, it should just result in an extra dedent TokenChecker .Of(" hello") .Nl(" world") .Nl("boom") .Raw(NORMAL, NL, NORMAL, NL, NORMAL, EOF_TOKEN) .Dented(INDENT, NORMAL, NL, NORMAL, NL, DEDENT, NORMAL, NL, EOF_TOKEN); }
public void IgnoreBlankLines() { TokenChecker .Of("hello") .Nl(" ") .Nl("") .Nl(" dolly") .Nl(" ") .Nl(" ") .Nl("") .Nl("world") .Raw(NORMAL, NL, NL, NL, NORMAL, NL, NL, NL, NL, NORMAL, EOF_TOKEN) .Dented(NORMAL, INDENT, NORMAL, NL, DEDENT, NORMAL, NL, EOF_TOKEN); }