Skip to content

Commit 216dd41

Browse files
committed
Update the D grammar
1 parent ca24449 commit 216dd41

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
path: dmd
5656
repository: dlang/dmd
57-
ref: 8c64740e6e1987357d1844e333fe64a04c227055
57+
ref: fb07d990466f185c2adb19d320627c2723d3978a
5858
persist-credentials: false
5959

6060
- name: Checkout JSONTestSuite

examples/d/grammard.ebnf

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Based on grammar from dlang.org commit 8501a0e5faf73a4e211a21d61333bb0de40de965
1+
// Based on grammar from dlang.org commit d74f36300c42568a6c6b22cab645184e223bfa73
22
33
import "grammardlex.ebnf";
44
SourceFile @start
@@ -304,6 +304,7 @@ PrimaryExpression @directUnwrap
304304
| <TypeidExpression
305305
| <IsExpression
306306
| <SpecialKeyword
307+
| <RvalueExpression
307308
| <TraitsExpression
308309
| <Vector
309310
| <PrimaryExpressionParen
@@ -460,6 +461,9 @@ TypeSpecialization
460461
| "module"
461462
| "package"
462463
;
464+
RvalueExpression
465+
= "__rvalue" "(" AssignExpression ")"
466+
;
463467
SpecialKeyword
464468
= "__FILE__"
465469
| "__FILE_FULL_PATH__"

examples/d/grammardlex.ebnf

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Based on grammar from dlang.org commit 8501a0e5faf73a4e211a21d61333bb0de40de965
1+
// Based on grammar from dlang.org commit d74f36300c42568a6c6b22cab645184e223bfa73
22
33
token ByteOrderMark
44
= "\uFEFF"
@@ -586,14 +586,15 @@ Keyword
586586
| "with"
587587
| "__FILE__"
588588
| "__FILE_FULL_PATH__"
589-
| "__MODULE__"
590-
| "__LINE__"
591589
| "__FUNCTION__"
590+
| "__LINE__"
591+
| "__MODULE__"
592592
| "__PRETTY_FUNCTION__"
593593
| "__gshared"
594+
| "__parameters"
595+
| "__rvalue"
594596
| "__traits"
595597
| "__vector"
596-
| "__parameters"
597598
;
598599
token SpecialTokenSequence @ignoreToken
599600
= "#" " "? "line" WS? IntegerLiteral WS? Filespec? WS? EndOfLine

examples/d/testgrammard.d

+2
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ immutable string[] syntaxErrorExceptions = [
209209
"expected as third argument of",
210210
"at least one argument expected",
211211
"`string` expected for pragma mangle argument, not",
212+
"bitfield symbol expected",
212213
];
213214

214215
immutable string[] syntaxErrorExtra = [
@@ -245,6 +246,7 @@ immutable string[] syntaxErrorExtra = [
245246
"token is not allowed in postfix position",
246247
"String postfixes on interpolated expression sequences are not allowed.",
247248
"use `{ }` for an empty statement, not `;`",
249+
"must have at least one member",
248250
];
249251

250252
size_t[syntaxErrorExceptions.length] syntaxErrorExceptionsUsed;

0 commit comments

Comments
 (0)