whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.2k stars 221 forks source link

Http preprocessor improvement #364

Open chowette opened 4 years ago

chowette commented 4 years ago

In any case, your lua code should not include the ending tag so <?lua print('?>') ?> is malformed and should be rewritten by hand to <?lua print('?'..'>') ?> for exemple.

chowette commented 4 years ago

I agree with you about file location and separation. However, Webserver script pages are not lua scripts, they are html files with some part containing lua fragment of script. It is not uncommon to have lua statement split and interleaved with 'raw text'. It this case, most editor with syntactic coloration cannot display the file as lua.

Compare

<html>
<body>
<table>
<?lua for i=1,10 do ?>
<tr><td> <?lua print(i)  ?></td></tr>
<?lua  end ?>
</table>
</body>
</html>

to

<html>
<body>
<table>
<?lua for i=1,10 do ?>
<tr><td> <?lua print(i)  ?></td></tr>
<?lua  end ?>
</table>
</body>
</html>

If both files have, the same extension, is it way harder to instruct your editor how to colorise the file.

Finally, there is no sense in doing dofile('index.lua') but you cannot do dofile('index.luasp')