mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-23 03:19:06 +00:00
Add new affectation
This commit is contained in:
parent
82c57e1b54
commit
266e8b6497
@ -51,12 +51,23 @@ public class EaterAffectation extends Eater {
|
||||
String varname = eatAndGetVarname();
|
||||
TVariableScope scope = null;
|
||||
skipSpaces();
|
||||
boolean conditional = false;
|
||||
if (peekChar() == '?') {
|
||||
checkAndEatChar('?');
|
||||
conditional = true;
|
||||
}
|
||||
if (peekChar() != '=') {
|
||||
scope = TVariableScope.valueOf(varname.toUpperCase());
|
||||
varname = eatAndGetVarname();
|
||||
skipSpaces();
|
||||
}
|
||||
checkAndEatChar('=');
|
||||
if (conditional) {
|
||||
final TValue already = memory.getVariable(varname);
|
||||
if (already != null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
skipSpaces();
|
||||
final TValue value = eatExpression(context, memory);
|
||||
memory.putVariable(varname, value, scope);
|
||||
|
@ -62,7 +62,7 @@ public enum TLineType {
|
||||
if (s.matches("^\\s*!define\\s+[\\p{L}_][\\p{L}_0-9]*\\b.*")) {
|
||||
return AFFECTATION_DEFINE;
|
||||
}
|
||||
if (s.matches("^\\s*!\\s*(local|global)?\\s*\\$?[\\p{L}_][\\p{L}_0-9]*\\s*=.*")) {
|
||||
if (s.matches("^\\s*!\\s*(local|global)?\\s*\\$?[\\p{L}_][\\p{L}_0-9]*\\s*\\??=.*")) {
|
||||
return AFFECTATION;
|
||||
}
|
||||
if (s.matches("^\\s*'.*")) {
|
||||
|
@ -80,7 +80,7 @@ public class Version {
|
||||
}
|
||||
|
||||
public static int beta() {
|
||||
final int beta = 6;
|
||||
final int beta = 7;
|
||||
return beta;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user