public void GetIndentationSize_Spaces3Then6() { var l = new YamlLexer(); int actual = l.GetIndentationSize(" "); Assert.AreEqual(1, actual); actual = l.GetIndentationSize(" "); Assert.AreEqual(2, actual); }
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(); }
public void GetIndentationSize_BlankString() { var l = new YamlLexer(); int actual = l.GetIndentationSize(""); Assert.AreEqual(0, actual); }
private CommonTree GetParser(string content) { var lexer = new YamlLexer(new ANTLRStringStream(content)); var tokens = new CommonTokenStream(lexer); return (CommonTree)new YamlParser(tokens).value().Tree; }