Пример #1
0
 public void Simple()
 {
     TokenChecker
     .Of("hello")
     .Nl("  bar")
     .Raw(NORMAL, NL, NORMAL, EOF_TOKEN)
     .Dented(NORMAL, INDENT, NORMAL, NL, DEDENT, EOF_TOKEN);
 }
Пример #2
0
 public void IgnoreEofNoDedent()
 {
     TokenChecker
     .Of("hello")
     .Raw(NORMAL, EOF_TOKEN)
     .IgnoreEof()
     .Dented(NORMAL, EOF_TOKEN);
 }
Пример #3
0
 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);
 }
Пример #4
0
 public void IgnoreEofWithDedent()
 {
     TokenChecker
     .Of("hello")
     .Nl("  world")
     .Raw(NORMAL, NL, NORMAL, EOF_TOKEN)
     .IgnoreEof()
     .Dented(NORMAL, INDENT, NORMAL, EOF_TOKEN);
 }
Пример #5
0
 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);
 }
Пример #6
0
 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);
 }
Пример #7
0
 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);
 }
Пример #8
0
 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);
 }
Пример #9
0
 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);
 }
Пример #10
0
 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);
 }
Пример #11
0
 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);
 }
Пример #12
0
 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);
 }