public override void PostWalk(RelativeModuleName node) { PostWalkWorker(node); }
// relative_module: "."* module | "."+ private ModuleName ParseRelativeModuleName() { var start = GetStart(); bool isStartSetCorrectly = false; int dotCount = 0; List<string> dotWhiteSpace = MakeWhiteSpaceList(); for (; ; ) { if (MaybeEat(TokenKind.Dot)) { if (dotWhiteSpace != null) { dotWhiteSpace.Add(_tokenWhiteSpace); } dotCount++; } else if (MaybeEat(TokenKind.Ellipsis)) { if (dotWhiteSpace != null) { dotWhiteSpace.Add(_tokenWhiteSpace); dotWhiteSpace.Add(""); dotWhiteSpace.Add(""); } dotCount += 3; } else { break; } if (!isStartSetCorrectly) { start = GetStart(); isStartSetCorrectly = true; } } List<string> nameWhiteSpace = null; NameExpression[] names = EmptyNames; if (PeekToken() is NameToken) { names = ReadDottedName(out nameWhiteSpace); if (!isStartSetCorrectly && names.Length > 0) { start = names[0].StartIndex; isStartSetCorrectly = true; } } ModuleName ret; if (dotCount > 0) { ret = new RelativeModuleName(names, dotCount); if (_verbatim) { if (nameWhiteSpace != null) { AddNamesWhiteSpace(ret, nameWhiteSpace.ToArray()); } AddListWhiteSpace(ret, dotWhiteSpace.ToArray()); } } else { if (names.Length == 0) { ReportSyntaxError(_lookahead.Span.Start, _lookahead.Span.End, "missing module name"); } ret = new ModuleName(names); if (nameWhiteSpace != null) { AddNamesWhiteSpace(ret, nameWhiteSpace.ToArray()); } } ret.SetLoc(start, GetEnd()); return ret; }
// RelativeModuleName public override bool Walk(RelativeModuleName node) { return ShouldWalkWorker(node); }