Exemple #1
0
 public void GetIndentationSize_Spaces3Then6()
 {
     var l = new YamlLexer();
     int actual = l.GetIndentationSize("   ");
     Assert.AreEqual(1, actual);
     actual = l.GetIndentationSize("      ");
     Assert.AreEqual(2, actual);
 }
Exemple #2
0
 internal static object Parse(string content)
 {
     var lexer = new YamlLexer(new ANTLRStringStream(content));
     var tokens = new CommonTokenStream(lexer);
     var parser = new YamlParser(tokens);
     var stream = new CommonTreeNodeStream(parser.value().Tree);
     stream.TokenStream = tokens;
     var tree = new YamlTree(stream);
     return tree.value();
 }
Exemple #3
0
 public void GetIndentationSize_BlankString()
 {
     var l = new YamlLexer();
     int actual = l.GetIndentationSize("");
     Assert.AreEqual(0, actual);
 }
Exemple #4
0
 private CommonTree GetParser(string content)
 {
     var lexer = new YamlLexer(new ANTLRStringStream(content));
     var tokens = new CommonTokenStream(lexer);
     return (CommonTree)new YamlParser(tokens).value().Tree;
 }