break;
case TokenNameVariable :
case TokenNameDOLLAR_LBRACE :
- case TokenNameCURLY_OPEN :
+ case TokenNameLBRACE_DOLLAR :
encaps_var();
break;
- // case TokenNameDOLLAR :
- // getNextToken();
- // if (token == TokenNameLBRACE) {
- // token = TokenNameDOLLAR_LBRACE;
- // encaps_var();
- // }
- // break;
default :
char encapsedChar = ((Character) scanner.encapsedStringStack.peek()).charValue();
if (encapsedChar == '$') {
break;
case TokenNameDOLLAR_LBRACE :
getNextToken();
- if (token == TokenNameIdentifier) {
+ if (token == TokenNameDOLLAR_LBRACE) {
+ encaps_var();
+ } else if (token == TokenNameIdentifier) {
getNextToken();
if (token == TokenNameLBRACKET) {
getNextToken();
getNextToken();
// }
}
- if (token != TokenNameRBRACE) {
- throwSyntaxError("'}' expected after '${'.");
- }
- // scanner.encapsedStringStack.pop();
- getNextToken();
} else {
expr();
- if (token != TokenNameRBRACE) {
- throwSyntaxError("'}' expected.");
- }
- // scanner.encapsedStringStack.pop();
- getNextToken();
}
+ if (token != TokenNameRBRACE) {
+ throwSyntaxError("'}' expected.");
+ }
+ getNextToken();
break;
- case TokenNameCURLY_OPEN :
+ case TokenNameLBRACE_DOLLAR :
getNextToken();
- if (token == TokenNameIdentifier || token > TokenNameKEYWORD) {
+ if (token == TokenNameLBRACE_DOLLAR) {
+ encaps_var();
+ } else if (token == TokenNameIdentifier || token > TokenNameKEYWORD) {
getNextToken();
if (token == TokenNameLBRACKET) {
getNextToken();
// } else {
expr();
if (token != TokenNameRBRACKET) {
- throwSyntaxError("']' expected after '{$'.");
+ throwSyntaxError("']' expected.");
}
getNextToken();
// }
throwSyntaxError("String or Variable token expected.");
}
getNextToken();
+ if (token == TokenNameLBRACKET) {
+ getNextToken();
+ // if (token == TokenNameRBRACKET) {
+ // getNextToken();
+ // } else {
+ expr();
+ if (token != TokenNameRBRACKET) {
+ throwSyntaxError("']' expected after '${'.");
+ }
+ getNextToken();
+ // }
+ }
}
// if (token != TokenNameRBRACE) {
// throwSyntaxError("'}' expected after '{$'.");