diff --git a/src/sam/readrecord.jl b/src/sam/readrecord.jl index 4bc0761..e2d6669 100644 --- a/src/sam/readrecord.jl +++ b/src/sam/readrecord.jl @@ -134,11 +134,10 @@ const sam_machine_metainfo, sam_machine_record, sam_machine_header, sam_machine_ cat(re"\r?", lf) end - header′ = rep(cat(metainfo, newline)) - header′.actions[:exit] = [:header] - header = cat(header′, opt(any() \ cat('@'))) # look ahead + header = rep(cat(metainfo, newline)) + header.actions[:exit] = [:header] - body = rep(cat(record, newline)) + body = record * rep(newline * record) * opt(newline) body.actions[:exit] = [:body] sam = cat(header, body) @@ -200,10 +199,6 @@ const sam_actions_header = merge( finish_header = true - if !eof(stream) - p -= 1 # cancel look-ahead - end - @escape end ) @@ -308,10 +303,6 @@ Automa.Stream.generate_reader( const sam_loopcode_header = quote - if cs < 0 - throw(ArgumentError("malformed metainfo at line $(linenum)")) - end - if finish_header @goto __return__ end