Skip to content

Commit 16d4d46

Browse files
authored
Merge pull request #154 from sempare/dev
Release 1.7.2
2 parents 3481d93 + 7e91653 commit 16d4d46

34 files changed

+1633
-232
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ type
6969
end;
7070
begin
7171
var tpl := Template.Parse(
72-
'My name is <% name %>.'#13#10 +
73-
'My favourite sport is <% favourite_sport %>.'#13#10 +
74-
'Counting... <% for i := 1 to count %><% i %><% betweenitems %>, <% end %>'
75-
);
72+
'My name is <% name %>.'#13#10 +
73+
'My favourite sport is <% favourite_sport %>.'#13#10 +
74+
'Counting... <% for i := 1 to count %><% i %><% betweenitems %>, <% end %>' +
75+
'Counting... <% for i := 1 to count ; print(i) ; betweenitems ; print(', '); onbegin; print('[ '); onend; print('] '); end %>'
76+
);
7677
var info : TInformation;
7778
info.name := 'conrad';
7879
info.favourite_sport := 'ultimate';

Sempare.Template.Tester.dpr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ uses
5858
Sempare.Template.Test in 'tests\Sempare.Template.Test.pas',
5959
Sempare.Template.TestStackFrame in 'tests\Sempare.Template.TestStackFrame.pas',
6060
Sempare.Template.TestLexer in 'tests\Sempare.Template.TestLexer.pas',
61-
Sempare.Template.TestFunctions in 'tests\Sempare.Template.TestFunctions.pas';
61+
Sempare.Template.TestFunctions in 'tests\Sempare.Template.TestFunctions.pas',
62+
Sempare.Template.TestVirtualMethods in 'tests\Sempare.Template.TestVirtualMethods.pas',
63+
Sempare.Template.TestMap in 'tests\Sempare.Template.TestMap.pas';
6264

6365
var
6466
runner: ITestRunner;

Sempare.Template.Tester.dproj

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
<DCCReference Include="tests\Sempare.Template.TestStackFrame.pas"/>
9393
<DCCReference Include="tests\Sempare.Template.TestLexer.pas"/>
9494
<DCCReference Include="tests\Sempare.Template.TestFunctions.pas"/>
95+
<DCCReference Include="tests\Sempare.Template.TestVirtualMethods.pas"/>
96+
<DCCReference Include="tests\Sempare.Template.TestMap.pas"/>
9597
<BuildConfiguration Include="Base">
9698
<Key>Base</Key>
9799
</BuildConfiguration>
@@ -182,20 +184,16 @@
182184
</DeployClass>
183185
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
184186
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
185-
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
186187
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
187-
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
188-
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
188+
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
189189
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
190-
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
191-
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
192-
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
193-
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
194190
</Deployment>
195191
<Platforms>
196192
<Platform value="Android">False</Platform>
197193
<Platform value="Android64">False</Platform>
198194
<Platform value="iOSDevice64">False</Platform>
195+
<Platform value="iOSSimARM64">False</Platform>
196+
<Platform value="Linux64">False</Platform>
199197
<Platform value="OSX64">False</Platform>
200198
<Platform value="OSXARM64">False</Platform>
201199
<Platform value="Win32">True</Platform>

boss.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Sempare Template Engine",
33
"description": "Sempare Template Engine for Delphi allows for flexible text manipulation. It can be used for generating email, html, source code, xml, configuration, etc.",
4-
"version": "1.7.1",
4+
"version": "1.7.2",
55
"homepage": "https://github.com/sempare/sempare-delphi-template-engine",
66
"mainsrc": "./src/",
77
"projects": [],

demo/SempareTemplatePlayground/Sempare.Template.PlaygroundForm.dfm

