Skip to content

Commit c5d26e4

Browse files
oderskynicolasstucki
authored andcommitted
Change id syntax
1 parent 25ad52f commit c5d26e4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/docs/internals/syntax.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ escape ::= ‘$$’
7777
| ‘{’ Block [‘;’ whiteSpace stringFormat whiteSpace] ‘}’
7878
stringFormat ::= {printableChar \ (‘"’ | ‘}’ | ‘ ’ | ‘\t’ | ‘\n’)}
7979
80-
symbolLiteral ::= ‘'’ plainid
80+
symbolLiteral ::= ‘'’ plainid // until 2.13
81+
quoteId ::= ‘'’ plainid // from 3.1
82+
spliceId ::= '$' plainid
8183
8284
comment ::= ‘/*’ “any sequence of characters; nested comments are allowed” ‘*/’
8385
| ‘//’ “any sequence of characters up to end of line”
@@ -158,7 +160,8 @@ SimpleType ::= SimpleType TypeArgs
158160
| ‘_’ SubtypeBounds
159161
| Refinement RefinedTypeTree(EmptyTree, refinement)
160162
| SimpleLiteral SingletonTypeTree(l)
161-
| ‘$’ (id | ‘{’ Block ‘}’)
163+
| spliceId // only inside quotes
164+
| ‘$’ ‘{’ Block ‘}’
162165
ArgTypes ::= Type {‘,’ Type}
163166
| NamedTypeArg {‘,’ NamedTypeArg}
164167
FunArgType ::= Type
@@ -208,9 +211,11 @@ InfixExpr ::= PrefixExpr
208211
PrefixExpr ::= [‘-’ | ‘+’ | ‘~’ | ‘!’] SimpleExpr PrefixOp(expr, op)
209212
SimpleExpr ::= ‘new’ (ConstrApp [TemplateBody] | TemplateBody) New(constr | templ)
210213
| BlockExpr
211-
| ‘'’ (id | ‘{’ Block ‘}’)
214+
| ‘'’ ‘{’ Block ‘}’
212215
| ‘'’ ‘[’ Type ‘]’
213-
| ‘$’ (id | ‘{’ Block ‘}’)
216+
| ‘$’ ‘{’ Block ‘}’
217+
| spliceId // only inside quotes
218+
| quoteId // only inside splices
214219
| SimpleExpr1 [‘_’] PostfixOp(expr, _)
215220
SimpleExpr1 ::= Literal
216221
| Path

0 commit comments

Comments
 (0)