forked from mfederczuk/w3c-ebnf-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snippets.code-snippets
102 lines (96 loc) · 3.54 KB
/
snippets.code-snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Some rule definitions are copied from the XML 1.0 (fifth edition) specification document;
*
* Copyright (c) 2015 W3C(R) (MIT, ERCIM, Keio, Beihang). This software or document includes material copied from or derived from Extensible Markup Language (XML) 1.0 (Fifth Edition) <https://www.w3.org/TR/2008/REC-xml-20081126/>.
* Copyright (c) 2008 World Wide Web Consortium, (MIT, ERCIM, Keio, Beihang). http://www.w3.org/Consortium/Legal/2015/doc-license
*
* The rest of this file is licensed under: SPDX-License-Identifier: CC0-1.0
*/
{
"Null Escape Character": {
"scope": "w3c-ebnf",
"prefix": ["\\0", "null"],
"body": "#x0",
"description": "Inserts the escape sequence for the ASCII Null character"
},
"Horizontal Tab Escape Character": {
"scope": "w3c-ebnf",
"prefix": ["\\t", "horizontal_tab", "tab"],
"body": "#x9",
"description": "Inserts the escape sequence for the ASCII Horizontal Tab character"
},
"Newline Escape Character": {
"scope": "w3c-ebnf",
"prefix": ["\\n", "newline"],
"body": "#xA",
"description": "Inserts the escape sequence for the ASCII Newline character"
},
"Carriage Return Escape Character": {
"scope": "w3c-ebnf",
"prefix": ["\\r", "carriage_return"],
"body": "#xD",
"description": "Inserts the escape sequence for the ASCII Carriage Return character"
},
"Rule Template": {
"scope": "w3c-ebnf",
"prefix": "rule",
"body": "${1:Name} ::= ${2:expression}",
"description": "Inserts a basic template for a rule"
},
"Binary Digits Rule": {
"scope": "w3c-ebnf",
"prefix": "binary_digits",
"body": "${1:BinaryDigits} ::= [01]",
"description": "Inserts a rule for base-2 digits"
},
"Octal Digits Rule": {
"scope": "w3c-ebnf",
"prefix": "octal_digits",
"body": "${1:OctalDigits} ::= [0-7]",
"description": "Inserts a rule for base-8 digits"
},
"Decimal/Denary Digits Rule": {
"scope": "w3c-ebnf",
"prefix": ["denary_digits", "decimal_digits", "digits"],
"body": "${1:Digits} ::= [0-9]",
"description": "Inserts a rule for base-10 digits"
},
"Hexadecimal Digits Rule": {
"scope": "w3c-ebnf",
"prefix": "hex_digits",
"body": "${1:HexDigits} ::= [0-9a-fA-F]",
"description": "Inserts a rule for base-16 digits"
},
"End of Line Rule": {
"scope": "w3c-ebnf",
"prefix": "eol",
"body": "${1:Eol} ::= #xD? #xA | #xD",
"description": "Inserts a rule for and end of line"
},
"ASCII Character Rule": {
"scope": "w3c-ebnf",
"prefix": "ascii_char",
"body": "${1:Char} ::= [#x0-#x7F]",
"description": "Inserts a rule for any ASCII character"
},
"ASCII Control Character Rule": {
"scope": "w3c-ebnf",
"prefix": "ascii_control",
"body": "${1:AsciiControlChar} ::= [#x0-#x1F] | #x7F",
"description": "Inserts a rule for any ASCII control character (includes whitespace characters and the 0x7F delete character)"
},
"ASCII Whitespace Character Rule": {
"scope": "w3c-ebnf",
"prefix": ["ascii_whitespace", "whitespace"],
// copied from the XML spec with tiny changes; changed #x20 to ' ' and removed the parenthesis and the trailing +
"body": "${1:S} ::= ' ' | #x9 | #xA | #xD",
"description": "Inserts a rule for any ASCII whitespace character"
},
"Unicode Character Rule": {
"scope": "w3c-ebnf",
"prefix": "unicode_char",
// copied 1:1 from the XML spec
"body": "${1:Char} ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */",
"description": "Inserts a rule for any Unicode character, excluding some ASCII control characters and Unicode surrogate blocks"
}
}