File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -60,9 +60,11 @@ use LibXML::Element;
60
60
use LibXML::Node;
61
61
use NativeCall ;
62
62
use Method ::Also;
63
- use LibXML::Parser::Context;
64
63
65
- class ParserContext is LibXML::Parser::Context {
64
+ class ParserContext {
65
+ use LibXML::Parser::Context;
66
+ also is LibXML::Parser::Context;
67
+
66
68
has LibXML::DocumentFragment $ . doc-frag is required ;
67
69
has Int $ . stat is rw ;
68
70
has Str $ . string ;
@@ -72,9 +74,7 @@ class ParserContext is LibXML::Parser::Context {
72
74
73
75
submethod DESTROY {
74
76
$ lock . protect: {
75
- if $ ! nodes {
76
- $ ! nodes . FreeList();
77
- }
77
+ . FreeList() with $ ! nodes ;
78
78
}
79
79
}
80
80
method publish {
Original file line number Diff line number Diff line change @@ -913,7 +913,7 @@ class anyNode is export does LibXML::Raw::DOM::Node {
913
913
method GetNodePath (--> xmlAllocedStr) is native($ XML2 ) is symbol(' xmlGetNodePath' ) {* }
914
914
method AddChild (anyNode --> anyNode) is native($ XML2 ) is symbol(' xmlAddChild' ) {* }
915
915
method AddChildList (anyNode --> anyNode) is native($ XML2 ) is symbol(' xmlAddChildList' ) {* }
916
- method AddContent (xmlCharP) is native($ XML2 ) is symbol(' xmlNodeAddContent' ) {* }
916
+ method AddContent (xmlCharP --> int32 ) is native($ XML2 ) is symbol(' xmlNodeAddContent' ) {* }
917
917
method SetContext (xmlXPathContext --> int32 ) is symbol(' xmlXPathSetContextNode' ) is native($ XML2 ) {* }
918
918
method XPathEval (Str , xmlXPathContext --> xmlXPathObject) is symbol(' xmlXPathNodeEval' ) is native($ XML2 ) {* }
919
919
method domXPathSelectStr (Str --> xmlNodeSet) is native($ BIND-XML2 ) {* }
Original file line number Diff line number Diff line change @@ -15,21 +15,18 @@ multi method new(Str:D() $content, *%c) {
15
15
16
16
method data {... }
17
17
method cloneNode {... }
18
- method ! substr (| c) {$ . data . substr (| c)}
19
- method ! substr-rw (| c) is rw {$ . data . substr-rw(| c)}
20
-
21
18
method length { $ . data . chars }
22
19
23
20
# DOM Boot-leather
24
- method substringData (UInt : D $ off , UInt : D $ len --> Str ) { self ! substr ($ off , $ len ) }
25
- method appendData (Str : D $ val --> Str ) { self ! substr-rw( * -0 , 0 ) = $ val }
26
- method insertData (UInt : D $ pos , Str : D $ val ) { self ! substr-rw($ pos , 0 ) = $ val ; }
27
- method setData (Str : D $ val --> Str ) { self ! substr-rw( 0 , * ) = $ val ; }
21
+ method substringData (UInt : D $ off , UInt : D $ len --> Str ) { $ . data . substr ($ off , $ len ) }
22
+ method appendData (Str : D $ val --> Str ) { self . appendText( $ val ); $ . data ; }
23
+ method insertData (UInt : D $ pos , Str : D $ val ) { $ . data . substr-rw($ pos , 0 ) = $ val ; }
24
+ method setData (Str : D $ val --> Str ) { $ . data = $ val ; }
28
25
method getData returns Str { $ . data }
29
26
multi method replaceData (UInt : D $ off , UInt : D $ length , Str : D $ val --> Str ) {
30
27
my $ len = $ . length ;
31
28
if $ len > $ off {
32
- self ! substr-rw($ off , $ length ) = $ val ;
29
+ $ . data . substr-rw($ off , $ length ) = $ val ;
33
30
}
34
31
else {
35
32
Str
You can’t perform that action at this time.
0 commit comments