Skip to content

Commit 4080999

Browse files
committed
Add offset feature toggling documentation
1 parent bfd3211 commit 4080999

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Writerside/labels.list

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343

4444
<secondary-label id="wip" name="WIP" color="red">Work in progress</secondary-label>
4545
<secondary-label id="beta" name="β" color="tangerine">Beta</secondary-label>
46-
<secondary-label id="tl1.1" name="Parser v1.1" color="strawberry">Available in type-lang/parser 1.1+</secondary-label>
47-
<secondary-label id="tl1.2" name="Parser v1.2" color="strawberry">Available in type-lang/parser 1.2+</secondary-label>
48-
<secondary-label id="tl1.4" name="Parser v1.4" color="strawberry">Available in type-lang/parser 1.4+</secondary-label>
49-
<secondary-label id="r1.1" name="Available in Reader v1.1" color="strawberry">Available in type-lang/reader 1.1+</secondary-label>
46+
<secondary-label id="tl1.1" name="parser v1.1" color="strawberry">Available since type-lang/parser 1.1+</secondary-label>
47+
<secondary-label id="tl1.2" name="parser v1.2" color="strawberry">Available since type-lang/parser 1.2+</secondary-label>
48+
<secondary-label id="tl1.4" name="parser v1.4" color="strawberry">Available since type-lang/parser 1.4+</secondary-label>
49+
<secondary-label id="r1.1" name="reader v1.1" color="strawberry">Available since type-lang/reader 1.1+</secondary-label>
5050
</labels>

Writerside/topics/parser/features.md

+20
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ Square bracket list types not allowed in "Example[]"
8686
```
8787
{collapsible="true" collapsed-title="TypeLang\Parser\Exception\ParseException"}
8888

89+
## Offsets
90+
91+
<secondary-label ref="tl1.4"/>
92+
93+
To enable or disable type offsets, use the `offsets: bool` flag.
94+
95+
```php
96+
$parser = new TypeLang\Parser\Parser(
97+
offsets: false,
98+
);
99+
100+
$result = $parser->parse('Example[Type]');
101+
```
102+
103+
```
104+
Type offsets not allowed in "Example[Type]"
105+
```
106+
{collapsible="true" collapsed-title="TypeLang\Parser\Exception\ParseException"}
107+
108+
89109
## Callables
90110

91111
To enable or disable callables (delegates), use the `callables: bool` flag.

0 commit comments

Comments
 (0)