Updated grammar, and 0.7.10 first commit

This commit is contained in:
Christoffer Lerno
2026-01-30 21:59:20 +01:00
parent 161280ce7d
commit 10d369d766
4 changed files with 35 additions and 25 deletions

View File

@@ -1,5 +1,12 @@
# C3C Release Notes
## 0.7.10 Change list
### Changes / improvements
### Stdlib changes
### Fixes
## 0.7.9 Change list

View File

@@ -96,6 +96,10 @@ typedef struct {
"$varef" { return(CT_VAREF); }
"$vasplat" { return(CT_VASPLAT); }
"$vatype" { return(CT_VATYPE); }
"@pure" { return(AT_PURE); }
"@inline" { return(AT_INLINE); }
"@noinline" { return(AT_NOINLINE); }
"/*" { BEGIN(COMMENT); }
<COMMENT>{
"/*" { yyg->yyextra_r.comment_level++; }

View File

@@ -35,7 +35,7 @@ void yyerror(YYLTYPE * yylloc_param , yyscan_t yyscanner, const char *yymsgp);
%token CT_SIZEOF CT_STRINGIFY CT_QNAMEOF CT_OFFSETOF CT_VAEXPR CT_FEATURE
%token CT_EXTNAMEOF CT_EVAL CT_DEFINED CT_ALIGNOF ASSERT
%token ASM CHAR_LITERAL REAL TRUE FALSE CT_CONST_IDENT
%token HASH_CONST_IDENT CT_ASSIGNABLE CT_AND CT_IS_CONST
%token HASH_CONST_IDENT CT_ASSIGNABLE CT_AND CT_IS_CONST AT_INLINE AT_PURE AT_NOINLINE
%start translation_unit
%%
@@ -443,6 +443,11 @@ parameter
| CT_IDENT ELLIPSIS
;
opt_call_attributes
: call_inline_attributes
| empty
;
opt_attributes
: attribute_list
| empty
@@ -623,13 +628,18 @@ range_expr
;
call_inline_attributes
: AT_IDENT
| call_inline_attributes AT_IDENT
: call_attribute
| call_inline_attributes call_attribute
;
call_attribute
: AT_INLINE
| AT_PURE
| AT_NOINLINE
;
call_invocation
: '(' call_arg_list ')'
| '(' call_arg_list ')' call_inline_attributes
: '(' call_arg_list ')' opt_call_attributes
;
access_ident
@@ -652,6 +662,7 @@ call_trailing
| '.' access_ident
| INC_OP
| DEC_OP
| '~'
| '!'
| BANGBANG
;
@@ -805,31 +816,19 @@ or_stmt_expr
| or_stmt_expr CT_OR_OP and_expr
;
suffix_expr
: or_expr
| or_expr '?'
| or_expr '?' '!'
;
suffix_stmt_expr
: or_stmt_expr
| or_stmt_expr '?'
| or_stmt_expr '?' '!'
;
ternary_expr
: suffix_expr
: or_expr
| or_expr '?' expr ':' ternary_expr
| suffix_expr ELVIS ternary_expr
| suffix_expr OPTELSE ternary_expr
| or_expr ELVIS ternary_expr
| or_expr OPTELSE ternary_expr
| lambda_decl implies_body
;
ternary_stmt_expr
: suffix_stmt_expr
: or_stmt_expr
| or_stmt_expr '?' expr ':' ternary_expr
| suffix_stmt_expr ELVIS ternary_expr
| suffix_stmt_expr OPTELSE ternary_expr
| or_stmt_expr ELVIS ternary_expr
| or_stmt_expr OPTELSE ternary_expr
| lambda_decl implies_body
;

View File

@@ -1,2 +1,2 @@
#define COMPILER_VERSION "0.7.9"
#define PRERELEASE 0
#define COMPILER_VERSION "0.7.10"
#define PRERELEASE 1