From 64f371e1e479b07d7d14621b0bd23ad040087842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciara=CC=81n=20O=E2=80=99Mara?= Date: Thu, 1 Apr 2021 12:31:44 +1100 Subject: [PATCH] Adjust for Automa 0.8.1 Defines an unambiguous state machine. https://github.com/BioJulia/Automa.jl/pull/49. --- src/sam/readrecord.jl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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