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:
7
src/examples/demo/views/layout-2.pug
Normal file
7
src/examples/demo/views/layout-2.pug
Normal file
@@ -0,0 +1,7 @@
|
||||
html
|
||||
head
|
||||
block head
|
||||
script(src='/vendor/jquery.js')
|
||||
script(src='/vendor/caustic.js')
|
||||
body
|
||||
block content
|
||||
10
src/examples/demo/views/layout.pug
Normal file
10
src/examples/demo/views/layout.pug
Normal 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
|
||||
5
src/examples/demo/views/mixins/buttons.pug
Normal file
5
src/examples/demo/views/mixins/buttons.pug
Normal 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
|
||||
11
src/examples/demo/views/mixins/cards.pug
Normal file
11
src/examples/demo/views/mixins/cards.pug
Normal 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
|
||||
15
src/examples/demo/views/page-a.pug
Normal file
15
src/examples/demo/views/page-a.pug
Normal 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
|
||||
5
src/examples/demo/views/page-appen-optional-blk.pug
Normal file
5
src/examples/demo/views/page-appen-optional-blk.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
extends layout
|
||||
|
||||
append head
|
||||
script(src='/vendor/three.js')
|
||||
script(src='/game.js')
|
||||
11
src/examples/demo/views/page-append.pug
Normal file
11
src/examples/demo/views/page-append.pug
Normal 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
|
||||
9
src/examples/demo/views/page-b.pug
Normal file
9
src/examples/demo/views/page-b.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
extends sub-layout.pug
|
||||
|
||||
block content
|
||||
.sidebar
|
||||
block sidebar
|
||||
p nothing
|
||||
.primary
|
||||
block primary
|
||||
p nothing
|
||||
1
src/examples/demo/views/pet.pug
Normal file
1
src/examples/demo/views/pet.pug
Normal file
@@ -0,0 +1 @@
|
||||
p= petName
|
||||
9
src/examples/demo/views/sub-layout.pug
Normal file
9
src/examples/demo/views/sub-layout.pug
Normal file
@@ -0,0 +1,9 @@
|
||||
extends layout.pug
|
||||
|
||||
block content
|
||||
.sidebar
|
||||
block sidebar
|
||||
p nothing
|
||||
.primary
|
||||
block primary
|
||||
p nothing
|
||||
Reference in New Issue
Block a user