GithubHelp home page GithubHelp logo

Optional Semicolons about bnfc HOT 5 OPEN

ScottFreeCode avatar ScottFreeCode commented on September 22, 2024
Optional Semicolons

from bnfc.

Comments (5)

andreasabel avatar andreasabel commented on September 22, 2024 2

There is work in progress by @beataburreau on a new implementation of BNFC where one has a newline special token.

from bnfc.

andreasabel avatar andreasabel commented on September 22, 2024 2

@praduca: There is same hard-writing in the render function of the generated printer biased towards "braces and semicolon" style languages. If you want some other rendering, you have to patch the generated printer.

from bnfc.

praduca avatar praduca commented on September 22, 2024 1

Ah good to know it is something simple. Thanks for commenting so quickly

from bnfc.

ScottFreeCode avatar ScottFreeCode commented on September 22, 2024

This is clearly not a dealbreaker, I could go with mandatory semicolons or figure out a way to use layout even if that seems opinionated.

But – the fact that the "\n" seems to be getting translated into the same thing as "" i.e. some whitepsace separation required but can be any space and prints as a single space, rather than either:

  • actually requiring and printing the specified character, or else
  • choking and saying "Don't include whitespace in your tokens!!"

…seems like a bug. Having the character I explicitly specified be accepted but treated as other characters, is definitely unexpected (or at least unintuitive) behavior.

from bnfc.

praduca avatar praduca commented on September 22, 2024

I think there is some bug about using semicolons somewhere... I'm trying to make a tinybasic grammar, but when i use a semicolon as a separator (like "PRINT A$;B$" ) it parses ok but the prettyprinter put every part on a different line. Changing the separator to a comma works fine...

from bnfc.

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.