Giter Site home page Giter Site logo

Comments (8)

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

This is not correct.

Not all *.config files are Rebar configuration files. There are reltool.config, sys.config, etc. So this files should not be marked as "rebar" unless it's "rebar.config" in particular.

It's not tuples. It could be anything that file:consult parses. file.consult parses list of dot terminated terms not tuples:

a.
[x,y].
{z}.     

file:consult("x.conf").
{ok,[a,[x,y],{z}]}

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

Those are not Erlang files. Those are files with Erlang terms. Current BNF allows expressions like {2+2}. It wont be parsed by file:consult.

I believe for this type of files there should be whole another grammar.

from intellij-erlang.

ignatov avatar ignatov commented on July 17, 2024

OK, but at the moment I think that is better to highlight those files. Thought?

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

Yes. But as it implemented now it erroneously highlight errors in correct files:

x.

and does not highlight errors with 'correct Erlang':

f() -> x.

And it's not rebar:)

from intellij-erlang.

ignatov avatar ignatov commented on July 17, 2024

So, if I now change the grammar to

root ::= form *
form ::= (is_app_config expression) | (!is_app_config erlang_form)
erlang_form ::= function | rule | record_definition | include | macros_definition | attribute

it'll be OK?

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

It will allow different kinds of expressions (try, send, assignment, arithmetical) in there which is not allowed by file:consult. There should be terms, not expressions. The only things allowed there are unary '+' and unary '-'.
See https://github.com/erlang/otp/blob/maint/lib/stdlib/src/erl_parse.yrl parse_term() and normalize().

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

one other thing - there could be comments inside. This one is perfectly fine

{
    x, 
%aaaaa
    y %xxxxxxx
}.

from intellij-erlang.

vovakyrychenko avatar vovakyrychenko commented on July 17, 2024

BTW there are community provided erlang file types in intellij platform - can you make some moves to make these config go away? They're kinda conflicting with plugin making wrong icons to be shown sometimes.

from intellij-erlang.

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.