public virtual Token Read() { var line = reader.ReadLine(); var location = new Ast.Location(++lineNumber); return(line == null ? new Token(null, location) : new Token(new GherkinLine(line, lineNumber), location)); }
protected ParserException(string message, Location location) : base(GetMessage(message, location)) { if (location == null) throw new ArgumentNullException("location"); Location = location; }
public Step(Location location, string keyword, string text, StepArgument argument) { Location = location; Keyword = keyword; Text = text; Argument = argument; }
private static string GetMessage(string message, Location location) { if (location == null) return message; return string.Format("({0}:{1}): {2}", location.Line, location.Column, message); }
public Background(Location location, string keyword, string name, string description, Step[] steps) { Location = location; Keyword = keyword; Name = name; Description = description; Steps = steps; }
public virtual GherkinDialect GetDialect(string language, Ast.Location location) { if (!TryGetDialect(language, location, out var dialect)) { throw new NoSuchLanguageException(language, location); } return(dialect); }
public NoSuchLanguageException(string language, Ast.Location location = null) : base("Language not supported: " + language, location) { if (language == null) { throw new ArgumentNullException("language"); } }
protected virtual GherkinDialect GetDialect(string language, Dictionary<string, GherkinLanguageSetting> gherkinLanguageSettings, Location location) { GherkinLanguageSetting languageSettings; if (!gherkinLanguageSettings.TryGetValue(language, out languageSettings)) throw new NoSuchLanguageException(language, location); return CreateGherkinDialect(language, languageSettings); }
protected ScenarioDefinition(Location location, string keyword, string name, string description, Step[] steps) { Location = location; Keyword = keyword; Name = name; Description = description; Steps = steps; }
public ReportStep(Location location, string keyword, string text, StepArgument argument, Parser.StepKeyword stepKeyword, Parser.ScenarioBlock scenarioBlock) { //Location = location; Keyword = keyword; Text = text; Argument = argument; ScenarioBlock = scenarioBlock; StepKeyword = stepKeyword; }
private static string GetMessage(string message, Ast.Location location) { if (location == null) { return(message); } return(string.Format("({0}:{1}): {2}", location.Line, location.Column, message)); }
public Feature(Tag[] tags, Location location, string language, string keyword, string name, string description, ScenarioDefinition[] children) { Tags = tags; Location = location; Language = language; Keyword = keyword; Name = name; Description = description; Children = children; }
public Examples(Tag[] tags, Location location, string keyword, string name, string description, TableRow header, TableRow[] body) { Tags = tags; Location = location; Keyword = keyword; Name = name; Description = description; TableHeader = header; TableBody = body; }
public void MapToLocation_RegularLocation_ReturnsLocation() { var mapper = this.factory.CreateMapper(); G.Location location = this.factory.CreateLocation(1, 2); Location result = mapper.MapToLocation(location); Check.That(result).IsNotNull(); Check.That(result.Line).IsEqualTo(1); Check.That(result.Column).IsEqualTo(2); }
public Feature(Tag[] tags, Location location, string language, string keyword, string name, string description, Background background, ScenarioDefinition[] scenarioDefinitions, Comment[] comments) { Tags = tags; Location = location; Language = language; Keyword = keyword; Name = name; Description = description; Background = background; ScenarioDefinitions = scenarioDefinitions; Comments = comments; }
public SpecFlowFeature(Tag[] tags, Location location, string language, string keyword, string name, string description, ScenarioDefinition[] children) : base(tags, location, language, keyword, name, description, children) { if (Children != null) { ScenarioDefinitions = Children.Where(child => !(child is Background)).ToList(); var background = Children.SingleOrDefault(child => child is Background); if (background != null) { Background = (Background)background; } } }
public InvalidTagException(string message, Ast.Location location = null) : base(message, location) { }
protected virtual TableCell CreateTableCell(Ast.Location location, string value) { return(new TableCell(location, value)); }
public ScenarioOutline(Tag[] tags, Location location, string keyword, string name, string description, Step[] steps, Examples[] examples) : base(location, keyword, name, description, steps) { Tags = tags; Examples = examples; }
protected virtual Feature CreateFeature(Tag[] tags, Ast.Location location, string language, string keyword, string name, string description, IHasLocation[] children, AstNode node) { return(new Feature(tags, location, language, keyword, name, description, children)); }
protected virtual Tag CreateTag(Ast.Location location, string name, AstNode node) { return(new Tag(location, name)); }
public override GherkinDialect GetDialect(string language, Location location) { string languageOnly = StripCulture(language); return base.GetDialect(languageOnly, location); }
protected virtual DocString CreateDocString(Ast.Location location, string contentType, string content, AstNode node) { return(new DocString(location, contentType, content)); }
public SemanticParserException(string message, Location location) : base(message, location) { }
public Tag(Location location, string name) { Name = name; Location = location; }
public SpecFlowStep(Location location, string keyword, string text, StepArgument argument, StepKeyword stepKeyword, ScenarioBlock scenarioBlock) : base(location, keyword, text, argument) { StepKeyword = stepKeyword; ScenarioBlock = scenarioBlock; }
public Token(IGherkinLine line, Location location) { Line = line; Location = location; }
public NoSuchLanguageException(string language, Location location) : base("Language not supported: " + language, location) { }
public AstBuilderException(string message, Location location) : base(message, location) { if (message == null) throw new ArgumentNullException("message"); if (location == null) throw new ArgumentNullException("location"); }
private static string GetMessage(string message, Location location) { if (location == null) throw new ArgumentNullException("location"); return string.Format("({0}:{1}): {2}", location.Line, location.Column, message); }
public SpecFlowFeature(Tag[] tags, Location location, string language, string keyword, string name, string description, Background background, ScenarioDefinition[] scenarioDefinitions, Comment[] comments, string sourceFilePath) : base(tags, location, language, keyword, name, description, background, scenarioDefinitions, comments) { this.SourceFilePath = sourceFilePath; }
internal G.GherkinDocument CreateGherkinDocument(string name, string description, string[] tags = null, G.Background background = null, G.ScenarioDefinition[] scenarioDefinitions = null, G.Comment[] comments = null, G.Location location = null, string language = null) { var nonNullScenarioDefinitions = scenarioDefinitions ?? new G.ScenarioDefinition[0]; return(new G.GherkinDocument( new G.Feature( (tags ?? new string[0]).Select(this.CreateTag).ToArray(), location, language, "Feature", name, description, background != null ? new G.ScenarioDefinition[] { background }.Concat(nonNullScenarioDefinitions).ToArray() : nonNullScenarioDefinitions), comments)); }
protected virtual bool TryGetDialect(string language, Ast.Location location, out GherkinDialect dialect) { var gherkinLanguageSettings = LoadLanguageSettings(); return(TryGetDialect(language, gherkinLanguageSettings, location, out dialect)); }
public virtual Token Read() { var line = reader.ReadLine(); var location = new Location(++lineNumber); return line == null ? new Token(null, location) : new Token(new GherkinLine(line, lineNumber), location); }
public NoSuchLanguageException(string language, Location location = null) : base("Language not supported: " + language, location) { if (language == null) throw new ArgumentNullException("language"); }
protected virtual Scenario CreateScenario(Tag[] tags, Ast.Location location, string keyword, string name, string description, Step[] steps, Examples[] examples, AstNode node) { return(new Scenario(tags, location, keyword, name, description, steps, examples)); }
protected virtual bool TryGetDialect(string language, Dictionary <string, GherkinLanguageSetting> gherkinLanguageSettings, Ast.Location location, out GherkinDialect dialect) { if (!gherkinLanguageSettings.TryGetValue(language, out var languageSettings)) { dialect = null; return(false); } dialect = CreateGherkinDialect(language, languageSettings); return(true); }
protected virtual Step CreateStep(Ast.Location location, string keyword, string text, StepArgument argument, AstNode node) { return(new Step(location, keyword, text, argument)); }
public Scenario(Tag[] tags, Location location, string keyword, string name, string description, Step[] steps) : base(location, keyword, name, description, steps) { Tags = tags; }
protected virtual Rule CreateRule(Ast.Location location, string keyword, string name, string description, IHasLocation[] children, AstNode node) { return(new Rule(location, keyword, name, description, children)); }
protected ParserException(string message, Ast.Location location = null) : base(GetMessage(message, location)) { Location = location; }
protected virtual TableRow CreateTableRow(Ast.Location location, TableCell[] cells, AstNode node) { return(new TableRow(location, cells)); }
public AstBuilderException(string message, Ast.Location location) : base(message, location) { }
protected virtual void HandleAstError(string message, Ast.Location location) { throw new AstBuilderException(message, location); }
public AstBuilderException(string message, Location location) : base(message, location) { }
public DocString(Location location, string contentType, string content) { Location = location; ContentType = contentType; Content = content; }
public Token(IGherkinLine line, Ast.Location location) { Line = line; Location = location; }
public TableRow(Location location, TableCell[] cells) { Location = location; Cells = cells; }
protected ParserException(SerializationInfo info, StreamingContext context) : base(info, context) { Location = (Location)info.GetValue("Location", typeof(Location)); }
internal G.Scenario CreateScenario(string[] tags, string name, string description, G.Step[] steps, G.Location location = null) { G.Scenario scenario = new G.Scenario( tags.Select(this.CreateTag).ToArray(), location ?? AnyLocation, "Scenario", name, description, steps); return(scenario); }
protected virtual Background CreateBackground(Ast.Location location, string keyword, string name, string description, Step[] steps, AstNode node) { return(new Background(location, keyword, name, description, steps)); }
public virtual GherkinDialect GetDialect(string language, Location location) { var gherkinLanguageSettings = LoadLanguageSettings(); return GetDialect(language, gherkinLanguageSettings, location); }
protected virtual Comment CreateComment(Ast.Location location, string text) { return(new Comment(location, text)); }
public Location MapToLocation(G.Location location) { return(this.mapper.Map <Location>(location)); }
protected virtual Examples CreateExamples(Tag[] tags, Ast.Location location, string keyword, string name, string description, TableRow header, TableRow[] body, AstNode node) { return(new Examples(tags, location, keyword, name, description, header, body)); }
public Location MapToLocation(G.Location location) { return(location != null ? new Location { Column = location.Column, Line = location.Line } : null); }
protected override GherkinDialect GetDialect(string language, Dictionary<string, GherkinLanguageSetting> gherkinLanguageSettings, Location location) { string languageOnly = StripCulture(language); return base.GetDialect(languageOnly, gherkinLanguageSettings, location); }