Enhance template parser to handle C++ comments and refactor preprocessing logic

- Updated parser to correctly interpret C++ `//` and `/* ... */` comments within template code.
- Split preprocessing implementation into separate files for better organization.
- Added regression test for comment parsing in templates.
- Adjusted CSS styles for improved layout and readability in documentation.
This commit is contained in:
udo
2026-04-20 21:41:23 +00:00
parent dc05f9faa5
commit b53eb6e4f1
11 changed files with 568 additions and 390 deletions
+4
View File
@@ -96,6 +96,10 @@ Inside `<> ... </>` literal blocks, UCE supports three inline forms:
Use `<?= ... ?>` by default for user-visible text. Use `<?: ... ?>` only for trusted markup or content that has already been escaped.
The parser now treats C++ `//` and `/* ... */` comments as comments in both normal code and `<? ... ?>` islands, so quotes or `<>` markers inside comments do not confuse template parsing.
The preprocessing implementation is now split between `src/lib/compiler.cpp` and `src/lib/compiler-parser.cpp`. `compiler.cpp` owns unit compilation and cache orchestration, while `compiler-parser.cpp` owns source rewriting and template parsing.
## Components
UCE includes a native component layer built on top of ordinary `.uce` files: