File tree Expand file tree Collapse file tree 4 files changed +641
-731
lines changed Expand file tree Collapse file tree 4 files changed +641
-731
lines changed Original file line number Diff line number Diff line change 1212 var data = ParsedData();
1313
1414 int parseInt(str){
15- return int.parse (str);
15+ return int.tryParse (str) ?? null ;
1616 }
1717
1818 double parseFloat(str){
@@ -396,7 +396,7 @@ SIP_URI <- uri_scheme ":" userinfo? hostport uri_parameters headers? {
396396 $$ == -1;
397397 }}
398398
399- uri_scheme <- ( uri_scheme_sips / uri_scheme_sip)
399+ uri_scheme <- uri_scheme_sips / uri_scheme_sip
400400
401401uri_scheme_sips <- scheme: "sips"i {
402402 data.scheme = scheme.toLowerCase(); }
@@ -426,7 +426,7 @@ host <- ( hostname / IPv4address / IPv6reference ) {
426426## 'hostname' grammar is relaxed from RFC 3261:
427427## 'domainlabel' and 'toplabel' can end with dash or hypen
428428
429- hostname <- ((( domainlabel "." )* toplabel "." ?) / token ) {
429+ hostname <- (( domainlabel "." )* toplabel "." ?) {
430430 data.host = _text().toLowerCase();
431431 data.host_type = 'domain';
432432 var result = {};
@@ -1095,8 +1095,9 @@ via_branch <- "branch"i EQUAL via_branch: token {
10951095 }
10961096
10971097response_port <- "rport"i EQUAL (response_port: (DIGIT ? DIGIT ? DIGIT ? DIGIT ? DIGIT ?) )? {
1098- if(response_port != null)
1099- data.rport = parseInt(response_port.join(''));
1098+ if(response_port != null) {
1099+ data.rport = parseInt(response_port.map((e) => e ?? '').join(''));
1100+ }
11001101 }
11011102
11021103
You can’t perform that action at this time.
0 commit comments