mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-11-14 22:33:14 +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)
|
cat(re"\r?", lf)
|
||||||
end
|
end
|
||||||
|
|
||||||
header′ = rep(cat(metainfo, newline))
|
header = rep(cat(metainfo, newline))
|
||||||
header′.actions[:exit] = [:header]
|
header.actions[:exit] = [:header]
|
||||||
header = cat(header′, opt(any() \ cat('@'))) # look ahead
|
|
||||||
|
|
||||||
body = rep(cat(record, newline))
|
body = record * rep(newline * record) * opt(newline)
|
||||||
body.actions[:exit] = [:body]
|
body.actions[:exit] = [:body]
|
||||||
|
|
||||||
sam = cat(header, body)
|
sam = cat(header, body)
|
||||||
|
@ -200,10 +199,6 @@ const sam_actions_header = merge(
|
||||||
|
|
||||||
finish_header = true
|
finish_header = true
|
||||||
|
|
||||||
if !eof(stream)
|
|
||||||
p -= 1 # cancel look-ahead
|
|
||||||
end
|
|
||||||
|
|
||||||
@escape
|
@escape
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
@ -308,10 +303,6 @@ Automa.Stream.generate_reader(
|
||||||
|
|
||||||
const sam_loopcode_header = quote
|
const sam_loopcode_header = quote
|
||||||
|
|
||||||
if cs < 0
|
|
||||||
throw(ArgumentError("malformed metainfo at line $(linenum)"))
|
|
||||||
end
|
|
||||||
|
|
||||||
if finish_header
|
if finish_header
|
||||||
@goto __return__
|
@goto __return__
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue