Skip to content

Commit 443f61d

Browse files
Added support for unsigned and variable integer types.
1 parent 37d53fe commit 443f61d

File tree

1 file changed

+214
-11
lines changed

1 file changed

+214
-11
lines changed

syntaxes/slice.tmLanguage.json

Lines changed: 214 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,34 @@
14551455
}
14561456
]
14571457
},
1458+
{
1459+
"name": "meta.ushort.slice",
1460+
"begin": "\\\\?\\bushort\\b\\s*\\??",
1461+
"end": "(;)|((?=}))",
1462+
"beginCaptures": {
1463+
"0": {"patterns": [{"include": "#storage.types"}]}
1464+
},
1465+
"endCaptures": {
1466+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1467+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1468+
},
1469+
"patterns": [
1470+
{"include": "#standard"},
1471+
{
1472+
"begin": "\\\\?\\b\\w+\\b",
1473+
"end": "(?=;|})",
1474+
"beginCaptures": {
1475+
"0": {
1476+
"name": "entity.name.ushort.slice",
1477+
"patterns": [{"include": "#storage.identifier"}]
1478+
}
1479+
},
1480+
"patterns": [
1481+
{"include": "#storage.basic.assignment"}
1482+
]
1483+
}
1484+
]
1485+
},
14581486
{
14591487
"name": "meta.int.slice",
14601488
"begin": "\\\\?\\bint\\b\\s*\\??",
@@ -1483,6 +1511,90 @@
14831511
}
14841512
]
14851513
},
1514+
{
1515+
"name": "meta.uint.slice",
1516+
"begin": "\\\\?\\buint\\b\\s*\\??",
1517+
"end": "(;)|((?=}))",
1518+
"beginCaptures": {
1519+
"0": {"patterns": [{"include": "#storage.types"}]}
1520+
},
1521+
"endCaptures": {
1522+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1523+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1524+
},
1525+
"patterns": [
1526+
{"include": "#standard"},
1527+
{
1528+
"begin": "\\\\?\\b\\w+\\b",
1529+
"end": "(?=;|})",
1530+
"beginCaptures": {
1531+
"0": {
1532+
"name": "entity.name.uint.slice",
1533+
"patterns": [{"include": "#storage.identifier"}]
1534+
}
1535+
},
1536+
"patterns": [
1537+
{"include": "#storage.basic.assignment"}
1538+
]
1539+
}
1540+
]
1541+
},
1542+
{
1543+
"name": "meta.varint.slice",
1544+
"begin": "\\\\?\\bvarint\\b\\s*\\??",
1545+
"end": "(;)|((?=}))",
1546+
"beginCaptures": {
1547+
"0": {"patterns": [{"include": "#storage.types"}]}
1548+
},
1549+
"endCaptures": {
1550+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1551+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1552+
},
1553+
"patterns": [
1554+
{"include": "#standard"},
1555+
{
1556+
"begin": "\\\\?\\b\\w+\\b",
1557+
"end": "(?=;|})",
1558+
"beginCaptures": {
1559+
"0": {
1560+
"name": "entity.name.varint.slice",
1561+
"patterns": [{"include": "#storage.identifier"}]
1562+
}
1563+
},
1564+
"patterns": [
1565+
{"include": "#storage.basic.assignment"}
1566+
]
1567+
}
1568+
]
1569+
},
1570+
{
1571+
"name": "meta.varuint.slice",
1572+
"begin": "\\\\?\\bvaruint\\b\\s*\\??",
1573+
"end": "(;)|((?=}))",
1574+
"beginCaptures": {
1575+
"0": {"patterns": [{"include": "#storage.types"}]}
1576+
},
1577+
"endCaptures": {
1578+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1579+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1580+
},
1581+
"patterns": [
1582+
{"include": "#standard"},
1583+
{
1584+
"begin": "\\\\?\\b\\w+\\b",
1585+
"end": "(?=;|})",
1586+
"beginCaptures": {
1587+
"0": {
1588+
"name": "entity.name.varuint.slice",
1589+
"patterns": [{"include": "#storage.identifier"}]
1590+
}
1591+
},
1592+
"patterns": [
1593+
{"include": "#storage.basic.assignment"}
1594+
]
1595+
}
1596+
]
1597+
},
14861598
{
14871599
"name": "meta.long.slice",
14881600
"begin": "\\\\?\\blong\\b\\s*\\??",
@@ -1511,6 +1623,90 @@
15111623
}
15121624
]
15131625
},
1626+
{
1627+
"name": "meta.ulong.slice",
1628+
"begin": "\\\\?\\bulong\\b\\s*\\??",
1629+
"end": "(;)|((?=}))",
1630+
"beginCaptures": {
1631+
"0": {"patterns": [{"include": "#storage.types"}]}
1632+
},
1633+
"endCaptures": {
1634+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1635+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1636+
},
1637+
"patterns": [
1638+
{"include": "#standard"},
1639+
{
1640+
"begin": "\\\\?\\b\\w+\\b",
1641+
"end": "(?=;|})",
1642+
"beginCaptures": {
1643+
"0": {
1644+
"name": "entity.name.ulong.slice",
1645+
"patterns": [{"include": "#storage.identifier"}]
1646+
}
1647+
},
1648+
"patterns": [
1649+
{"include": "#storage.basic.assignment"}
1650+
]
1651+
}
1652+
]
1653+
},
1654+
{
1655+
"name": "meta.varlong.slice",
1656+
"begin": "\\\\?\\bvarlong\\b\\s*\\??",
1657+
"end": "(;)|((?=}))",
1658+
"beginCaptures": {
1659+
"0": {"patterns": [{"include": "#storage.types"}]}
1660+
},
1661+
"endCaptures": {
1662+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1663+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1664+
},
1665+
"patterns": [
1666+
{"include": "#standard"},
1667+
{
1668+
"begin": "\\\\?\\b\\w+\\b",
1669+
"end": "(?=;|})",
1670+
"beginCaptures": {
1671+
"0": {
1672+
"name": "entity.name.varlong.slice",
1673+
"patterns": [{"include": "#storage.identifier"}]
1674+
}
1675+
},
1676+
"patterns": [
1677+
{"include": "#storage.basic.assignment"}
1678+
]
1679+
}
1680+
]
1681+
},
1682+
{
1683+
"name": "meta.varulong.slice",
1684+
"begin": "\\\\?\\bvarulong\\b\\s*\\??",
1685+
"end": "(;)|((?=}))",
1686+
"beginCaptures": {
1687+
"0": {"patterns": [{"include": "#storage.types"}]}
1688+
},
1689+
"endCaptures": {
1690+
"1": {"name": "punctuation.terminator.semicolon.slice"},
1691+
"2": {"name": "invalid.illegal.missing.semicolon.slice"}
1692+
},
1693+
"patterns": [
1694+
{"include": "#standard"},
1695+
{
1696+
"begin": "\\\\?\\b\\w+\\b",
1697+
"end": "(?=;|})",
1698+
"beginCaptures": {
1699+
"0": {
1700+
"name": "entity.name.varulong.slice",
1701+
"patterns": [{"include": "#storage.identifier"}]
1702+
}
1703+
},
1704+
"patterns": [
1705+
{"include": "#storage.basic.assignment"}
1706+
]
1707+
}
1708+
]
1709+
},
15141710
{
15151711
"name": "meta.float.slice",
15161712
"begin": "\\\\?\\bfloat\\b\\s*\\??",
@@ -1644,21 +1840,28 @@
16441840
"storage.types": {
16451841
"patterns": [
16461842
{
1647-
"match": "(\\\\)?\\b(?:(bool)|(byte)|(short)|(int)|(long)|(float)|(double)|(string)|(Object)|(LocalObject)|(Value))\\b\\s*(\\?)?",
1843+
"match": "(\\\\)?\\b(?:(bool)|(byte)|(short)|(ushort)|(int)|(uint)|(varint)|(varuint)|(long)|(ulong)|(varlong)|(varulong)|(float)|(double)|(string)|(Object)|(LocalObject)|(Value))\\b\\s*(\\?)?",
16481844
"captures": {
16491845
"1": {"name": "punctuation.escape.backslash.slice"},
16501846
"2": {"name": "storage.type.bool.slice"},
16511847
"3": {"name": "storage.type.byte.slice"},
16521848
"4": {"name": "storage.type.short.slice"},
1653-
"5": {"name": "storage.type.int.slice"},
1654-
"6": {"name": "storage.type.long.slice"},
1655-
"7": {"name": "storage.type.float.slice"},
1656-
"8": {"name": "storage.type.double.slice"},
1657-
"9": {"name": "storage.type.string.slice"},
1658-
"10": {"name": "storage.type.object.slice"},
1659-
"11": {"name": "storage.type.localobject.slice"},
1660-
"12": {"name": "storage.type.value.slice"},
1661-
"13": {"name": "punctuation.storage.modifier.optional.slice"}
1849+
"5": {"name": "storage.type.ushort.slice"},
1850+
"6": {"name": "storage.type.int.slice"},
1851+
"7": {"name": "storage.type.uint.slice"},
1852+
"8": {"name": "storage.type.varint.slice"},
1853+
"9": {"name": "storage.type.varuint.slice"},
1854+
"10": {"name": "storage.type.long.slice"},
1855+
"11": {"name": "storage.type.ulong.slice"},
1856+
"12": {"name": "storage.type.varlong.slice"},
1857+
"13": {"name": "storage.type.varulong.slice"},
1858+
"14": {"name": "storage.type.float.slice"},
1859+
"15": {"name": "storage.type.double.slice"},
1860+
"16": {"name": "storage.type.string.slice"},
1861+
"17": {"name": "storage.type.object.slice"},
1862+
"18": {"name": "storage.type.localobject.slice"},
1863+
"19": {"name": "storage.type.value.slice"},
1864+
"20": {"name": "punctuation.storage.modifier.optional.slice"}
16621865
}
16631866
},
16641867
{"include": "#storage.types.custom"}
@@ -1748,7 +1951,7 @@
17481951
"patterns": [
17491952
{
17501953
"name": "invalid.illegal.reserved.identifier.slice",
1751-
"match": "(?<!\\\\)\\b(?:bool|byte|class|const|dictionary|double|enum|exception|extends|false|float|idempotent|implements|int|interface|local|LocalObject|long|module|Object|optional|out|sequence|short|string|struct|tag|throws|true|Value|void)\\b"
1954+
"match": "(?<!\\\\)\\b(?:bool|byte|class|const|dictionary|double|enum|exception|extends|false|float|idempotent|implements|int|interface|local|LocalObject|long|module|Object|optional|out|sequence|short|string|struct|tag|throws|true|uint|ulong|ushort|Value|varuint|varulong|void)\\b"
17521955
},
17531956
{
17541957
"match": "(\\\\)?\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",

0 commit comments

Comments
 (0)