@@ -101,11 +101,11 @@ public ELSyntax(List<string> fields, List<string> extraFuncs)
101
101
// HTML tags: <tagName args> and <//tagName>
102
102
reHTML = new Regex ( $@ "\<(?://)?(?:font|img|b|u|i)\b.*?\>", RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled ) ;
103
103
104
- // literal blocks: /# literal text #/
105
- reLiteral = new Regex ( @"/#.*?#/" , RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled ) ;
104
+ // literal blocks: /#literaltext#/ or /*literaltext/*
105
+ reLiteral = new Regex ( @"/#.*?#/|/\*.*?/\* " , RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled ) ;
106
106
107
107
// escaped: chars escaped with fwd-slash, or anything between /* and /*
108
- reEscaped = new Regex ( @"(/\*.*?/\*)|(? <=[^#])((?:/\r\n|/\D)+)" , RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled ) ;
108
+ reEscaped = new Regex ( @"(? <=[^#])((?:/\r? \n|/\D)+)" , RegexOptions . IgnoreCase | RegexOptions . Singleline | RegexOptions . Compiled ) ;
109
109
110
110
// comment: special fields named '/' -> "[//, this is a comment]"
111
111
reComment = new Regex ( @"\[//+,.*?\]|^##.*$" , RegexOptions . IgnoreCase | RegexOptions . Multiline | RegexOptions . Compiled ) ;
@@ -177,10 +177,7 @@ public List<ELToken> getTokens(string expression, bool doComments = true)
177
177
// escaped blocks/chars: /* text /*, // /x
178
178
hits = reEscaped . Matches ( expression ) ;
179
179
foreach ( Match m in hits )
180
- if ( ! string . IsNullOrEmpty ( m . Groups [ 1 ] . Value ) )
181
- tokens . Add ( new ELToken ( ELTokenType . Escaped , m . Groups [ 1 ] . Value , m . Groups [ 1 ] . Index ) ) ;
182
- else
183
- tokens . Add ( new ELToken ( ELTokenType . Escaped , m . Groups [ 2 ] . Value , m . Groups [ 2 ] . Index ) ) ;
180
+ tokens . Add ( new ELToken ( ELTokenType . Escaped , m . Groups [ 1 ] . Value , m . Groups [ 1 ] . Index ) ) ;
184
181
185
182
// HTML
186
183
hits = reHTML . Matches ( expression ) ;
0 commit comments