public override void ExitOnErrorStmt([NotNull] VBAParser.OnErrorStmtContext context) { if (context.ON_LOCAL_ERROR() != null) { _contexts.Add(new QualifiedContext <ParserRuleContext>(CurrentModuleName, context)); } }
public void Resolve(VBAParser.OnErrorStmtContext context) { if (context.expression() == null) { return; } ResolveLabel(context.expression(), context.expression().GetText()); }
public override void ExitOnErrorStmt(VBAParser.OnErrorStmtContext context) { if (context.RESUME() != null) { _unhandledContexts.Add(new QualifiedContext <ParserRuleContext>(CurrentModuleName, context)); } else if (context.GOTO() != null) { _unhandledContexts.Clear(); } }
private static bool IsBranchingOnErrorGoToLabel(VBAParser.OnErrorStmtContext errorStmtCtxt) { var label = errorStmtCtxt.expression()?.GetText(); if (string.IsNullOrEmpty(label)) { return(false); } //The VBE will complain about labels other than: //1. Numerics less than int.MaxValue (VBA: 'Long' max value). '0' returns false because it cause a branch //2. Or, Any alphanumeric string beginning with a letter (VBE or the Debugger will choke on special characters, spaces, etc). return(!(int.TryParse(label, out var numberLabel) && numberLabel <= 0)); }
public override void EnterOnErrorStmt(VBAParser.OnErrorStmtContext context) { CheckContext(context, context.expression()); base.EnterOnErrorStmt(context); }
public override void EnterOnErrorStmt(VBAParser.OnErrorStmtContext context) { _resolver.Resolve(context); }
public override void EnterOnErrorStmt(VBAParser.OnErrorStmtContext context) { CheckContext(context, context.ON_ERROR()); CheckContext(context, context.ON_LOCAL_ERROR()); base.EnterOnErrorStmt(context); }