Does the compilation engine need to add indentation when generating XML?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Does the compilation engine need to add indentation when generating XML?

song
This post was updated on .
While developing the tokenizer, I noticed that the test files, such as MainT.xml and SquareT.xml, do not contain any indentation. The browser seems to add indentation automatically when displaying them.

However, files such as Main.xml and Square.xml do contain indentation.

Why is there a difference? Does the compilation engine need to add indentation when generating XML?


And one more question:

When compiling a do statement such as do subroutineCall, the book says to compile it as if its syntax were do expression.

So I did that, but my output contains additional tags such as <expression> and <term> compared with the provided comparison file.

Is that okay?

Reply | Threaded
Open this post in threaded view
|

Re: Does the compilation engine need to add indentation when generating XML?

WBahn
Administrator
I'm not sure about the web based tools, but the desktop tools do not require that you indent the inner tags. I don't recall if the comparison tool then requires no indentation, of if it is agnostic on that point.

The web-based tools are not perfectly consistent with the desktop tools, but are being brought into alignment over time.