parseVariable method
Implementation
VariableContext? parseVariable() {
if (next(TokenType.DOLLAR) && current != null) {
var DOLLAR = current!;
if (next(TokenType.NAME)) {
return VariableContext(DOLLAR, current!);
} else {
errors.add(SyntaxError(
'Missing name for variable; found a lone "\$" instead.',
DOLLAR.span));
return null;
}
} else {
return null;
}
}