@@ -46,78 +46,78 @@ x STORE => -> $, $!compat {}
4646 my enum IndexType <Free External Embedded>;
4747
4848 # faster native method overrides
49- x role NativeReader[$native-reader] {
49+ * role NativeReader[$native-reader] {
5050 #| load PDF 1.4- xref table followed by trailer
51- x method load-xref-table(Str $xref is copy, $dict is rw, :$offset) {
51+ * method load-xref-table(Str $xref is copy, $dict is rw, :$offset) {
5252 # fast load of the xref segments
53- my $buf = $xref.encode("latin-1");
54- my array $entries = $native-reader.read-xref($buf)
53+ ✱ my $buf = $xref.encode("latin-1");
54+ ✱ my array $entries = $native-reader.read-xref($buf)
5555 // die X::PDF::BadXRef::Parse.new( :$offset, :$xref );
56- my $bytes = $native-reader.xref-bytes;
56+ ✱ my $bytes = $native-reader.xref-bytes;
5757
5858 # parse and load the trailer
59- my $trailer = $buf.subbuf($bytes).decode("latin-1");
60- my $parse = PDF::Grammar::COS.subparse( $trailer.trim, :rule<trailer>, actions => $.scan-actions );
61- x die X::PDF::BadXRef::Parse.new( :$offset, :$xref )
59+ ✱ my $trailer = $buf.subbuf($bytes).decode("latin-1");
60+ ✱ my $parse = PDF::Grammar::COS.subparse( $trailer.trim, :rule<trailer>, actions => $.scan-actions );
61+ * die X::PDF::BadXRef::Parse.new( :$offset, :$xref )
6262 unless $parse;
63- x my \index = $parse.ast;
64- x $dict = PDF::COS.coerce( |index<trailer>, :reader(self) );
63+ * my \index = $parse.ast;
64+ * $dict = PDF::COS.coerce( |index<trailer>, :reader(self) );
6565
66- my uint64 @seg[+$entries div 4;4] Z= @$entries;
66+ ✱ my uint64 @seg[+$entries div 4;4] Z= @$entries;
6767
68- x [@seg, ];
68+ * [@seg, ];
6969 }
7070 }
7171
7272 # further COS object native method overrides
73- x role NativeCOS[$cos-node, $cos-ind-obj] {
74- x method parse-ind-obj(Str:D $input) {
75- x $cos-ind-obj.parse($input)
73+ * role NativeCOS[$cos-node, $cos-ind-obj] {
74+ * method parse-ind-obj(Str:D $input) {
75+ * $cos-ind-obj.parse($input)
7676 }
77- x method parse-object(Str:D $input) {
78- x $cos-node.parse($input)
77+ * method parse-object(Str:D $input) {
78+ * $cos-node.parse($input)
7979 }
80- x my class COSScanActions {
80+ * my class COSScanActions {
8181 has Bool $.get-offsets is rw = False; #| return ind-obj byte offsets in AST
82- x method TOP($/) { make $<cos>.ast }
83- x method cos($/) {
84- my @body = @<body>».ast;
85- x make (:@body);
82+ * method TOP($/) { make $<cos>.ast }
83+ * method cos($/) {
84+ ✱ my @body = @<body>».ast;
85+ * make (:@body);
8686 }
87- x method body($/) {
88- my @objects = @<ind-obj>».ast;
89- my %body = :@objects;
90- x %body ,= .<trailer>.ast with $<index>;
91- x make %body;
87+ * method body($/) {
88+ ✱ my @objects = @<ind-obj>».ast;
89+ ✱ my %body = :@objects;
90+ * %body ,= .<trailer>.ast with $<index>;
91+ * make %body;
9292 }
93- x method ind-obj($/) {
93+ * method ind-obj($/) {
9494 my Str:D() $input = $/;
95- my $ind-obj = $cos-ind-obj.parse($input, :scan)
95+ ✱ my $ind-obj = $cos-ind-obj.parse($input, :scan)
9696x // die "Native indirect Object parse failed at byte offset:{$/.from}";
97- my $ast = $ind-obj.ast;
98- x $ast.value.push: $/.from
97+ ✱ my $ast = $ind-obj.ast;
98+ * $ast.value.push: $/.from
9999 if self.get-offsets;
100- x make $ast;
100+ * make $ast;
101101 }
102- x method trailer($/) {
103- my $dict = $cos-node.parse: $<dict>.Str
102+ * method trailer($/) {
103+ ✱ my $dict = $cos-node.parse: $<dict>.Str
104104x // die "Native trailer dictionary parse failed at byte offset:{$/.from}";
105- x make (:trailer($dict.ast))
105+ * make (:trailer($dict.ast))
106106 }
107107 }
108- x method scan-actions { COSScanActions.new }
108+ * method scan-actions { COSScanActions.new }
109109 }
110110
111111* submethod TWEAK(PDF::COS::Dict :$trailer) {
112112* self!install-trailer($_) with $trailer;
113113
114114* try {
115115* require ::('PDF::Native::Reader');
116- x self does NativeReader[::('PDF::Native::Reader').new];
116+ * self does NativeReader[::('PDF::Native::Reader').new];
117117 }
118118* try {
119119* require ::('PDF::Native::COS');
120- x self does NativeCOS[::('PDF::Native::COS::COSNode'), ::('PDF::Native::COS::COSIndObj'), ];
120+ * self does NativeCOS[::('PDF::Native::COS::COSNode'), ::('PDF::Native::COS::COSIndObj'), ];
121121 }
122122 }
123123
@@ -319,13 +319,13 @@ x :details("Ignoring {$/.from} bytes before 'endstream' marker")
319319 };
320320 }
321321
322- * method parse-ind-obj(Str:D $input) {
323- * PDF::Grammar::COS.subparse( $input, :$.actions, :rule<ind-obj-nibble> );
322+ x method parse-ind-obj(Str:D $input) {
323+ x PDF::Grammar::COS.subparse( $input, :$.actions, :rule<ind-obj-nibble> );
324324x $/;
325325 }
326326
327- * method parse-object(Str:D $input) {
328- * PDF::Grammar::COS.subparse( trim($input), :$.actions, :rule<object> );
327+ x method parse-object(Str:D $input) {
328+ x PDF::Grammar::COS.subparse( trim($input), :$.actions, :rule<object> );
329329x $/;
330330 }
331331
@@ -503,16 +503,16 @@ x repeat {
503503 }
504504
505505 #| load PDF 1.4- xref table followed by trailer
506- * method load-xref-table(Str $xref, $dict is rw, :$offset) {
507- ✱ my $parse = PDF::Grammar::COS.subparse( $xref, :rule<index>, :$.actions );
508- * die X::PDF::BadXRef::Parse.new( :$offset, :$xref )
506+ x method load-xref-table(Str $xref, $dict is rw, :$offset) {
507+ my $parse = PDF::Grammar::COS.subparse( $xref, :rule<index>, :$.actions );
508+ x die X::PDF::BadXRef::Parse.new( :$offset, :$xref )
509509 unless $parse;
510510
511- * my \index = $parse.ast;
511+ x my \index = $parse.ast;
512512
513- * $dict = PDF::COS.coerce( |index<trailer>, :reader(self) );
513+ x $dict = PDF::COS.coerce( |index<trailer>, :reader(self) );
514514
515- * index<xref>».<entries>;
515+ x index<xref>».<entries>;
516516 }
517517
518518 #| load a PDF 1.5+ XRef Stream
0 commit comments