Mercurial > hg > tema
changeset 29:2c6edd9cf677
Effective escaped newline matching.
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Thu, 14 May 2009 18:55:32 +0400 |
parents | fedd0147cb6f |
children | 54539dff18ca |
files | src/kryshen/tema/TemplateParser.java |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/kryshen/tema/TemplateParser.java Thu May 14 18:17:54 2009 +0400 +++ b/src/kryshen/tema/TemplateParser.java Thu May 14 18:55:32 2009 +0400 @@ -38,6 +38,11 @@ public static final String ESCAPE_NEWLINE = "\\"; public static final String ESCAPE_WHITESPACE = "\\\\"; + + private static final String[] ESCAPE_NEWLINE_COMBINED = { + ESCAPE_NEWLINE + "\r\n", + ESCAPE_NEWLINE + "\r", + ESCAPE_NEWLINE + "\n"}; /* Separators. */ public static final char[] INVOKE_DATA_SEPARATORS = {':'}; @@ -322,11 +327,7 @@ return; } - matchInput(in, - new String[] { - ESCAPE_NEWLINE + "\r\n", - ESCAPE_NEWLINE + "\r", - ESCAPE_NEWLINE + "\n"}); + matchInput(in, ESCAPE_NEWLINE_COMBINED); } boolean isSeparator(int c, char[] separators) {