Giter Site home page Giter Site logo

greg's People

Contributors

ali-rantakari avatar fasterthanlime avatar jasedit avatar kainjow avatar mingodad avatar nddrylliog avatar onnlucky avatar tokuhirom avatar zosrothko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greg's Issues

Issues when running greg parser in multithreaded app

First --- I apologize for the vague nature of this issue/question. I'm trying to track down the problem, but without much success. Perhaps you'll have some insight that can point me in the right direction. I'm happy to answer any follow-up questions that would be helpful.

MultiMarkdown 4 (https://github.com/fletcher/MultiMarkdown-4) uses a parser built by greg. I've designed it (I think) to be thread-safe (unlike MMD 3 which was built using peg/leg).

I also have a commercial app that is built around MultiMarkdown. To maximize performance, several of the routines using MMD run on separate threads. It seems to work great (unlike when I used a version of MMD 3 with peg/leg --- which was definitely not thread-safe). However, I have found at least one situation where things don't work properly, and it seems to be due to two routines from MMD-4 being run simultaneously. When I disable one function, the other one works properly, and vice versa. The problem doesn't occur consistently, which leads me to believe that the timing of the two threads has to be within a fairly narrow range in order for the problem to appear. (Basically one thread is converting the source text to HTML for a live preview window; the other thread is being used for syntax highlighting within the source text.)

I've gone back through the MMD-specific code that seems relevant, and I don't see anything that should cause collisions. Any potential trouble areas that come to mind? Anything that I need to be sure I'm doing? I'm running the two routines on separate copies of source text strings. Adding in a bunch of logging statements suggests that both threads are running properly, but the output structures are getting mangled somehow? The output is basically a linked list, and it seems that the lists are getting prematurely truncated.

Again, I don't expect you to be able to provide a fix with such a vage problem, but hopefully you (or someone) has experience with the reentrant/thread-safe functionality of greg and any problems that can sometimes arise. Thanks for reading this!

Fletcher

thunk->begin and thunk->end don't consistently work

It's entirely possible that I'm being daft, or that my google-fu is failing me, but thunk->begin and thunk->end don't consistently indicate the offsets of the beginning/end of the recipe. In particular, the accuracy of nested recipes seems inaccurate. For example, matching a string that includes some whitespace at the end that I need to keep track of.

What are the rules for which components of a "recipe" are included inside the thunk begin/end offsets?

Thanks!

Support [^ ]

How can I capture characters without spaces like perl's \S?
[^ ] does not match to non-space character.

Documentation

This project seriously lacks documentation. The original peg has a nice and extensive man page – greg has no documentation ... aside from usage examples.

How to include more than one parser in a program?

I am creating a quick and dirty test program around my parser built with greg. In order to parse the test files, it's easiest to do by building another parser.

Since both parsers are built with greg, there are namespace collisions:

duplicate symbol _yyparse_from in:
    test.o
    parser.o
duplicate symbol _yyparse in:
    test.o
    parser.o
duplicate symbol _yyinit in:
    test.o
    parser.o
duplicate symbol _yydeinit in:
    test.o
    parser.o
duplicate symbol _yyparse_new in:
    test.o
    parser.o
duplicate symbol _yyparse_free in:
    test.o
    parser.o

Any tips on how to make this work? Surely it is possible to use more than one parser in a given program?

Any advice is appreciated!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.