@@ -7,7 +7,7 @@ use crate::{
77 body_parser:: { diagnostics, reader:: Reader , state:: State , unicode, unicode_property} ,
88 options:: ParserOptions ,
99 span:: SpanFactory ,
10- surroage_pair ,
10+ surrogate_pair ,
1111} ;
1212
1313pub struct PatternParser < ' a > {
@@ -1848,14 +1848,15 @@ impl<'a> PatternParser<'a> {
18481848 let span_start = self . reader . offset ( ) ;
18491849
18501850 if let Some ( lead_surrogate) =
1851- self . reader . peek ( ) . filter ( |& cp| surroage_pair :: is_lead_surrogate ( cp) )
1851+ self . reader . peek ( ) . filter ( |& cp| surrogate_pair :: is_lead_surrogate ( cp) )
18521852 {
18531853 if let Some ( trail_surrogate) =
1854- self . reader . peek2 ( ) . filter ( |& cp| surroage_pair :: is_trail_surrogate ( cp) )
1854+ self . reader . peek2 ( ) . filter ( |& cp| surrogate_pair :: is_trail_surrogate ( cp) )
18551855 {
18561856 self . reader . advance ( ) ;
18571857 self . reader . advance ( ) ;
1858- let cp = surroage_pair:: combine_surrogate_pair ( lead_surrogate, trail_surrogate) ;
1858+ let cp =
1859+ surrogate_pair:: combine_surrogate_pair ( lead_surrogate, trail_surrogate) ;
18591860
18601861 // [SS:EE] RegExpIdentifierStart :: UnicodeLeadSurrogate UnicodeTrailSurrogate
18611862 // It is a Syntax Error if the RegExpIdentifierCodePoint of RegExpIdentifierStart is not matched by the UnicodeIDStart lexical grammar production.
@@ -1908,15 +1909,16 @@ impl<'a> PatternParser<'a> {
19081909 let span_start = self . reader . offset ( ) ;
19091910
19101911 if let Some ( lead_surrogate) =
1911- self . reader . peek ( ) . filter ( |& cp| surroage_pair :: is_lead_surrogate ( cp) )
1912+ self . reader . peek ( ) . filter ( |& cp| surrogate_pair :: is_lead_surrogate ( cp) )
19121913 {
19131914 if let Some ( trail_surrogate) =
1914- self . reader . peek2 ( ) . filter ( |& cp| surroage_pair :: is_trail_surrogate ( cp) )
1915+ self . reader . peek2 ( ) . filter ( |& cp| surrogate_pair :: is_trail_surrogate ( cp) )
19151916 {
19161917 self . reader . advance ( ) ;
19171918 self . reader . advance ( ) ;
19181919
1919- let cp = surroage_pair:: combine_surrogate_pair ( lead_surrogate, trail_surrogate) ;
1920+ let cp =
1921+ surrogate_pair:: combine_surrogate_pair ( lead_surrogate, trail_surrogate) ;
19201922 // [SS:EE] RegExpIdentifierPart :: UnicodeLeadSurrogate UnicodeTrailSurrogate
19211923 // It is a Syntax Error if the RegExpIdentifierCodePoint of RegExpIdentifierPart is not matched by the UnicodeIDContinue lexical grammar production.
19221924 if !unicode:: is_unicode_id_continue ( cp) {
@@ -1956,14 +1958,14 @@ impl<'a> PatternParser<'a> {
19561958 // HexLeadSurrogate + HexTrailSurrogate
19571959 if let Some ( lead_surrogate) = self
19581960 . consume_fixed_hex_digits ( 4 )
1959- . filter ( |& cp| surroage_pair :: is_lead_surrogate ( cp) )
1961+ . filter ( |& cp| surrogate_pair :: is_lead_surrogate ( cp) )
19601962 {
19611963 if self . reader . eat2 ( '\\' , 'u' ) {
19621964 if let Some ( trail_surrogate) = self
19631965 . consume_fixed_hex_digits ( 4 )
1964- . filter ( |& cp| surroage_pair :: is_trail_surrogate ( cp) )
1966+ . filter ( |& cp| surrogate_pair :: is_trail_surrogate ( cp) )
19651967 {
1966- return Ok ( Some ( surroage_pair :: combine_surrogate_pair (
1968+ return Ok ( Some ( surrogate_pair :: combine_surrogate_pair (
19671969 lead_surrogate,
19681970 trail_surrogate,
19691971 ) ) ) ;
@@ -1975,7 +1977,7 @@ impl<'a> PatternParser<'a> {
19751977 // HexLeadSurrogate
19761978 if let Some ( lead_surrogate) = self
19771979 . consume_fixed_hex_digits ( 4 )
1978- . filter ( |& cp| surroage_pair :: is_lead_surrogate ( cp) )
1980+ . filter ( |& cp| surrogate_pair :: is_lead_surrogate ( cp) )
19791981 {
19801982 return Ok ( Some ( lead_surrogate) ) ;
19811983 }
@@ -1984,7 +1986,7 @@ impl<'a> PatternParser<'a> {
19841986 // HexTrailSurrogate
19851987 if let Some ( trail_surrogate) = self
19861988 . consume_fixed_hex_digits ( 4 )
1987- . filter ( |& cp| surroage_pair :: is_trail_surrogate ( cp) )
1989+ . filter ( |& cp| surrogate_pair :: is_trail_surrogate ( cp) )
19881990 {
19891991 return Ok ( Some ( trail_surrogate) ) ;
19901992 }
0 commit comments