Fix infinite loop in lexer when parsing attribute expressions with operators

The lexer would hang when encountering operators like + in attribute values
(e.g., class="btn btn-" + type). Added scanAttrValuePart to handle
expression continuation with operators (+, -, *, /).

Also cleaned up debug prints from view_engine.zig and demo/main.zig.
This commit is contained in:
2026-01-17 19:26:24 +05:30
parent 4538b17f0a
commit 8878b630cb
13 changed files with 149 additions and 95 deletions

View File

@@ -0,0 +1,7 @@
html
head
block head
script(src='/vendor/jquery.js')
script(src='/vendor/caustic.js')
body
block content

View File

@@ -0,0 +1,10 @@
html
head
title My Site - #{title}
block scripts
script(src='/jquery.js')
body
block content
block foot
#footer
p some footer content

View File

@@ -0,0 +1,5 @@
mixin btn(text, type="primary")
button(class="btn btn-" + type)= text
mixin btn-link(href, text)
a.btn.btn-link(href=href)= text

View File

@@ -0,0 +1,11 @@
mixin card(title)
.card
.card-header
h3= title
.card-body
block
mixin card-simple(title, body)
.card
h3= title
p= body

View File

@@ -0,0 +1,15 @@
extends layout.pug
block scripts
script(src='/jquery.js')
script(src='/pets.js')
block content
h1= title
p Welcome to the pets page!
ul
li Cat
li Dog
ul
each val in items
li= val

View File

@@ -0,0 +1,5 @@
extends layout
append head
script(src='/vendor/three.js')
script(src='/game.js')

View File

@@ -0,0 +1,11 @@
extends layout-2.pug
block append head
script(src='/vendor/three.js')
script(src='/game.js')
block content
p
| cheks manually the head section
br
| hello there

View File

@@ -0,0 +1,9 @@
extends sub-layout.pug
block content
.sidebar
block sidebar
p nothing
.primary
block primary
p nothing

View File

@@ -0,0 +1 @@
p= petName

View File

@@ -0,0 +1,9 @@
extends layout.pug
block content
.sidebar
block sidebar
p nothing
.primary
block primary
p nothing