In the following code, the indentation between 'view' and 'end' is done manually
and disapear whenever you format with Pretier ar any other code formater
begin(document.body);{letapp=bdiv();{h1({style:"text-align:center"},"Demo VanJS / DML");Counter(0);Counter(4);Counter(56);}end();app.style=style_app;h1("Here is an orphan counter");Counter(12);}end();
With respect to Tao´s whish to keep the code as small as possible, van_dml contains just a minimal version of begin/end. The next version of DML, which I´m currently working on, will look like this:
This is super helpful in larger applications, as you immediately know, which level is closed by end(). You can still use end() without arguments, but if you include the reference, that was used in the corresponding begin(), DML performs a stack check to see, if all levels are closed correctly. This comes very handy in larger applications.
I preserved the option to perform multiple end´s like this, which sometimes makes the code shorter:
Sorry, I did not get your point? You can get indentation by adding { } in the code...
In the following code, the indentation between 'view' and 'end' is done manually
and disapear whenever you format with Pretier ar any other code formater
I have just tried
and the indentation is preserved, great :-D
Than you Eckehard
You can also use a short form for indentation in VScode, which is readable as well. It´s just a matter of personal preference:
With respect to Tao´s whish to keep the code as small as possible, van_dml contains just a minimal version of begin/end. The next version of DML, which I´m currently working on, will look like this:
This is super helpful in larger applications, as you immediately know, which level is closed by end(). You can still use end() without arguments, but if you include the reference, that was used in the corresponding begin(), DML performs a stack check to see, if all levels are closed correctly. This comes very handy in larger applications.
I preserved the option to perform multiple end´s like this, which sometimes makes the code shorter:
Great Eckehard, I will be the first to use it :-)