Code Monkey home page Code Monkey logo

Comments (4)

Ygg01 avatar Ygg01 commented on June 19, 2024

Hi, I did some programming for Arpeggio and from what I know, defining rules in Arpeggio, automatically includes whitespaces and endlines.

If you write your rule as:

rule  =  "key" "word" "test

All of the following statements will fit ( dots represent spaces, arrows represent tabs):

 // Example 1:
 key....word
 test 

 // Example 2:
 key....word...test

 // Example 3:
 key
 --->word
 test 

Unless something changed in the meantime, Arpeggio by default accepts any number of whitespaces (space or tab) and newlines between two element in a rule.

from arpeggio.

igordejanovic avatar igordejanovic commented on June 19, 2024

There is a parser parameter skipws which is True by default. When this param is set to False arpeggio will not skip whitespaces.

Yash, considering the error you are getting. It is a bug in the PEG rules resolving during ParserPEG construction triggered by the rule calc = test. I am working on it. In the mean time the workaround is to remove this rule and directly reference test rule from ParserPEG. Like this:

    parser = ParserPEG(calc_grammar, "test", skipws=False)

from arpeggio.

igordejanovic avatar igordejanovic commented on June 19, 2024

The issue is fixed. this test now passes.

from arpeggio.

codeyash avatar codeyash commented on June 19, 2024

Yup worked well 👍

from arpeggio.

Related Issues (20)

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.