public void Visit(JsRegExpLiteral node) { if (node != null) { node.Index = NextOrderIndex; } }
public void Visit(JsRegExpLiteral node) { // invalid! ignore IsValid = false; }
public void Visit(JsRegExpLiteral node) { // regexp literal, so we don't care }
public void Visit(JsRegExpLiteral node) { // not applicable; terminate }
public void Visit(JsRegExpLiteral node) { // we're good }
public void Visit(JsRegExpLiteral node) { if (node != null) { var symbol = StartSymbol(node); m_startOfStatement = false; // cannot have a line break anywhere in this node Output('/'); MarkSegment(node, null, node.Context); SetContextOutputPosition(node.Context); Output(node.Pattern); Output('/'); if (!string.IsNullOrEmpty(node.PatternSwitches)) { Output(node.PatternSwitches); } EndSymbol(symbol); } }
public override void Visit(JsRegExpLiteral node) { // same logic for most nodes TypicalHandler(node); }
public override void Visit(JsRegExpLiteral node) { if (node != null) { // verify the syntax try { // just try instantiating a Regex object with this string. // if it's invalid, it will throw an exception. // we don't need to pass the flags -- we're just interested in the pattern Regex re = new Regex(node.Pattern, RegexOptions.ECMAScript); // basically we have this test here so the re variable is referenced // and FxCop won't throw an error. There really aren't any cases where // the constructor will return null (other than out-of-memory) if (re == null) { node.Context.HandleError(JsError.RegExpSyntax, true); } } catch (System.ArgumentException e) { System.Diagnostics.Debug.WriteLine(e.ToString()); node.Context.HandleError(JsError.RegExpSyntax, true); } // don't bother calling the base -- there are no children } }