-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updgrade parser and make required changes
- Loading branch information
1 parent
a7c798c
commit d44fb46
Showing
55 changed files
with
381 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
out += template.renderWithState('components-isolated-state/alert', {}, { }) | ||
return out | ||
let out = ''; | ||
out += template.renderWithState('components-isolated-state/alert', {}, { }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-named-slots/alert', {}, { 'heading': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += ' This is title' | ||
return slot_0 | ||
} | ||
let slot_0 = ''; | ||
slot_0 += ' This is title'; | ||
return slot_0; | ||
}; | ||
})(template, ctx), 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_1 = '' | ||
slot_1 += '\n' | ||
slot_1 += ' This is then body' | ||
return slot_1 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_1 = ''; | ||
slot_1 += '\n'; | ||
slot_1 += ' This is then body'; | ||
return slot_1; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-partials/alert', { username: 'virk' }, { 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += ' Hello ' | ||
slot_0 += `${ctx.escape(ctx.resolve('username') || 'Guest')}` | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
slot_0 += ' Hello '; | ||
slot_0 += `${ctx.escape(ctx.resolve('username') || 'Guest')}`; | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-props/alert', { 'title': 'H1' }, { 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += 'Hello world' | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
slot_0 += 'Hello world'; | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-slot-props/alert', {}, { 'title': (function (template, ctx) { | ||
return function (user) { | ||
let slot_0 = '' | ||
ctx.newFrame() | ||
ctx.setOnFrame('user', user) | ||
slot_0 += ' Hello ' | ||
slot_0 += `${ctx.escape(ctx.resolve('user').username)}` | ||
ctx.removeFrame() | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
ctx.newFrame(); | ||
ctx.setOnFrame('user', user); | ||
slot_0 += ' Hello '; | ||
slot_0 += `${ctx.escape(ctx.resolve('user').username)}`; | ||
ctx.removeFrame(); | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-slots-partials/alert', {}, { 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += template.renderInline('components-slots-partials/partial')(template, ctx) | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
slot_0 += template.renderInline('components-slots-partials/partial')(template, ctx); | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components-state/alert', {}, { 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += ' Hello ' | ||
slot_0 += `${ctx.escape(ctx.resolve('username'))}` | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
slot_0 += ' Hello '; | ||
slot_0 += `${ctx.escape(ctx.resolve('username'))}`; | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
out += template.renderWithState('components/alert', {}, { 'main': (function (template, ctx) { | ||
return function () { | ||
let slot_0 = '' | ||
slot_0 += ' Hello world' | ||
return slot_0 | ||
} | ||
})(template, ctx) }) | ||
return out | ||
let slot_0 = ''; | ||
slot_0 += ' Hello world'; | ||
return slot_0; | ||
}; | ||
})(template, ctx) }); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
debugger; | ||
out += '' | ||
out += '\n' | ||
out += 'Hello' | ||
return out | ||
out += ''; | ||
out += '\n'; | ||
out += 'Hello'; | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
ctx.set('total', 0) | ||
let out = ''; | ||
ctx.set('total', 0); | ||
ctx.loop(ctx.resolve('items'), function (item, loop) { | ||
ctx.newFrame() | ||
ctx.setOnFrame('item', item) | ||
ctx.setOnFrame('$loop', loop) | ||
ctx.setOnFrame('key', loop.key) | ||
ctx.set('grossPrice', ctx.resolve('item').price * ctx.resolve('item').quantity) | ||
ctx.set('total', ctx.resolve('total') + ctx.resolve('grossPrice')) | ||
out += '' | ||
out += '\n' | ||
out += '- ' | ||
out += `${ctx.escape(ctx.resolve('item').name)}` | ||
out += ' x ' | ||
out += `${ctx.escape(ctx.resolve('item').quantity)}` | ||
out += ' = ' | ||
out += `${ctx.escape(ctx.resolve('grossPrice'))}` | ||
ctx.removeFrame() | ||
}) | ||
out += '\n' | ||
out += 'Total price = ' | ||
out += `${ctx.escape(ctx.resolve('total'))}` | ||
return out | ||
ctx.newFrame(); | ||
ctx.setOnFrame('item', item); | ||
ctx.setOnFrame('$loop', loop); | ||
ctx.setOnFrame('key', loop.key); | ||
ctx.set('grossPrice', ctx.resolve('item').price * ctx.resolve('item').quantity); | ||
ctx.set('total', ctx.resolve('total') + ctx.resolve('grossPrice')); | ||
out += ''; | ||
out += '\n'; | ||
out += '- '; | ||
out += `${ctx.escape(ctx.resolve('item').name)}`; | ||
out += ' x '; | ||
out += `${ctx.escape(ctx.resolve('item').quantity)}`; | ||
out += ' = '; | ||
out += `${ctx.escape(ctx.resolve('grossPrice'))}`; | ||
ctx.removeFrame(); | ||
}); | ||
out += '\n'; | ||
out += 'Total price = '; | ||
out += `${ctx.escape(ctx.resolve('total'))}`; | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
ctx.loop([{ | ||
username: 'virk' | ||
}], function (user, loop) { | ||
ctx.newFrame() | ||
ctx.setOnFrame('user', user) | ||
ctx.setOnFrame('$loop', loop) | ||
ctx.setOnFrame('key', loop.key) | ||
out += ' - Hello ' | ||
out += `${ctx.escape(ctx.resolve('user').username)}` | ||
ctx.removeFrame() | ||
}) | ||
return out | ||
ctx.newFrame(); | ||
ctx.setOnFrame('user', user); | ||
ctx.setOnFrame('$loop', loop); | ||
ctx.setOnFrame('key', loop.key); | ||
out += ' - Hello '; | ||
out += `${ctx.escape(ctx.resolve('user').username)}`; | ||
ctx.removeFrame(); | ||
}); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
if(ctx.size(ctx.resolve('users'))) { | ||
ctx.loop(ctx.resolve('users'), function (user, loop) { | ||
ctx.newFrame() | ||
ctx.setOnFrame('user', user) | ||
ctx.setOnFrame('$loop', loop) | ||
ctx.setOnFrame('key', loop.key) | ||
out += ' - Hello ' | ||
out += `${ctx.escape(ctx.resolve('user').username)}` | ||
out += '\n' | ||
ctx.removeFrame() | ||
}) | ||
ctx.newFrame(); | ||
ctx.setOnFrame('user', user); | ||
ctx.setOnFrame('$loop', loop); | ||
ctx.setOnFrame('key', loop.key); | ||
out += ' - Hello '; | ||
out += `${ctx.escape(ctx.resolve('user').username)}`; | ||
out += '\n'; | ||
ctx.removeFrame(); | ||
}); | ||
} else { | ||
out += ' No users found' | ||
out += ' No users found'; | ||
} | ||
return out | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
ctx.loop(ctx.resolve('users'), function (user, loop) { | ||
ctx.newFrame() | ||
ctx.setOnFrame('user', user) | ||
ctx.setOnFrame('$loop', loop) | ||
ctx.setOnFrame('index', loop.key) | ||
out += ' - Hello ' | ||
out += `${ctx.escape(ctx.resolve('user').username)}` | ||
ctx.removeFrame() | ||
}) | ||
return out | ||
ctx.newFrame(); | ||
ctx.setOnFrame('user', user); | ||
ctx.setOnFrame('$loop', loop); | ||
ctx.setOnFrame('index', loop.key); | ||
out += ' - Hello '; | ||
out += `${ctx.escape(ctx.resolve('user').username)}`; | ||
ctx.removeFrame(); | ||
}); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
ctx.loop(ctx.resolve('users'), function (user, loop) { | ||
ctx.newFrame() | ||
ctx.setOnFrame('user', user) | ||
ctx.setOnFrame('$loop', loop) | ||
ctx.setOnFrame('key', loop.key) | ||
out += ' - Hello ' | ||
out += `${ctx.escape(ctx.resolve('user').username)}` | ||
ctx.removeFrame() | ||
}) | ||
return out | ||
ctx.newFrame(); | ||
ctx.setOnFrame('user', user); | ||
ctx.setOnFrame('$loop', loop); | ||
ctx.setOnFrame('key', loop.key); | ||
out += ' - Hello '; | ||
out += `${ctx.escape(ctx.resolve('user').username)}`; | ||
ctx.removeFrame(); | ||
}); | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
if(ctx.resolve('username') === 'virk') { | ||
out += ' Hello VK' | ||
out += '\n' | ||
out += ' Hello VK'; | ||
out += '\n'; | ||
} else if(ctx.resolve('username')) { | ||
out += ' Hello ' | ||
out += `${ctx.escape(ctx.resolve('username'))}` | ||
out += '\n' | ||
out += ' Hello '; | ||
out += `${ctx.escape(ctx.resolve('username'))}`; | ||
out += '\n'; | ||
} else { | ||
out += ' Hello Guest!' | ||
out += ' Hello Guest!'; | ||
} | ||
return out | ||
return out; | ||
})(template, ctx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
(function (template, ctx) { | ||
let out = '' | ||
let out = ''; | ||
if(ctx.resolve('username')) { | ||
out += ' Hello ' | ||
out += `${ctx.escape(ctx.resolve('username'))}` | ||
out += '\n' | ||
out += ' Hello '; | ||
out += `${ctx.escape(ctx.resolve('username'))}`; | ||
out += '\n'; | ||
} else { | ||
out += ' Hello guest!' | ||
out += ' Hello guest!'; | ||
} | ||
return out | ||
return out; | ||
})(template, ctx) |
Oops, something went wrong.