mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-12-23 13:28:16 +00:00
Adjust for Automa 0.8.1
Defines an unambiguous state machine. https://github.com/BioJulia/Automa.jl/pull/49.
This commit is contained in:
parent
aaf3710fbe
commit
64f371e1e4
1 changed files with 3 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue