Skip to content

Commit

Permalink
removes the volatile asm conflict
Browse files Browse the repository at this point in the history
No more conflicts
  • Loading branch information
ivg committed May 13, 2021
1 parent 6197b75 commit 103994d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontc/clexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ let keywords =
("signed", id SIGNED);
("unsigned", id UNSIGNED);
("volatile", id VOLATILE);
("inline", id INLINE);
("__restrict", id RESTRICT);
("restrict", id RESTRICT);
("char", id CHAR);
Expand Down
11 changes: 4 additions & 7 deletions frontc/cparser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ AND_EQ PIPE_EQ CIRC_EQ INF_INF_EQ SUP_SUP_EQ
%left PLUS MINUS
%left STAR SLASH PERCENT CONST VOLATILE RESTRICT
%right EXCLAM TILDE PLUS_PLUS MINUS_MINUS CAST RPAREN ADDROF
%left LBRACKET
%left LBRACKET
%left DOT ARROW LPAREN SIZEOF

/* Non-terminals informations */
Expand Down Expand Up @@ -970,12 +970,9 @@ statement:

/* "Basic asm" https://gcc.gnu.org/onlinedocs/gcc/Basic-Asm.html#Basic-Asm */
basic_asm:
ASM opt_gcc_attributes LPAREN string_list RPAREN
{ ASM $4 }
| ASM VOLATILE opt_gcc_attributes LPAREN string_list RPAREN
{ ASM $5 }
| ASM opt_gcc_attributes VOLATILE LPAREN string_list RPAREN
{ ASM $5 }
| ASM VOLATILE? opt_gcc_attributes LPAREN; asm=string_list; RPAREN
{ ASM asm }
;

/*** GNU asm ***/
gnu_asm_io: COLON gnu_asm_args { $2 };
Expand Down

0 comments on commit 103994d

Please sign in to comment.