File tree 2 files changed +47
-0
lines changed
2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 22
22
<secondary-label id =" wip" name =" WIP" color =" red" >Work in progress</secondary-label >
23
23
<secondary-label id =" beta" name =" β" color =" tangerine" >Beta</secondary-label >
24
24
<secondary-label id =" 1.1" name =" TypeLang 1.1" color =" strawberry" >Since type-lang/parser v1.1</secondary-label >
25
+ <secondary-label id =" 1.2" name =" TypeLang 1.2" color =" strawberry" >Since type-lang/parser v1.2</secondary-label >
25
26
</labels >
Original file line number Diff line number Diff line change @@ -231,3 +231,49 @@ _before the type_ or _before the parameter name._
231
231
232
232
</tab>
233
233
</tabs>
234
+
235
+
236
+ ## Attributes
237
+
238
+ <secondary-label ref="1.2"/>
239
+
240
+ Each callable parameter allows you to define list of additional attributes.
241
+ An attribute is additional metadata for a parameter.
242
+
243
+ <tabs>
244
+ <tab title="Examples">
245
+
246
+ > Simple attribute with one argument for each callable parameter.
247
+ > ` ` ` typescript
248
+ > Example \Functor (#[type < int8 > ] int $a ): void
249
+ > ` ` `
250
+
251
+ > Multiple attributes in one group.
252
+ > ` ` ` typescript
253
+ > Example \Functor (#[type < int8 > , const ] int & ): void
254
+ > ` ` `
255
+
256
+ > Multiple attribute groups.
257
+ > ` ` ` typescript
258
+ > Example \OnCreate (
259
+ > #[deprecated ]
260
+ > #[inline ]
261
+ > (callback (T ): void ) $callback = ,
262
+ > ): void
263
+ > ` ` `
264
+
265
+ </tab>
266
+ <tab title="Counterexamples">
267
+
268
+ > Only valid identifiers are allowed.
269
+ > ` ` ` typescript
270
+ > Example \Functor (#[42 ] int $a ): void
271
+ > ` ` `
272
+ > ` ` `
273
+ > Syntax error , unexpected " 42"
274
+ > ` ` `
275
+ > {collapsible="true" collapsed-title="TypeLang\P arser\E xception\P arseException"}
276
+ > {style="warning"}
277
+
278
+ </tab>
279
+ </tabs>
You can’t perform that action at this time.
0 commit comments