Giter VIP home page Giter VIP logo

language-grammars's Introduction

Syntax highlighting for meta-languages

Syntax highlighting for ABNF/BNF/EBNF, Yacc, and other language-related languages (โ€œmetalanguagesโ€). Ignore the other packages on Atom.io, this is the one you want to install.

Supported formats

Includes highlighting for embedded C/C++ source (Yacc/Lex files only).

Previews

ABNF:
Highlighted .abnf file

BNF:
Highlighted .bnf file

EBNF:
Highlighted .ebnf file

Lark:
Highlighted .lark file

Lex:
Highlighted .lex file

Yacc:
Highlighted .y file

language-grammars's People

Contributors

alhadis avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

language-grammars's Issues

Grammars clashing with Linguist

Woohoo!!! First issue!! ๐ŸŽ‰ ๐Ÿ˜

I'm in the process of preparing for Linguist 7.6.0 and I've just updated all the grammars and this repo, used by several grammars in Linguist, has been flagged by the grammar compiler:

The easy solution is to not bump the SHA for this submodule, but the two grammars at the top may be better than what we're already using in Linguist so maybe a few switcheroo PRs are needed for Linguist?

ABNF - rule allowing literal DQUOTE breaks highlighting

How do I specify a production rule allowing a literal DQUOTE?

For example, check out RFC 2045. They appear to use prose-val to specify a literal double quote <">, but it would seem that char-val otherwise allows """. Both options cause a "run-on" quoted string in the syntax highlighting (see screenshot).

The formal ABNF specification specifies:

char-val       =  DQUOTE *(%x20-21 / %x23-7E) DQUOTE
prose-val      =  "<" *(%x20-3D / %x3F-7E) ">"

Also, thanks a lot for making this!

image

Support for Lark-style EBNF

Lark is a parsing library for python. It's flavored EBNF files (.lark) needs syntax highlighting. The only difference between lark EBNF (which I'll refer to as LEBNF) and EBNF is that LEBNF's comments are js-style, without multi-line comment support, brackets denote optional groups, a ? and/or ! are operators that may appear before the definition of a rule or TERMINAL, priority, denoted by TERMINAL.number, is a thing, and it has %import, %ignore, and %declare statements.

Detailed grammar reference can be found here

Would you modify EBNF.cson, and turn it to LEBNF.cson, please? I have no idea on how to write an atom grammar (I find it poorly documented on atom.io)

ebnf.cson has invalid regexes

๐Ÿ‘‹ I'm in the process of updating the grammars for v7.15.0 and noticed the source.ebnf grammar now has invalid regexes:

- [ ] repository `vendor/grammars/language-grammars` (from https://github.com/Alhadis/language-grammars) (2 errors)
    - [ ] Invalid regex in grammar: `source.ebnf` (in `grammars/ebnf.cson`) contains a malformed regex (regex "`"(?!")|(?=^\s+*\S+?\s+::{0,2}=\s`...": nothing to repeat (at offset 14))
    - [ ] Invalid regex in grammar: `source.ebnf` (in `grammars/ebnf.cson`) contains a malformed regex (regex "`'(?!')|(?=^\s+*\S+?\s+::{0,2}=\s`...": nothing to repeat (at offset 14))

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.