Debian Codegraph @

src/reader/parser/inside_declaration.rs

raw symbols SCIP
1 use craterust-analyzer cargo xml-rs 0.8.19 crate/::commonrust-analyzer cargo xml-rs 0.8.19 common/::{is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char()., XmlVersionrust-analyzer cargo xml-rs 0.8.19 common/XmlVersion#};
2 use craterust-analyzer cargo xml-rs 0.8.19 crate/::readerrust-analyzer cargo xml-rs 0.8.19 reader/::errorrust-analyzer cargo xml-rs 0.8.19 reader/error/::SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#;
3 use craterust-analyzer cargo xml-rs 0.8.19 crate/::readerrust-analyzer cargo xml-rs 0.8.19 reader/::eventsrust-analyzer cargo xml-rs 0.8.19 reader/events/::XmlEventrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#;
4 use craterust-analyzer cargo xml-rs 0.8.19 crate/::readerrust-analyzer cargo xml-rs 0.8.19 reader/::lexerrust-analyzer cargo xml-rs 0.8.19 reader/lexer/::Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#;
5 use craterust-analyzer cargo xml-rs 0.8.19 crate/::utilrust-analyzer cargo xml-rs 0.8.19 util/::Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#;
6
7 use superrust-analyzer cargo xml-rs 0.8.19 reader/parser/::{
8 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#, Encounteredrust-analyzer cargo xml-rs 0.8.19 reader/parser/Encountered#, PullParserrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#, QualifiedNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#, Resultrust-analyzer cargo xml-rs 0.8.19 reader/parser/Result#, Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#,
9 DEFAULT_VERSIONrust-analyzer cargo xml-rs 0.8.19 reader/parser/DEFAULT_VERSION.,
10 };
11
12 impl PullParserrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser# {
13 #[inline(never)]
14 fn emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Resultrust-analyzer cargo xml-rs 0.8.19 reader/parser/Result#> {
15 debug_assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/debug_assert!!(self.encounteredrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#encountered. == Encounteredrust-analyzer cargo xml-rs 0.8.19 reader/parser/Encountered#::Nonerust-analyzer cargo xml-rs 0.8.19 reader/parser/Encountered#None#);
16 self.encounteredrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#encountered. = Encounteredrust-analyzer cargo xml-rs 0.8.19 reader/parser/Encountered#::Declarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/Encountered#Declaration#;
17
18 let version = self.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..versionrust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#version.;
19 let encoding = self.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..take_encodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[MarkupData]take_encoding().();
20 let standalone = self.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..standalonerust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#standalone.;
21
22 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(new_encoding) = encoding.as_derefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]as_deref().() {
23 let new_encoding = match new_encoding.parserust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]parse().() {
24 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(e) => e,
25 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(_) if self.configrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#config..ignore_invalid_encoding_declarationsrust-analyzer cargo xml-rs 0.8.19 reader/config/ParserConfig2#ignore_invalid_encoding_declarations. => Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Latin1rust-analyzer cargo xml-rs 0.8.19 util/Encoding#Latin1#,
26 Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(_) => return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnsupportedEncodingrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnsupportedEncoding#(new_encoding.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))),
27 };
28 let current_encoding = self.lexerrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#lexer..encodingrust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Lexer]encoding().();
29 if current_encoding rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().new_encoding {
30 let set = match (current_encoding, new_encoding) {
31 (Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Unknownrust-analyzer cargo xml-rs 0.8.19 util/Encoding#Unknown# | Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Defaultrust-analyzer cargo xml-rs 0.8.19 util/Encoding#Default#, new) if new rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq#ne().Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Utf16rust-analyzer cargo xml-rs 0.8.19 util/Encoding#Utf16# => new,
32 (Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Utf16Berust-analyzer cargo xml-rs 0.8.19 util/Encoding#Utf16Be# | Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Utf16Lerust-analyzer cargo xml-rs 0.8.19 util/Encoding#Utf16Le#, Encodingrust-analyzer cargo xml-rs 0.8.19 util/Encoding#::Utf16rust-analyzer cargo xml-rs 0.8.19 util/Encoding#Utf16#) => current_encoding,
33 _ if self.configrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#config..ignore_invalid_encoding_declarationsrust-analyzer cargo xml-rs 0.8.19 reader/config/ParserConfig2#ignore_invalid_encoding_declarations. => current_encoding,
34 _ => return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::ConflictingEncodingrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#ConflictingEncoding#(new_encoding, current_encoding))),
35 };
36 self.lexerrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#lexer..set_encodingrust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Lexer]set_encoding().(set);
37 }
38 }
39
40 let current_encoding = self.lexerrust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#lexer..encodingrust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Lexer]encoding().();
41 self.into_state_emitrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_emit().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::OutsideTagrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#OutsideTag#, Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(XmlEventrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#::StartDocumentrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#StartDocument# {
42 versionrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#StartDocument#version.: version.unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(DEFAULT_VERSIONrust-analyzer cargo xml-rs 0.8.19 reader/parser/DEFAULT_VERSION.),
43 encodingrust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#StartDocument#encoding.: encoding.unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(move || current_encoding.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()),
44 standalonerust-analyzer cargo xml-rs 0.8.19 reader/events/XmlEvent#StartDocument#standalone.
45 }))
46 }
47
48 // TODO: remove redundancy via macros or extra methods
49 pub fn inside_declarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]inside_declaration().(&mut self, t: Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#, s: DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Resultrust-analyzer cargo xml-rs 0.8.19 reader/parser/Result#> {
50
51 match s {
52 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::BeforeVersionrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#BeforeVersion# => match t {
53 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#('v') => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideVersionrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideVersion#)),
54 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, // continue
55 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
56 },
57
58 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideVersionrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideVersion# => self.read_qualified_namerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_qualified_name().(t, QualifiedNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#::AttributeNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#AttributeNameTarget#, |this, token, name| {
59 match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().name.local_namerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#local_name. {
60 "ersion" if name.namespacerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#namespace..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() =>
61 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(
62 if token rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().==rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq(). rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# {
63 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideVersionValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideVersionValue#
64 } else {
65 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterVersionrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterVersion#
66 }
67 )),
68 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(this.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedNameInsideXmlrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedNameInsideXml#(name.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))),
69 }
70 }),
71
72 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterVersionrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterVersion# => match t {
73 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideVersionValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideVersionValue#)),
74 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
75 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
76 },
77
78 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideVersionValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideVersionValue# => self.read_attribute_valuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_attribute_value().(t, |this, value| {
79 this.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..versionrust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#version. = match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().value {
80 "1.0" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(XmlVersionrust-analyzer cargo xml-rs 0.8.19 common/XmlVersion#::Version10rust-analyzer cargo xml-rs 0.8.19 common/XmlVersion#Version10#),
81 "1.1" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(XmlVersionrust-analyzer cargo xml-rs 0.8.19 common/XmlVersion#::Version11rust-analyzer cargo xml-rs 0.8.19 common/XmlVersion#Version11#),
82 _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#
83 };
84 if this.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..versionrust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#version..is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() {
85 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterVersionValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterVersionValue#))
86 } else {
87 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(this.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedXmlVersionrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedXmlVersion#(value.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
88 }
89 }),
90
91 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterVersionValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterVersionValue# => match t {
92 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::BeforeEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#BeforeEncoding#)),
93 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::ProcessingInstructionEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#ProcessingInstructionEnd# => self.emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(),
94 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
95 },
96
97 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::BeforeEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#BeforeEncoding# => match t {
98 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#('e') => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideEncoding#)),
99 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#('s') => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDecl#)),
100 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::ProcessingInstructionEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#ProcessingInstructionEnd# => self.emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(),
101 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, // skip whitespace
102 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
103 },
104
105 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideEncoding# => self.read_qualified_namerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_qualified_name().(t, QualifiedNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#::AttributeNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#AttributeNameTarget#, |this, token, name| {
106 match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().name.local_namerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#local_name. {
107 "ncoding" if name.namespacerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#namespace..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() =>
108 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(
109 if token rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().==rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq(). rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# { DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideEncodingValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideEncodingValue# } else { DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterEncoding# }
110 )),
111 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(this.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedNamerust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedName#(name.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
112 }
113 }),
114
115 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterEncodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterEncoding# => match t {
116 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideEncodingValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideEncodingValue#)),
117 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
118 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
119 },
120
121 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideEncodingValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideEncodingValue# => self.read_attribute_valuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_attribute_value().(t, |this, value| {
122 this.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..encodingrust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#encoding. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value);
123 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterEncodingValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterEncodingValue#))
124 }),
125
126 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterEncodingValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterEncodingValue# => match t {
127 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::BeforeStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#BeforeStandaloneDecl#)),
128 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::ProcessingInstructionEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#ProcessingInstructionEnd# => self.emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(),
129 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
130 },
131
132 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::BeforeStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#BeforeStandaloneDecl# => match t {
133 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#('s') => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDecl#)),
134 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::ProcessingInstructionEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#ProcessingInstructionEnd# => self.emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(),
135 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, // skip whitespace
136 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
137 },
138
139 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDecl# => self.read_qualified_namerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_qualified_name().(t, QualifiedNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#::AttributeNameTargetrust-analyzer cargo xml-rs 0.8.19 reader/parser/QualifiedNameTarget#AttributeNameTarget#, |this, token, name| {
140 match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().name.local_namerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#local_name. {
141 "tandalone" if name.namespacerust-analyzer cargo xml-rs 0.8.19 name/OwnedName#namespace..is_nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_none().() =>
142 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(
143 if token rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().==rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq(). rust-analyzer cargo xml-rs 0.8.19 reader/lexer/impl#[Token][`PartialEq<Self>`]eq().Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# {
144 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDeclValue#
145 } else {
146 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterStandaloneDecl#
147 }
148 )),
149 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(this.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedNamerust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedName#(name.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))),
150 }
151 }),
152
153 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterStandaloneDeclrust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterStandaloneDecl# => match t {
154 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::EqualsSignrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#EqualsSign# => self.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDeclValue#)),
155 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
156 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
157 },
158
159 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::InsideStandaloneDeclValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#InsideStandaloneDeclValue# => self.read_attribute_valuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]read_attribute_value().(t, |this, value| {
160 let standalone = match &*rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Deref]deref().value {
161 "yes" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(true),
162 "no" => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(false),
163 _ => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#
164 };
165 if standalone.is_somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]is_some().() {
166 this.datarust-analyzer cargo xml-rs 0.8.19 reader/parser/PullParser#data..standalonerust-analyzer cargo xml-rs 0.8.19 reader/parser/MarkupData#standalone. = standalone;
167 this.into_state_continuerust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]into_state_continue().(Staterust-analyzer cargo xml-rs 0.8.19 reader/parser/State#::InsideDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/parser/State#InsideDeclaration#(DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterStandaloneDeclValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterStandaloneDeclValue#))
168 } else {
169 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(this.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::InvalidStandaloneDeclarationrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#InvalidStandaloneDeclaration#(value.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())))
170 }
171 }),
172
173 DeclarationSubstaterust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#::AfterStandaloneDeclValuerust-analyzer cargo xml-rs 0.8.19 reader/parser/DeclarationSubstate#AfterStandaloneDeclValue# => match t {
174 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::ProcessingInstructionEndrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#ProcessingInstructionEnd# => self.emit_start_documentrust-analyzer cargo xml-rs 0.8.19 reader/parser/inside_declaration/impl#[PullParser]emit_start_document().(),
175 Tokenrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#::Characterrust-analyzer cargo xml-rs 0.8.19 reader/lexer/Token#Character#(c) if is_whitespace_charrust-analyzer cargo xml-rs 0.8.19 common/is_whitespace_char().(c) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, // skip whitespace
176 _ => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.errorrust-analyzer cargo xml-rs 0.8.19 reader/parser/impl#[PullParser]error().(SyntaxErrorrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#::UnexpectedTokenrust-analyzer cargo xml-rs 0.8.19 reader/error/SyntaxError#UnexpectedToken#(t))),
177 },
178 }
179 }
180 }