LPCIC / elpi

Embeddable Lambda Prolog Interpreter
GNU Lesser General Public License v2.1
290 stars 36 forks source link

[compiler] flatten commas AST #270

Closed FissoreD closed 3 weeks ago

FissoreD commented 1 month ago

The term: p :- (true, true), (true,true). produces the ast:

  (app
    [const :-, const p, 
     app [const ,, app [const ,, const true, const true], const true, const true]]), 

Note that we have the subterm app [COMMA, app [COMMA, true, true], true, true] With this PR the compiler flattens the term and produces instead:

 (app
    [const :-, const p, 
     app [const ,, const true, const true, const true, const true]), 

The same subterm is now: app [COMMA, true, true, true, true]