Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Add 'path' to output of parser #213

Closed
Zearin opened this issue May 23, 2016 · 4 comments
Closed

Add 'path' to output of parser #213

Zearin opened this issue May 23, 2016 · 4 comments

Comments

@Zearin
Copy link
Contributor

Zearin commented May 23, 2016

Problem

I want to call parse() and be able to access the path to the *.feature file that was parsed.

Recommendation

Add path to GherkinDocument.feature.location (i.e., the output of parse()).

Rationale

Currently, the parser output has a location for just about everything it contains. However, these location fields only have line and column.

Since a feature represents a physical file, it seems odd that there is no way to access the path from the result of a parse().

Also, the compile() function needs a feature and a path. If you pass a filename to parse(), then compile() should be able to grab the path from the result.

If the parser received a string instead of a filename, then GherkinDocument.feature.location could simply be set to null/nil/None.

@Zearin
Copy link
Contributor Author

Zearin commented May 31, 2016

@aslakhellesoy ping

@Zearin
Copy link
Contributor Author

Zearin commented Mar 17, 2017

@aslakhellesoy Whoa! Issue closed? Can you at least comment on what I wrote?

@aslakhellesoy
Copy link
Contributor

Hi @Zearin. The entire repo has moved, and I didn't want to move over all open issues. Did you see the comment in ae7c92f?

What you're asking for is actually supported in the latest release. You have the uri attribute on the gherkin-document event.

@enkessler
Copy link
Contributor

enkessler commented Mar 17, 2017

A feature's location is the line and column number where it appears in a document. The document itself would have a path location, sure. Something like GherkinDocument.uri would be appropriate.

Edit: Ninja'd by Aslak

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants