public ParseContext(ParseContext parent, Parser parser) : this(parent.Input, -1) { Parent = parent; Parser = parser; WhitespacePolicy = parent.WhitespacePolicy; var wsRule = parser as WhitespaceRuleParser; if (wsRule != null) { _whitespaceParsers = new HashSet<Parser>(parent._whitespaceParsers ?? Enumerable.Empty<Parser>()) { wsRule.WhitespaceParser }; } else { _whitespaceParsers = parent._whitespaceParsers; } var policy = parser as WhitespacePolicyParser; if (policy != null) WhitespacePolicy = policy.Policy; InitialOffset = Offset = parent.WhitespacePolicy == WhitespacePolicy.Ignore ? SkipWhitespace(parent.Input, parent.Offset) : parent.Offset; }
public ParseContext(String input, int offset) { Input = input; InitialOffset = Offset = offset; WhitespacePolicy = WhitespacePolicy.Match; _whitespaceParsers = null; }
public ParseContext(ParseContext parent, Parser parser) : this(parent.Input, -1) { Parent = parent; Parser = parser; WhitespacePolicy = parent.WhitespacePolicy; var wsRule = parser as WhitespaceRuleParser; if (wsRule != null) { _whitespaceParsers = new HashSet <Parser>(parent._whitespaceParsers ?? Enumerable.Empty <Parser>()) { wsRule.WhitespaceParser }; } else { _whitespaceParsers = parent._whitespaceParsers; } var policy = parser as WhitespacePolicyParser; if (policy != null) { WhitespacePolicy = policy.Policy; } InitialOffset = Offset = parent.WhitespacePolicy == WhitespacePolicy.Ignore ? SkipWhitespace(parent.Input, parent.Offset) : parent.Offset; }
public ParseContext(ParseContext parent, Parser parser) : this(parent.Input, parent.WhitespacePolicy == WhitespacePolicy.Ignore ? SkipWhitespace(parent.Input, parent.Offset) : parent.Offset) { Parent = parent; Parser = parser; WhitespacePolicy = parent.WhitespacePolicy; var policy = parser as WhitespacePolicyParser; if (policy != null) WhitespacePolicy = policy.Policy; }
public ParseContext(ParseContext parent, Parser parser) : this(parent.Input, parent.WhitespacePolicy == WhitespacePolicy.Ignore ? SkipWhitespace(parent.Input, parent.Offset) : parent.Offset) { Parent = parent; Parser = parser; WhitespacePolicy = parent.WhitespacePolicy; var policy = parser as WhitespacePolicyParser; if (policy != null) { WhitespacePolicy = policy.Policy; } }
internal WhitespacePolicyParser(Parser inner, WhitespacePolicy policy) : base(inner, true) { Policy = policy; }