@@ -7,20 +7,20 @@ export default function grammar(){
7
7
// SUMMARY
8
8
// rules = 13
9
9
// udts = 0
10
- // opcodes = 62
10
+ // opcodes = 65
11
11
// --- ABNF original opcodes
12
- // ALT = 6
12
+ // ALT = 7
13
13
// CAT = 4
14
14
// REP = 5
15
- // RNM = 17
15
+ // RNM = 16
16
16
// TLS = 27
17
- // TBS = 0
18
- // TRG = 3
17
+ // TBS = 1
18
+ // TRG = 5
19
19
// --- SABNF superset opcodes
20
20
// UDT = 0
21
21
// AND = 0
22
22
// NOT = 0
23
- // characters = [33 - 126 ]
23
+ // characters = [0 - 1114111 ]
24
24
// ```
25
25
/* OBJECT IDENTIFIER (for internal parser use) */
26
26
this . grammarObject = 'grammarObject' ;
@@ -82,7 +82,10 @@ export default function grammar(){
82
82
/* template-expression-param-name */
83
83
this . rules [ 5 ] . opcodes = [ ] ;
84
84
this . rules [ 5 ] . opcodes [ 0 ] = { type : 3 , min : 1 , max : Infinity } ; // REP
85
- this . rules [ 5 ] . opcodes [ 1 ] = { type : 4 , index : 6 } ; // RNM(pchar)
85
+ this . rules [ 5 ] . opcodes [ 1 ] = { type : 1 , children : [ 2 , 3 , 4 ] } ; // ALT
86
+ this . rules [ 5 ] . opcodes [ 2 ] = { type : 5 , min : 0 , max : 121 } ; // TRG
87
+ this . rules [ 5 ] . opcodes [ 3 ] = { type : 6 , string : [ 124 ] } ; // TBS
88
+ this . rules [ 5 ] . opcodes [ 4 ] = { type : 5 , min : 126 , max : 1114111 } ; // TRG
86
89
87
90
/* pchar */
88
91
this . rules [ 6 ] . opcodes = [ ] ;
@@ -155,14 +158,16 @@ export default function grammar(){
155
158
str += "slash = \"/\"\n" ;
156
159
str += "path-literal = 1*pchar\n" ;
157
160
str += "template-expression = \"{\" template-expression-param-name \"}\"\n" ;
158
- str += "template-expression-param-name = 1*pchar \n" ;
161
+ str += "template-expression-param-name = 1*( %x00-79 / %x7C / %x7E-10FFFF ) ; every UTF8 character except { and } (from OpenAPI) \n" ;
159
162
str += "\n" ;
160
163
str += "; Characters definitions (from RFC 3986)\n" ;
161
164
str += "pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n" ;
162
165
str += "unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n" ;
163
166
str += "pct-encoded = \"%\" HEXDIG HEXDIG\n" ;
164
167
str += "sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n" ;
165
168
str += " / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n" ;
169
+ str += "\n" ;
170
+ str += "; Character definitions (from RFC 5234)\n" ;
166
171
str += "ALPHA = %x41-5A / %x61-7A ; A-Z / a-z\n" ;
167
172
str += "DIGIT = %x30-39 ; 0-9\n" ;
168
173
str += "HEXDIG = DIGIT / \"A\" / \"B\" / \"C\" / \"D\" / \"E\" / \"F\"\n" ;
0 commit comments