Lines changed: 110 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
22
Left = 0
33
Top = 0
44
Caption = 'Sempare Template Engine Playground'
5-
ClientHeight = 487
6-
ClientWidth = 1176
5+
ClientHeight = 505
6+
ClientWidth = 1190
77
Color = clBtnFace
8+
Constraints.MinHeight = 500
9+
Constraints.MinWidth = 1050
810
Font.Charset = DEFAULT_CHARSET
911
Font.Color = clWindowText
1012
Font.Height = -11
1113
Font.Name = 'Tahoma'
1214
Font.Style = []
1315
OnCreate = FormCreate
14-
OnResize = FormResize
1516
DesignSize = (
16-
1176
17-
487)
17+
1190
18+
505)
1819
TextHeight = 13
1920
object Image1: TImage
2021
Left = 24
@@ -301,17 +302,17 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
301302
object Panel1: TPanel
302303
Left = 18
303304
Top = 224
304-
Width = 1136
305-
Height = 255
305+
Width = 1150
306+
Height = 273
306307
Anchors = [akLeft, akTop, akRight, akBottom]
307308
Caption = 'Panel1'
308309
TabOrder = 4
309-
ExplicitWidth = 1132
310-
ExplicitHeight = 254
310+
ExplicitWidth = 1144
311+
ExplicitHeight = 267
311312
object Splitter1: TSplitter
312313
Left = 465
313314
Top = 1
314-
Height = 253
315+
Height = 271
315316
ExplicitLeft = 504
316317
ExplicitTop = 48
317318
ExplicitHeight = 100
@@ -320,60 +321,90 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
320321
Left = 1
321322
Top = 1
322323
Width = 464
323-
Height = 253
324+
Height = 271
324325
ActivePage = tsTemplate
325326
Align = alLeft
326327
TabOrder = 0
327-
ExplicitHeight = 252
328+
ExplicitHeight = 265
328329
object tsTemplate: TTabSheet
329330
Caption = 'Template'
330331
object Panel2: TPanel
331332
Left = 0
332333
Top = 0
333334
Width = 456
334-
Height = 225
335+
Height = 243
335336
Align = alClient
336337
BevelOuter = bvNone
337338
Caption = 'Panel2'
338339
TabOrder = 0
339-
ExplicitHeight = 224
340+
ExplicitHeight = 237
340341
object memoTemplate: TMemo
341342
Left = 0
342-
Top = 17
343+
Top = 23
343344
Width = 456
344-
Height = 208
345+
Height = 220
345346
Align = alClient
346347
ScrollBars = ssBoth
347348
TabOrder = 0
348349
WantTabs = True
349350
OnChange = memoTemplateChange
350351
OnKeyUp = memoTemplateKeyUp
351352
OnMouseDown = memoTemplateMouseDown
352-
ExplicitHeight = 207
353+
ExplicitHeight = 214
353354
end
354355
object Panel3: TPanel
355356
Left = 0
356357
Top = 0
357358
Width = 456
358-
Height = 17
359+
Height = 23
359360
Align = alTop
360361
Caption = 'Panel3'
361362
ShowCaption = False
362363
TabOrder = 1
363364
object lblPosition: TLabel
364365
AlignWithMargins = True
365-
Left = 4
366+
Left = 232
366367
Top = 4
367-
Width = 448
368-
Height = 17
369-
Align = alTop
368+
Width = 220
369+
Height = 15
370+
Align = alRight
370371
Alignment = taRightJustify
371372
AutoSize = False
372373
Caption = '(Line: 1, Position: 1)'
373-
Transparent = False
374-
ExplicitLeft = 0
375-
ExplicitTop = 0
376-
ExplicitWidth = 456
374+
Color = 6908265
375+
Font.Charset = DEFAULT_CHARSET
376+
Font.Color = clWhite
377+
Font.Height = -11
378+
Font.Name = 'Tahoma'
379+
Font.Style = []
380+
ParentColor = False
381+
ParentFont = False
382+
Transparent = True
383+
ExplicitTop = 1
384+
ExplicitHeight = 9
385+
end
386+
object lblTiming: TLabel
387+
AlignWithMargins = True
388+
Left = 4
389+
Top = 4
390+
Width = 225
391+
Height = 15
392+
Align = alLeft
393+
AutoSize = False
394+
Caption = 'lblTiming'
395+
Color = 6908265
396+
Enabled = False
397+
Font.Charset = DEFAULT_CHARSET
398+
Font.Color = clWhite
399+
Font.Height = -11
400+
Font.Name = 'Tahoma'
401+
Font.Style = []
402+
ParentColor = False
403+
ParentFont = False
404+
Transparent = True
405+
ExplicitLeft = 3
406+
ExplicitTop = 1
407+
ExplicitHeight = 21
377408
end
378409
end
379410
end
@@ -385,7 +416,7 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
385416
Left = 0
386417
Top = 0
387418
Width = 456
388-
Height = 225
419+
Height = 243
389420
Align = alClient
390421
Lines.Strings = (
391422
'memoPrettyPrint')
@@ -398,20 +429,20 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
398429
object pcOutput: TPageControl
399430
Left = 468
400431
Top = 1
401-
Width = 667
402-
Height = 253
403-
ActivePage = tsWebBrowser
432+
Width = 681
433+
Height = 271
434+
ActivePage = tsGithubHelp
404435
Align = alClient
405436
TabOrder = 1
406-
ExplicitWidth = 663
407-
ExplicitHeight = 252
437+
ExplicitWidth = 675
438+
ExplicitHeight = 265
408439
object tsOutput: TTabSheet
409440
Caption = 'Output'
410441
object memoOutput: TMemo
411442
Left = 0
412443
Top = 0
413-
Width = 659
414-
Height = 225
444+
Width = 673
445+
Height = 243
415446
Align = alClient
416447
Lines.Strings = (
417448
'Memo1')
@@ -426,14 +457,36 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
426457
object WebBrowser1: TWebBrowser
427458
Left = 0
428459
Top = 0
429-
Width = 659
430-
Height = 225
460+
Width = 673
461+
Height = 243
431462
Align = alClient
432463
TabOrder = 0
433464
ExplicitWidth = 655
434465
ExplicitHeight = 224
435466
ControlData = {
436-
4C0000001C440000411700000000000000000000000000000000000000000000
467+
4C0000008E4500001D1900000000000000000000000000000000000000000000
468+
000000004C000000000000000000000001000000E0D057007335CF11AE690800
469+
2B2E126208000000000000004C0000000114020000000000C000000000000046
470+
8000000000000000000000000000000000000000000000000000000000000000
471+
00000000000000000100000000000000000000000000000000000000}
472+
end
473+
end
474+
object tsGithubHelp: TTabSheet
475+
Caption = 'Github Help'
476+
Enabled = False
477+
ImageIndex = 2
478+
object wbHelp: TWebBrowser
479+
Left = 0
480+
Top = 0
481+
Width = 673
482+
Height = 243
483+
Align = alClient
484+
TabOrder = 0
485+
SelectedEngine = EdgeOnly
486+
ExplicitWidth = 667
487+
ExplicitHeight = 237
488+
ControlData = {
489+
4C0000008E4500001D1900000000000000000000000000000000000000000000
437490
000000004C000000000000000000000001000000E0D057007335CF11AE690800
438491
2B2E126208000000000000004C0000000114020000000000C000000000000046
439492
8000000000000000000000000000000000000000000000000000000000000000
@@ -445,12 +498,12 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
445498
object gbOptions: TGroupBox
446499
Left = 483
447500
Top = 49
448-
Width = 670
449-
Height = 145
501+
Width = 684
502+
Height = 139
450503
Anchors = [akLeft, akTop, akRight]
451504
Caption = 'Context Options'
452505
TabOrder = 5
453-
ExplicitWidth = 666
506+
ExplicitWidth = 678
454507
object cbConvertTabsToSpaces: TCheckBox
455508
Left = 18
456509
Top = 23
@@ -585,7 +638,7 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
585638
object cbOptimiseTemplate: TCheckBox
586639
Left = 384
587640
Top = 92
588-
Width = 159
641+
Width = 113
589642
Height = 17
590643
Caption = 'Optimise Template'
591644
TabOrder = 13
@@ -603,7 +656,7 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
603656
object cbFlattenTemplate: TCheckBox
604657
Left = 384
605658
Top = 69
606-
Width = 153
659+
Width = 113
607660
Height = 17
608661
Caption = 'Flatten Template'
609662
TabOrder = 15
@@ -612,7 +665,7 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
612665
object cbShowWhitespace: TCheckBox
613666
Left = 384
614667
Top = 115
615-
Width = 159
668+
Width = 113
616669
Height = 17
617670
Caption = 'Show Whitespace'
618671
TabOrder = 16
@@ -640,17 +693,30 @@ object FormTemplateEnginePlayground: TFormTemplateEnginePlayground
640693
TabOrder = 0
641694
OnGetEditText = propertiesGetEditText
642695
OnSetEditText = propertiesSetEditText
696+
ColWidths = (
697+
150
698+
282)
643699
end
644700
end
645701
object butEval: TButton
646-
Left = 389
702+
Left = 384
647703
Top = 194
648704
Width = 75
649705
Height = 25
650706
Caption = '&Evaluate'
651707
TabOrder = 7
652708
OnClick = butEvalClick
653709
end
710+
object butExtractVars: TButton
711+
Left = 483
712+
Top = 194
713+
Width = 94
714+
Height = 25
715+
Caption = 'E&xtract Variables'
716+
DisabledImageName = 'butExtractVars'
717+
TabOrder = 8
718+
OnClick = butExtractVarsClick
719+
end
654720
object OpenDialog1: TOpenDialog
655721
Left = 744
656722
Top = 160

0 commit comments

Comments
 (0)