Skip to content

Commit

Permalink
Further fixes for $Variables without {} (closes #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinglozzer committed Mar 19, 2021
1 parent 5560083 commit e234f97
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 156 deletions.
10 changes: 2 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Changelog

## [Unreleased]
### Added

### Changed

### Deprecated

### Removed

### Fixed
- Further issues with how $Variables without {} braces were handled

## [0.2.2]
### Fixed
- Regression in how $Variables without {} braces were handled
Expand Down
279 changes: 139 additions & 140 deletions src/main/gen/com/kinglozzer/silverstripe/parser/_SilverstripeLexer.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ SS_TEXT= (([^<${\\]+) | (\\.) | (<[^%]) | (\$[^A-Za-z_]) | (\{[^\$]) | (\{\$[^A-

<SS_INJECTION> {
{SS_LOOKUP} { yypushstate(SS_LOOKUP); return SilverstripeTokenTypes.SS_LOOKUP; }
"$" { return SilverstripeTokenTypes.SS_TEXT; }
"{" { return SilverstripeTokenTypes.SS_LEFT_BRACE; }
"}" { yycleanstates(); return SilverstripeTokenTypes.SS_RIGHT_BRACE; }
{WHITE_SPACE}+ { yycleanstates(); return TokenType.WHITE_SPACE; }
. { yycleanstates(); return SilverstripeTokenTypes.SS_TEXT; }
. { yypushback(yylength()); yycleanstates(); return SilverstripeTokenTypes.SS_TEXT; }
}

<SS_LOOKUP> {
Expand Down
4 changes: 1 addition & 3 deletions src/test/testData/parser/Issue11.ss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<% if $ElementControllers %>
<% loop $ElementControllers %>
$Me
<% end_loop %>
<% loop $ElementControllers %>$Me<% end_loop %>
<% end_if %>
3 changes: 0 additions & 3 deletions src/test/testData/parser/Issue11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ FILE
PsiElement([Ss] SS_LOOKUP)('$ElementControllers')
PsiWhiteSpace(' ')
PsiElement(SS_BLOCK_END)('%>')
PsiWhiteSpace('\n ')
SilverstripePsiElementImpl([Ss] SS_STATEMENTS)
SilverstripePsiElementImpl([Ss] SS_LOOKUP)
SilverstripeLookupStepImpl([Ss] SS_LOOKUP_STEP)
PsiElement([Ss] SS_LOOKUP)('$Me')
PsiWhiteSpace('\n')
PsiWhiteSpace(' ')
SilverstripePsiElementImpl([Ss] SS_BLOCK_END_STATEMENT)
PsiElement(SS_BLOCK_START)('<%')
PsiWhiteSpace(' ')
Expand Down

0 comments on commit e234f97

Please sign in to comment.