Skip to content

Commit f1e105e

Browse files
authored
Merge pull request #10 from JuliaPluto/fonsp-patch-1
2 parents 5e7e41d + 610cc71 commit f1e105e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/julia.grammar

+7-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ definition[@isGroup=Definition] {
137137
| PrimitiveDefinition { kwid<'primitive'> kwid<'type'> TypeHead IntegerLiteral end }
138138
| StructDefinition { kwid<'mutable'>? kw<'struct'> TypeHead (_t block?)? end } // TODO: Allow skipping terminator
139139
| ModuleDefinition { (kw<'module'> | kw<'baremodule'>) Identifier _t? block? end }
140-
| MacroDefinition { kw<'macro'> Signature { CallExpression } _t? block? end }
140+
| MacroDefinition {
141+
kw<'macro'>
142+
( Signature { Identifier }
143+
| Signature { CallExpression } _t? block?
144+
)
145+
end
146+
}
141147
| FunctionDefinition {
142148
kw<'function'>
143149
( Signature { Identifier }

test/definitions.txt

+7
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ macro count(args...); length(args) end
460460

461461
macro Mod.mac() end
462462

463+
macro wow end
464+
463465
==>
464466
Program(
465467
MacroDefinition(
@@ -478,5 +480,10 @@ Program(
478480
macro,
479481
Signature(CallExpression(FieldExpression(Identifier, Field(Identifier)), Arguments)),
480482
end
483+
),
484+
MacroDefinition(
485+
macro,
486+
Signature(Identifier),
487+
end
481488
)
482489
)

0 commit comments

Comments
 (0)