Skip to content

Commit

Permalink
Merge pull request #121 from sempare/dev
Browse files Browse the repository at this point in the history
v1.6.2 release
  • Loading branch information
Sempare Limited authored Mar 28, 2023
2 parents 591a27d + a1c8f55 commit 8c53317
Show file tree
Hide file tree
Showing 28 changed files with 4,013 additions and 20 deletions.
2 changes: 1 addition & 1 deletion boss.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sempare Template Engine",
"description": "Sempare Template Engine for Delphi allows for flexible text manipulation. It can be used for generating email, html, source code, xml, configuration, etc.",
"version": "1.6.0",
"version": "1.6.2",
"homepage": "https://github.com/sempare/sempare-delphi-template-engine",
"mainsrc": "./src/",
"projects": [],
Expand Down
29 changes: 29 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Copyright (c) 2019-2023 [Sempare Limited](http://www.sempare.ltd)
- [Dynamic Template Resolution](#Dynamic_Template_Resolution)
- [Ignoring Whitespace With Multi-Line Statements](#Ignoring_Whitespace_With_Multi_Line_Statements)
- [Options](#Options)
- [Decimal Separators](#Decimal_Separators)
- [Value Separators](#Value_Separators)

# Overview

Expand Down Expand Up @@ -159,3 +161,30 @@ The template engine allows for the following options:
- strip any empty lines
- eoPrettyPrint
- use to review the parsed structure. output is to the console.

### Decimal Separators

Numbers are commonly formatted using comma and decimal point. e.g. 123.45

However, in some regions, such as Germany, it the coma may be preferred. e.g. 123,45

In order to accomodate this, the context configuration has a DecimalSeparator. These default based on locale.

The DecimalSeparator may be set to '.' or ','.

### Value Separators

The ValueSeparator may be set to ',' or ';'. It must be explicity set.

The motivation for the behaviour is to avoid any confusion with decimal separators.
```
<% Add(1.23 , 4.56) %>
```
When the DecimalSeparator is ',', then the ValueSeparator becomes ';' as illustrated:
```
<% Add(1,23 ; 4,56) %>
```
However, the following does work:
```
<% Add(1,23 , 4,56) %>
```
8 changes: 8 additions & 0 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ writeln(Template.PrettyPrint(Template.Parse('<%if true%>true<%else%>false<%end%>
```

Use the _eoPrettyPrint_ option on the _context_ to enable when evaluating or parsing a template.

## Strange parser errors

Parser errors could come from one of two locations:
- the lexer - the code that breaks the stream into tokens
- the parser - the code that validates that the tokens are in the correct order according to the gramatical rules


100 changes: 100 additions & 0 deletions docs/images/stmt_assign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added docs/images/stmt_block.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
148 changes: 148 additions & 0 deletions docs/images/stmt_cycle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8c53317

Please sign in to comment.