Skip to content

Commit e7588a8

Browse files
authored
Merge pull request #120 from marler8997/cWideStringLiterals
fix c grammar for wide string literals
2 parents 984ba86 + 29ece43 commit e7588a8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

grammars/c/c.peg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ JumpStatement
313313
#-------------------------------------------------------------------------
314314

315315
PrimaryExpression
316-
<- Identifier
316+
<- StringLiteral
317317
/ Constant
318-
/ StringLiteral
318+
/ Identifier
319319
/ LPAR Expression RPAR
320320

321321
PostfixExpression

grammars/c/c_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,7 @@ func TestCParsing_Long(t *testing.T) {
202202
}
203203
walk("c/")
204204
}
205+
206+
func TestCParsing_WideString(t *testing.T) {
207+
parseC_4t(t, `wchar_t *msg = L"Hello";`);
208+
}

0 commit comments

Comments
 (0)