commit c46ccba8c2ad085e053b47b694551a1a6b1b7744
parent 87e116b94bf3b81d125c25987848f9151984a0fa
Author: erai <erai@omiltem.net>
Date: Wed, 20 Nov 2024 23:07:02 -0500
require func in front of functions
Diffstat:
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/cc0.c b/cc0.c
@@ -6732,14 +6732,8 @@ unsigned long( my_peg_P_func)(struct my_peg* my_c){
unsigned long( my_peg_P_func_decl)(struct my_peg* my_c){
unsigned long my_ok = 0;
(my_enter)((my_c),(my_P_func_decl));
- (my_choice)((my_c));
(my_ok)=((my_literal)((my_c),((unsigned char *)"func")));
if (my_ok) {
- (my_commit)((my_c));
- } else {
- (my_ok)=(1UL);
- }
- if (my_ok) {
(my_ok)=((my_peg_P_sp)((my_c)));
}
if (my_ok) {
diff --git a/cc3.peg b/cc3.peg
@@ -7,7 +7,7 @@ member_decl <- ident sp ':' sp type ';' sp
struct_decl <- struct sp ident sp '{' sp member_decl* '}' sp
union_decl <- union sp ident sp '{' sp member_decl* '}' sp
-func_decl <- 'func'? sp ident sp func_type (';' sp / compound_stmt)
+func_decl <- 'func' sp ident sp func_type (';' sp / compound_stmt)
type <- ident sp / byte sp / int sp / void sp
/ func sp func_type / ptr_type / '(' sp type ')' sp