Skip to content

Commit

Permalink
Fix parsing of imports.
Browse files Browse the repository at this point in the history
- Fixed the Modelica parser so that it conforms to the Modelica syntax
  and rejects fully qualified imports.
  • Loading branch information
perost authored and OpenModelica-Hudson committed Sep 13, 2017
1 parent df8573f commit 5307f91
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Parser/Modelica.g
Expand Up @@ -1383,24 +1383,14 @@ name_path2 returns [void* ast]
;
name_path_star returns [void* ast, int unqual, void* lst]
@init{ dot = 0; np.lst = 0; np.unqual = 0; } :
(dot=DOT)? np=name_path_star2
{
$ast = dot ? Absyn__FULLYQUALIFIED(np.ast) : np.ast;
$unqual = np.unqual;
$lst = np.lst;
}
;
name_path_star2 returns [void* ast, int unqual, void* lst]
@init{ id = 0; uq = 0; mlst = 0; p.ast = 0; p.lst = 0; } :
{ LA(2) != DOT || LA(3) == LBRACE }? (id=IDENT|id=CODE) ( uq=STAR_EW | DOT LBRACE mlst=name_path_group RBRACE )?
{
$ast = Absyn__IDENT(token_to_scon(id));
$unqual = uq != 0;
$lst = mlst;
}
| (id=IDENT|id=CODE) DOT p=name_path_star2
| (id=IDENT|id=CODE) DOT p=name_path_star
{
$ast = Absyn__QUALIFIED(token_to_scon(id),p.ast);
$unqual = p.unqual;
Expand Down

0 comments on commit 5307f91

Please sign in to comment.