Skip to content

Commit 9c43dc9

Browse files
committed
Force every indentation around a command to be using #ln.
After this change, Any sequence of `\t` before any command will be trimmed! And any sequence of `\n` before or after any command will be trimmed!
1 parent b07c79a commit 9c43dc9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/org/jamplate/parser/ScopeParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class ScopeParser implements PollParser<Scope> {
4848
*
4949
* @since 0.0.3 ~2020.09.21
5050
*/
51-
protected static final Pattern COMMON_PARAMETERS_INTEGER = Pattern.compile("^\\s*(?<LOGIC>\\d*)\\s*$");
51+
protected static final Pattern COMMON_PARAMETERS_INTEGER = Pattern.compile("^\\s*(?<LOGIC>[-]?\\d*)\\s*$");
5252
/**
5353
* Common pattern to extract single logic parameter.
5454
*
@@ -79,7 +79,7 @@ public class ScopeParser implements PollParser<Scope> {
7979
*
8080
* @since 0.0.1 ~2020.09.20
8181
*/
82-
protected static final Pattern PATTERN_COMMANDS = Pattern.compile("\\n?(?:(?<!\\\\)#)(?:(?:[^#\\n])|(?:(?<=\\\\)[#\\n]))*(?:(?:(?<!\\\\)[#\\n])|$)");
82+
protected static final Pattern PATTERN_COMMANDS = Pattern.compile("\\n*\\t*(?:(?<!\\\\)#)(?:(?:[^#\\n])|(?:(?<=\\\\)[#\\n]))*(?:(?:(?<!\\\\)(#|(\\n*)))|$)");
8383

8484
/**
8585
* A pattern to be used to detected {@link Define} commands.

0 commit comments

Comments
 (0)