Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ehuelsmann update perl #711

Closed
wants to merge 20 commits into from
Closed

Ehuelsmann update perl #711

wants to merge 20 commits into from

Conversation

aslakhellesoy
Copy link
Contributor

This PR supersedes #694 with additional build tweaks

ehuelsmann and others added 19 commits September 1, 2019 12:59
Also update gherkin-perl.razor to fix the indentation
of the line checking for the 'eof' token.
The Rule and Example rules are new since the last update.

The Scenario Outline and Scenario line are now synonyms,
meaning that the ScenarioOutline matching rule itself
can be removed from the token matcher, but the Scenario
token match should also match the Scenario Outline.
The token tests show that the language token is case-insensitive (tests say
'Language', but the module wanted 'language').

The token tests show that the DocStringSeparator token wants the actual token
'keyword' matched to be included in the token output.

The token tests show that the scenario outline is reported as a keyword match
on the ScenarioLine (whereas it used to be its own token class
ScenarioOutlineLine).
Some time between the last update and the current Berp grammar,
underscores were removed from the rule names. This commit
adjusts.
Concluding from the input provided by the *.feature.token files,
the token builder should return valid UTF-8, not UTF-8-characters
escaped-using Perl's character encodings "\N{<charnum>}".
From review of the *.feature.ast.ndjson files, it's clear
that the AST should not include empty arrays or empty
strings. There already is a function to remove empty
values, extend it to remove empty arrays (whose values
*are* defined). Additionally, check for empty strings
and add those to the AST as `undef`.
The Perl implementation AST doesn't conform to
the ASTs specified in *.feature.ast.ndjson. This
commit is the first step to generate compliant
output -- the document level.
Various AST incompliances fixed:

 - Removed unexpected 'type' key appearing all over the place
 - Data table and doc string under 'argument' key
 - Docstring delimiter not included in docstring
 - ScenarioOutline merged with Scenario AST item
 - Rule processing added to the AstBuilder
Without this change, the test suite fails on UTF-8 tokens.
…output

Because the parser now returns a fully compliant AST, don't wrap
the AST in a gherkinDocument in the test-output generator.
This fixes compliance with all the *.feature.pickles.ndjson
verification files, except for the values of the `id` attributes
(for which I have a question outstanding of how to calculate them)
and the new 'Rule'/'Example' keywords.
…nerate-pickles

The pickle compiler returns the full document to be serialized now, so there's
no need to create a wrapper around it before serializing.
…tion

Because the backgrounds of the feature and the rule are
concatenated, a bit more refactoring was required than simply
pickling the Rule section of the AST.
This change helps a lot for reading the output while debugging.
@stale
Copy link

stale bot commented Nov 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.

@stale stale bot added the ⌛ stale Will soon be closed by stalebot unless there is activity label Nov 29, 2019
@stale
Copy link

stale bot commented Dec 6, 2019

This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.

@stale stale bot closed this Dec 6, 2019
@mattwynne mattwynne deleted the ehuelsmann-update-perl branch April 1, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ stale Will soon be closed by stalebot unless there is activity language: perl library: gherkin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants