Problems with new(?) versions of PEG #6

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

After getting an error that the parser object don't have the method 'toSource()' and checking the readme file of peg on github I discovered that there is a new option with the name 'output'. This option switches the return value of the 'buildParser' function from 'parser' to string.

Hopefully this fix is okey for you.

Kind Regards
Otto

Owner

dvberkel commented Jul 15, 2013

Thanks for providing a pull-request. I will look into the problem and your solution tonight.

You can expect a resolution on Tuesday 2013-07-16.

Owner

dvberkel commented Jul 15, 2013

Hi @okrammer,

I have taken a preliminary look into the issue. And I am not sure what you mean by new versions of pegjs.

The latest version of pegjs on npm is 0.7.0 and it is not update for over a year. When looking at the milestones for the pegjs project, the version 0.8 is still actively developed.

Could you clarify what your problem precisely is and what I should do to reproduce it?

Hi,
thank you for the fast response.
That was the reason I put the '(?)' in the subject. I've getting the error "#object has no property toSource".
So I debugged the plugin code and found out that the returned parser object don't have a 'toSource' property like the documentation describes at http://pegjs.majda.cz/documentation:

To get parser’s source code, call the toSource method on the parser.<<
I was quite confused after I checked the version of the pegjs module because it was 0.7.
So I checked the sources of the PEG project and the behaviour is quite different than documented at http://pegjs.majda.cz/documentation.

The documentation at https://github.com/dmajda/pegjs describes this 'new' behaviour:

output — if set to "parser", the method will return generated parser object; if set to "source", it will return parser source code as a string (default: "parser")
Further the module version that npm deploys for 'pegjs' is version 0.7 and in the sources of the module you can find in lib/compiler.js:34 the switch over the output value.
The version of the source code corresponds to the head version of project:
The original version for 0.7 looks like this https://github.com/dmajda/pegjs/blob/5bd2ca1cb56d6ffbaec6b103508b4b535a6ee2dc/src/compiler.js.

Okey I finally know how to reproduce the problem:
npm install pegjs # will install the latest version from the git repo … which version file says: 0.7.0
npm install pegis@0.7.0 # will install from the tarball which is the real 0.7.0 release.

Sry for the long text and the confusion ;)
Thanks and kind regards.

On 15 Jul 2013, at 10:57, Daan van Berkel notifications@github.com wrote:

Hi @okrammer,

I have taken a preliminary look into the issue. And I am not sure what you mean by new versions of pegjs.

The latest version of pegjs on npm is 0.7.0 and it is not update for over a year. When looking at the milestones for the pegjs project, the version 0.8 is still actively developed.

Could you clarify what your problem precisely is and what I should do to reproduce it?


Reply to this email directly or view it on GitHub.

Owner

dvberkel commented Jul 15, 2013

Hi @okrammer,

Do not worry about the long text. It is helpful to diagnose the problem.

The problem seems to stem from the version that gets installed as found in you reply

npm install pegjs # will install the latest version from the git repo … which version file says: 0.7.0
npm install pegis@0.7.0 # will install from the tarball which is the real 0.7.0 release.

When I run the command npm install pegjs I receive the following output

npm http GET https://registry.npmjs.org/pegjs
npm http 200 https://registry.npmjs.org/pegjs
npm http GET https://registry.npmjs.org/pegjs/-/pegjs-0.7.0.tgz
npm http 200 https://registry.npmjs.org/pegjs/-/pegjs-0.7.0.tgz

What is to be expected.

My npm --version reports: 1.1.64.

What version do you have?

Hi again,
this is the console output I receive:

okrammer@Silversurfer][12:09]
[~/temp/] % npm --version
1.2.21

[okrammer@Silversurfer][12:09]
[~/temp/] % npm install pegjs
npm http GET https://registry.npmjs.org/pegjs
npm http 304 https://registry.npmjs.org/pegjs
pegjs@0.7.0 node_modules/pegjs%

On 15 Jul 2013, at 12:04, Daan van Berkel notifications@github.com wrote:

Hi @okrammer,

Do not worry about the long text. It is helpful to diagnose the problem.

The problem seems to stem from the version that gets installed as found in you reply

npm install pegjs # will install the latest version from the git repo … which version file says: 0.7.0
npm install pegis@0.7.0 # will install from the tarball which is the real 0.7.0 release.

When I run the command npm install pegjs I receive the following output

npm http GET https://registry.npmjs.org/pegjs
npm http 200 https://registry.npmjs.org/pegjs
npm http GET https://registry.npmjs.org/pegjs/-/pegjs-0.7.0.tgz
npm http 200 https://registry.npmjs.org/pegjs/-/pegjs-0.7.0.tgz
What is to be expected.

My npm --version reports: 1.1.64.

What version do you have?


Reply to this email directly or view it on GitHub.

Owner

dvberkel commented Jul 16, 2013

Although I haven't looked into the problem further, I am filing it as a problem caused by npm. As such I am not incorporating your changes into the main branch.

If your problems persist I think it would be best to take it up with npm maintainers.

That said I do want to thank you for alerting me on the progress pegjs is making. When the pegjs is releasing a new version Your code will be used to update grunt-peg.

@dvberkel dvberkel closed this Jul 16, 2013

machty commented Aug 20, 2013

I'm running into this issue as well; I think there at least needs to be some kind of documentation about it if this PR won't be accepted.

machty commented Aug 20, 2013

Ah, ok, the thing that fixed it was npm cache clear. I guess I'd previously installed a specific github version of pegjs (which was still listed as 0.7.0), so when I did npm install it was using that version.

Owner

dvberkel commented Aug 20, 2013

@machty I am sorry that you run in the same problem. It is great you found a solution for it.

I think you made a great suggestion, so I will add a section in the README detailing the problem and how to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment