Coder Social home page Coder Social logo

abnf's People

Contributors

akr avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

abnf's Issues

Method to_s returns weird prefix + suffix

print "Regexp for A to C: "
pp ABNF.regexp_tree(<<-'End').to_s
 a-to-c="abc"
End

Expected output: Regexp for A to C: "[abc]" or maybe ... "/[abc]/"

Observed output: Regexp for A to C: "(?i-m:abc)"

Duplicate Definitions Extend Previous

If I define two times the same entity, it extends the previous entity.

For example:

a = "a"
a = "b"

Expected result: "b", "a" or (preferably) error.

Result:

%r{[ab]}xi

Maybe this is correct or documented, however it doesn't match my expectation. (I was under the impression in the RFC you have to use a special operator for extension, not = but rather *= or something similar.)

Thanks heaps for this library by the way, it is gold!

.regex wrongly appends 'i'

ABNF is usually case sensitive, right?

While the standard suggests it is illegal to use string literals "a" / "b" and instead to escape them in to unreadable muck, many people use them anyway.

In these (common) cases, it is often correct to respect the input case.

.regex always seems to return /something/i.

I suppose this may be a workaround for bad input, but at least an option to stop it would be cute.

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.