Skip to content

Commit 661fc79

Browse files
committed
langref: update grammar with c pointers
See #1059
1 parent 73e8e46 commit 661fc79

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

doc/langref.html.in

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8164,7 +8164,8 @@ ArrayTypeStart <- LBRACKET Expr? RBRACKET
81648164
PtrTypeStart
81658165
<- ASTERISK
81668166
/ ASTERISK2
8167-
/ LBRACKET ASTERISK RBRACKET
8167+
/ PTRUNKNOWN
8168+
/ PTRC
81688169

81698170
# ContainerDecl specific
81708171
ContainerDeclAuto <- ContainerDeclType LBRACE ContainerMembers RBRACE
@@ -8262,7 +8263,7 @@ LARROW2 <- '<<' ![=] skip
82628263
LARROW2EQUAL <- '<<=' skip
82638264
LARROWEQUAL <- '<=' skip
82648265
LBRACE <- '{' skip
8265-
LBRACKET <- '[' skip
8266+
LBRACKET <- '[' ![*] skip
82668267
LPAREN <- '(' skip
82678268
MINUS <- '-' ![%=>] skip
82688269
MINUSEQUAL <- '-=' skip
@@ -8279,6 +8280,8 @@ PLUS2 <- '++' skip
82798280
PLUSEQUAL <- '+=' skip
82808281
PLUSPERCENT <- '+%' ![=] skip
82818282
PLUSPERCENTEQUAL <- '+%=' skip
8283+
PTRC <- '[*c]' skip
8284+
PTRUNKNOWN <- '[*]' skip
82828285
QUESTIONMARK <- '?' skip
82838286
RARROW <- '>' ![>=] skip
82848287
RARROW2 <- '>>' ![=] skip

src/parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,8 +2778,8 @@ static AstNode *ast_parse_array_type_start(ParseContext *pc) {
27782778
// PtrTypeStart
27792779
// <- ASTERISK
27802780
// / ASTERISK2
2781-
// / LBRACKET ASTERISK RBRACKET
2782-
// / LBRACKET ASTERISK C RBRACKET
2781+
// / PTRUNKNOWN
2782+
// / PTRC
27832783
static AstNode *ast_parse_ptr_type_start(ParseContext *pc) {
27842784
Token *asterisk = eat_token_if(pc, TokenIdStar);
27852785
if (asterisk != nullptr) {

0 commit comments

Comments
 (0)