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
How to define a rule to match with a pattern multiple times in PEG.js? #636
Comments
Please read the peg example grammars. There is no bug here. Issue trackers are not intended for help requests. One of the example grammars is exactly what you're asking for. The appropriate place for help requests is StackOverflow. Issue trackers are what the developers use to keep track of what's broken, and what package repositories use to measure project quality.
Once you've seen this, please close this issue. Thanks. |
The key is to learn to read PEG grammars. That says:
Because ClassRow ends in a newline, a newline effectively starts the new row. |
I'll use StackOverflow for my further questions, thanks for the answer and the explanations. However, there are some things I want to express:
Please consider that as a newcomer feedback. |
I agree. I want to remove that text, and asked to in 2017. The reason that text is there is because David, who no longer runs this library, was tired of people saying "this is a bug" without looking at issues and finding the other person who thought there was a bug, and there wasn't This issue, for example, has half a dozen clones .
I agree. I would like to write a lot of them. .
It most certainly is not. The original author had let it sit idle for a year, so he asked for new maintainers. The new maintainer who took over in May of 2017 has not released a single byte of code to the master branch. I have begun the process of agitating for a takeover, because the library's usage is dropping, the library doesn't support javascript from 2014, there's been no .
I believe that user onboarding is probably the single most important real world problem right now following getting this library healthy again |
For clarity, I'm not the original author. @dmajda is. For clarity, I'm not the maintainer. There is no maintainer. |
@ceremcem, you did everything right (other than what you didn't look at PEG's description on wikipedia and not to try to parse you grammar manually, after which your question, IMHO, would be resolved). You cannot know your question is simply a question or a description of a bug in the library. This can only be decided by the developer. Therefore, there is no rule GitHub only for bugs. Issue is issue even in Africa |
in general an issue tracker is meant for issues, not questions ceremcem would have gotten an answer in hours on stackoverflow. here, he waited nine days, and if i hadn't spoken up, i think he wouldn't have gotten an answer. many similar questions like these are unanswered here after a year or more. there's half a dozen that are eight years old. .
Yes he can. He was asking "how do I do this?" Unless he believes the parser cannot do this, that's never a bug. It's basically the simplest possible thing in a parser, and I believe that In his best interests, it's ideal to direct him to a resource that is designed for questions, rather than library repair, especially if the question resource is a highly active one, and the library repair resource just announced that it's scuttling three years of work and generally ignores questions like these It's not coincidence that this went unanswered until I started tagging people, as did half a dozen other issues so far No decisions are being made. I was giving him advice. Also, I answered his question. |
I usually get an answer in few of hours in StackOverflow, so I'm a regular user of it. However, there were no activities on my SO question, so I came and asked here. Basically, response times are nearly identical. I've seen every combination of issue tracker usage:
There is no one single best choice for that (no one fits every case), but I do like using issue tracker for everything.
We've seen this many times on FreeCAD_Assembly3 library. Many of my simple, dumb questions revealed one or more bugs. This happens, I saw.
I like your approach to this library. You seem to care a lot.
Correct. My intention was not a bug report. I just didn't find the way out to reuse the same rule for multiple lines. |
Oh man, has the peg community there died too? That's so sad Okay, if you already made an SO post, then at that point you're 100% correct to come here .
Yep, people violate community norms all the time .
Very much. I wanted to be involved in the 2017 ownership transition, but someone gave a plan with 17 major releases, and the old owner believed them That person gave up on their first minor release three years later. The truth is public software is really hard to write. Almost everyone I know, including myself, has the tendency to say "this release isn't ready until X, Y, and Z are done." And then as Y finishes, you realize you also need V and W. And then as Z finishes, you realize you also need S, T, and U. And then as V finishes ... That's how Part of the discipline of public software is frequent, small releases. That was always a problem with peg, but the software's quality was so high that we put up with it anyway. Then dmajda left, and everything just halted. And we waited, patiently, for a long time. But the new guy now calls this his hobby project, and says he scrapped the whole thing in favor of something new and incompatible he wrote. And even if it had the same AST and the same featureset and more, it wouldn't have ten years of community debugging behind it, and I wouldn't be able to switch And you know, if he wants to write a new, more powerful PEG parser, fine, great, go ahead. But he doesn't get to kill this one by pretending to be a maintainer then never maintaining, then taking over this one's library community and position, and putting his own never-going-to-be-released software in its place It's time for a healthy process to take back over. The new maintainer built a micro-community of junior developers, and they're actually advocating to keep the library dead rather than to save it It's clear that change is badly needed .
If you have trouble finding answers again, feel free to tag me personally That said, generally I google for examples, and because this library was once so popular and heavily used (and can be again if the current library murderers will just make room on the bench for another person to help,) there are more than enough examples out there to cover the things you'll need to find Generally, though, what I wish someone had told me when I was new is the thing I said under the comment starting "The key is to learn to read PEG grammars" Once you learn to read PEG grammars in that discussion form, it also becomes very easy to think about them, and at that point they are suddenly trivially easy to write It's like a lightswitch. No ramp. Straight from impossible to easy |
You encouraged me! :) So I shouldn't feel so stupid when I could only see some "gibberish" rule sets :)
I don't want to abuse this, so it'll be hard call everytime if it is worth to ask or should I search the net some more. This was a generous offer, thank you.
I see that you enabled "issues" section in your fork. That is always a good sign of attempting to fly an airliner by rushing into the cockpit while you were only a passenger. That's a good thing. If there is a live water source, it will always find its way to flow, no matter what you put on its way. If there is no flow because it's source is drained, there is nothing to do. Source is the demand. Your attitude indicates that the source of the water is very much alive. So I'm curious, why don't you just take over? That's what I did for loading-bar library. I realized that the development is stalled, so I took over by addressing the issues starting from my own ones and creating pull requests for each branch. Some time later, the original author decided to continue his work, and we were good to go. Do you think this is a feasible solution? |
I'm glad. .
Nah. Parsers are an extreme case of the "it's just ridiculous and then all of a sudden it's easy" thing. Here's the kicker - comparatively speaking, peg's pretty easy. The other ones are often just brutal. There are in my opinion four big problems in learning peg.
I have been considering making some video tutorials. They would make this far easier to understand, I believe. .
Once a week is fine. Understand that I'm sometimes slow to respond .
I've barely gotten started. First I want to see if the real repo can just be rescued Doing this from a fork would be obscenely more difficult. I'd lose all the PRs and all the cross references, and all of the closed unmerged or closed deleted material, some of which is very valuable .
I would like to. At this time, the relevant passwords and authentication are in one person's hands, and they have yet to respond. We'll see. .
This is a special case What's published is The new maintainer allowed the There's nothing to put PRs to. What's in .
If the replacement maintainer is willing to allow it, this is roughly exactly what I want. I kind of doubt David will come back, but if he does, that'd be fantastic As such I want to turn this into a standard open source project again |
What are the most 3 important issues here, according to you? |
I think saying what the most important issues are to me is a little dangerous, because there are a fair number of people here with more experience than I have in To that end, I want to caution that whereas I'm happy to develop here, my interest here is as a maintainer. This is, I think, something a lot of people don't get: development and maintenance coding are really, really different.
I'm happy to do some development coding - maybe even looking forward to some - but there are other people in here who are better suited to it. And, so, I want to make clear: my actual goal is to make this so they can contribute PRs again, like they used to. That said, to show what my personal viewpoint is: 1. Getting a regular release cadence back
A version should be the result of a feature, not a collecting point for a plan of features. We're not a 1980s company and we shouldn't be planning like one. The only time more than one feature should go in at the same time is when it's unavoidable, like as the result of patching features to cope with an external upgrade, or things that genuinely cannot be done apart. Oh, you think that's related to another feature? Great, put it in People have been treating minors like they're majors. That's why the minor never came out: it was hung on the same behavioral trap that hangs majors. Just Don't Fucking Do That ™. To be specific,
2. Getting the documentation and testing into an acceptable placeEveryone talks about this, but my hobby finite state machine currently has 3500 unit tests and 100% documentation coverage, so, take me more seriously. I really deeply believe in testing. There's another library I wrote that's half the size and significantly lower in complexity than the state machine. It's way easier to make sweeping language changes to the state machine than small changes to the network handler, because the network handler is poorly tested, and you have to put in real effort to make sure something is right. The FSM? Nah, the tests are great, they'll catch you This specific contrast reminds me in brutal clarity every time I touch either of them just how important testing actually is to something being, to me at least, trustworthy. I think a really big part of the problem with working on 3. Removing the hipster nonsense.
but you'll notice none of those are actually really about the software per se i don't think the software here is the problem i think the process is, and to a lesser degree, the project those are what i will fix, if @futagoza will allow it this library can be back to life in 30 days if we swallow our pride and choose the library's large community's needs over our hobby project interests let the hobby rewrite be the fork let a maintainer start maintaining |
@StoneCypher I like you energy :-) I used to be using pegjs in the past (in dmajda's times) and I liked it a lot. Just fork it and do not fight. Things can and will settle down later. If community follows you then you do not need to care about existing "key holder" or anything like that. Building reputation takes time but is necessary. Do not waste time on arguing anymore. Eight your fork will make it "back into the origin" at some point in the future or it will have its own life. Both options are valid and fine IMO. |
Please stop it with the "make a fork" bullshit. There are four of them and you don't know what they are. A fork won't save any of the existing downstream consumers, won't save the PRs, won't save the issues, won't carry the community, and won't be visible. People have been trying that for three years. IT DOES NOT WORK. Do not continue to offer this advice. |
@futagoza - everyone has given up on you doing the right thing. Five people have told me to fork the library, because they expect you to refuse to allow repair, and to keep control of the library you're killing. I believe that the reason they expect this is that I've found more than a dozen people offering you help to do the thing you promised to do and never did, and every time you say "no, I'm gonna do it soon." Do what you should have done in 2018, and give maintenance to someone who will actually maintain the project. Stop killing this library, stop killing this community, and get out of the way. |
@StoneCypher John, when I suggested to create a fork I really meant it. Forking a project is a great option open source gives you especially if you feel it needs changes or it is dying. And no, I do not have any problem, you do not need to write me DM just to ask me this question. |
When I said "do not give this advice again," I also really meant it. |
I love this conversation. |
@StoneCypher I have to disagree with you here, because I saw just the opposite:
Lately, his PR had been started to be reviewed. A great amount of work had been done and finally his branch and the mainstream become compatible. In the next release, I believe his branch will be merged into the mainstream. Meanwhile, there was a serious finance problem. He was the only maintainer and donation from a few users couldn't make him survive. I decided to teach FreeCAD/Assembly3 in here, Turkey, and sell the support in order to support the finance. I proposed him and this is accepted. I made all necessary applications to become a trainer in a highly reputed foundation, which is accepted recently. Sometimes 1 person is enough to start a fire.
Disagree. Let them stay on the way. A good motivation will always find its way out. If it can't, it's because it was not that good. |
I am explicitly and clearly not gathering advice on this topic. |
This library needs to be resurrected. I'm sorry if I'm not explaining it sufficiently, but the responses that I am receiving fail to address any of the practical concerns raised. People's lives and jobs ride on this. |
Issue type
Prerequisites
Description
I'm trying to parse a file where the pattern might be seen multiple times:
The corresponding PEG.js grammar is:
Expected behavior:
I would expect PEG.js to produce a 2 item array for each
G04
line.Actual behavior:
The following error is thrown:
Software
The text was updated successfully, but these errors were encountered: