예제 #1
0
        public void canParseAndTranslateMultilineAttributes()
        {
            String          jsx    = "return <a \n\tx=\"abc\"\n\ty=\"def\"\n\tz=\"stuff\" />";
            MCleverParser   parser = new MCleverParser(jsx);
            ReturnStatement stmt   = parser.doParse <ReturnStatement>(parser.return_statement, true);

            Assert.IsNotNull(stmt.getExpression());
            CodeWriter writer = new CodeWriter(Dialect.M, Context.newGlobalsContext());

            stmt.ToDialect(writer);
            String result = writer.ToString();

            Assert.AreEqual(jsx, result);
        }
예제 #2
0
        public void canParseAndTranslateMultilineElements()
        {
            String          jsx    = "return <a>\n\t<b/>\n\t<b/>\n</a>";
            ECleverParser   parser = new ECleverParser(jsx);
            ReturnStatement stmt   = parser.doParse <ReturnStatement>(parser.return_statement, true);

            Assert.IsNotNull(stmt.getExpression());
            CodeWriter writer = new CodeWriter(Dialect.M, Context.newGlobalsContext());

            stmt.ToDialect(writer);
            String result = writer.ToString();

            Assert.AreEqual(jsx, result);
        }