public bool Match_Comment(Token token) { if (!token.IsEOF && token.Line.StartsWith("#")) { token.MatchedType = TokenType.Comment; token.Text = token.Line.GetRestTrimmed(0).Substring(1); if (languageChangeAllowed && token.Text.StartsWith(LANGUAGE_PREFIX, StringComparison.OrdinalIgnoreCase)) { var language = token.Text.Substring(LANGUAGE_PREFIX.Length).Trim(); currentDialect = dialectProvider.GetDialect(language); } languageChangeAllowed = false; return(true); } return(false); }
public bool Match_Comment(Token token) { if (!token.IsEOF && token.Line.StartsWith("#")) { token.MatchedType = TokenType.Comment; token.Text = token.Line.GetRestTrimmed(0).Substring(1); if (languageChangeAllowed && token.Text.StartsWith(LANGUAGE_PREFIX, StringComparison.OrdinalIgnoreCase)) { var language = token.Text.Substring(LANGUAGE_PREFIX.Length).Trim(); currentDialect = dialectProvider.GetDialect(language); } languageChangeAllowed = false; return true; } return false; }
public TokenMatcher(GherkinDialectProvider dialectProvider = null) { this.dialectProvider = dialectProvider ?? new GherkinDialectProvider(); currentDialect = this.dialectProvider.DefaultDialect; }
public GherkinDialectProvider(string defaultLanguage = "en") { defaultDialect = GetDialect(defaultLanguage); }
public GherkinDialectProvider(string defaultLanguage = "en") { defaultDialect = GetDialect(defaultLanguage); }
public TokenMatcher(GherkinDialectProvider dialectProvider = null) { this.dialectProvider = dialectProvider ?? new GherkinDialectProvider(); currentDialect = this.dialectProvider.DefaultDialect; }