This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change messages and Gherkin parser/pickle compiler to retain step key…
…word (#1741) * Expand the messages protocol with keyword types Extracted from #1741 for ease of review on request of @aurelien-reeves, implements the `messages` side of #768. * Incorporate review comments * Treat all translations associated with multiple keywords as 'General' keywordType * Incorporate latest reviews * Change the enum in the Pickle as per your last comment * Add translation of But/And to the preceeding keyword in the pickle compiler * Rename the "keywordType" field in the Pickle to `type` * Adjust Perl implementation over changed naming of keyword type General * Use Cucumber::Message's constant declarations instead of hard-coded strings * Align Perl's TokenMatcher implementation with Ruby's * Port initial Perl implementation to Ruby * Fix test failures from the latest refactoring * Add step keyword types to token and AST test data * Fix error found while fixing test data * Make sure the 'keywordType' is correctly populated Since it's legal to start a scenario or even a background with a conjunction, it's fair to say that the keyword type is unknown until a keyword with known type is encountered. * Update testdata with keyword and step types Sync to the implementations which have been adapted. * Follow Ruby's token_matcher structure in Perl And fix a syntax error using constants. * Eliminate warnings during Perl tests Based on running tests on the coverted test data, fix a warning about an undefined value being used. * Rewrite Perl's Pickle compiler to follow Ruby's structure more * Expand 'Conjunction's into their implied keyword type * Convert Perl/Ruby token matcher to pattern available in JS&Java too * Port Ruby/Perl implementation of keyword retention to Java * Sync JavaScript testdata * Progress on JS (works, except Markdown?) * Implement keywordType in Markdown Also align the Classic Gherkin implementation * Use hash lookups to get the keyword's StepKeywordType At the suggestion of @ciaranmcnulty, simplify the loop in `match_StepLine` by using a hash lookup. * Add comment as to why the StepKeywordType is overriden to UNKNOWN * Fix typo (capitalization error) * Update and sync Gherkin-In-Markdown test data * Include background steps when the scenario *has* steps * Rename 'keywordType' to 'matchedKeywordType' Change suggested by @ciaranmcnulty to align the field with the names of the other fields which are only available after the token matched. * Synchronise testdata * Adjust PickleCompiler for 'keywordType' type change Now that 'keywordType' is no longer required, it's type changed to Optional, which introduces an additional level of indirection. * Collect all applicable types per step keyword When more than one mapping exists, return the UNKNOWN step keyword type to indicate that the keyword's meaning isn't exact. * Fix temporarly json-to-messages broken test We need to upgrade json-to-messages to use ci-environment rather than the former create-meta. In the meantime to prevent being stuck, we make the test pass * Restore original jsontToMessages test * Report changes from #1972 on gherkin testdata * Add support for keyword type in go * Add StepKeywordType support to GherkinDialect * Add support of step keyword type to php * revert to c# 9 * Implement PickleStep type in php * [dotnet] try build keyword type * [python] Add support of step keyword type * hopefully fixing .NET finally... * Clarify order of operations when computing lastKeywordType * Clarify type of keywordType list * Add PR to CHANGELOG.md * Remove useless 'if' condition * Add again the check * Add more changelog entries for Go Co-authored-by: Ciaran McNulty <mail@ciaranmcnulty.com> Co-authored-by: aurelien-reeves <aurelien.reeves@smartbear.com> Co-authored-by: aurelien-reeves <aurelien.reeves@hiptest.net> Co-authored-by: Aslak Hellesøy <1000+aslakhellesoy@users.noreply.github.com> Co-authored-by: Aslak Hellesøy <aslak.hellesoy@gmail.com> Co-authored-by: Gaspar Nagy <gaspar.nagy@gmail.com> Co-authored-by: Björn Rasmusson <B.Rasmusson@computer.org>
- Loading branch information