Giter Site home page Giter Site logo

babel's People

Contributors

quytelda avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

babel's Issues

Babel exits with failure when using -v and -h flags.

The program checks too early whether or not the user has provided a grammar file, which is not relevant or expected when asking the program for help or version information. This causes the --version and --help options to exit with an error status.

quytelda@kahja % babel --version
You must provide a grammar file.
Usage: babel [OPTION...] GRAMMAR_FILE
  -h         --help          Display help and usage information.
  -n N                       Generate N different sequences.
  -o FILE    --output=FILE   Redirect output to FILE.
  -s SYMBOL  --start=SYMBOL  Use SYMBOL as the starting symbol ("S" is the default.).
  -v         --version       Display version information.

Repeated Symbols Overwrite

Issue: when a config file contains multiple lines with the same left hand side (LHS), then the last defined LHS will overwrite all previously defined rules.

How to Replicate: Create a config file with two rules for the same symbol on the LHS, then run babel with that config file. Only the second rule will be seen.

Why this is an issue: For clarity sake on long rules, or for style preference, users may wish to define rules for one symbol across multiple lines.

Semicolons End Parsing

Problem: When a semicolon is used in a config file, the rest of the config file is not read.

How to replicate: Create a config file with a semicolon somewhere in the middle, run babel with the config file. You will see that all the rules before the semi colon are used, and all the rules afterwards are not.

Why this is a problem: After the first change semi-colons are no longer a syntactically significant, so they should be available as symbols. Especially if a CFG is being constructed for say a language like structure.

CFG Files Ending with New Line Don't Work

Issue:
If a CFG file ends with a new line character, babel will fail with the error:

(line x, column 1):
unexpected end of input
expecting space

where x is 1 + the number of lines in the CFG file.

Steps to replicate:

  1. Create a CFG file ending in a new line.
  2. Run babel with that CFG file as the grammar file input

Reasons this is an issue:
Many common text editors automatically append a new line to text files when they are done being edited.

Potential Solutions:
Check if a line consists of just a newline character and if so skip the parsing step
Strip the newline character off the end of the file

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.