Пример #1
0
 def testCanParseAndTranslateMultilineElements(self):
     jsx = "return <a>\n\t<b/>\n\t<b/>\n</a>"
     parser = MCleverParser(text=jsx)
     stmt = parser.doParse(parser.return_statement, True)
     self.assertIsNotNone(stmt.expression)
     writer = CodeWriter(Dialect.M, Context.newGlobalContext())
     stmt.toDialect(writer)
     out = str(writer)
     self.assertEquals(jsx, out)
Пример #2
0
 def testCanParseAndTranslateMultilineAttributes(self):
     jsx = "return <a \n\tx=\"abc\"\n\ty=\"def\"\n\tz=\"stuff\" />"
     parser = MCleverParser(text=jsx)
     stmt = parser.doParse(parser.return_statement, True)
     self.assertIsNotNone(stmt.expression)
     writer = CodeWriter(Dialect.M, Context.newGlobalContext())
     stmt.toDialect(writer)
     out = str(writer)
     self.assertEquals(jsx, out)