mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-11-14 22:33:14 +00:00
Pipe into eval
This commit is contained in:
parent
e63ce2e398
commit
892ad0d7dc
1 changed files with 58 additions and 51 deletions
|
@ -317,36 +317,39 @@ const sam_metainfo_actions = Dict(
|
||||||
end,
|
end,
|
||||||
:anchor => :(),
|
:anchor => :(),
|
||||||
:mark1 => :(mark1 = p),
|
:mark1 => :(mark1 = p),
|
||||||
:mark2 => :(mark2 = p))
|
:mark2 => :(mark2 = p)
|
||||||
eval(
|
)
|
||||||
generate_index_function(
|
|
||||||
MetaInfo,
|
generate_index_function(
|
||||||
sam_metainfo_machine,
|
MetaInfo,
|
||||||
:(mark1 = mark2 = offset = 0),
|
sam_metainfo_machine,
|
||||||
sam_metainfo_actions))
|
:(mark1 = mark2 = offset = 0),
|
||||||
eval(
|
sam_metainfo_actions
|
||||||
generate_readheader_function(
|
) |> eval
|
||||||
Reader,
|
|
||||||
MetaInfo,
|
generate_readheader_function(
|
||||||
sam_header_machine,
|
Reader,
|
||||||
:(mark1 = mark2 = offset = 0),
|
MetaInfo,
|
||||||
merge(sam_metainfo_actions, Dict(
|
sam_header_machine,
|
||||||
:metainfo => quote
|
:(mark1 = mark2 = offset = 0),
|
||||||
resize_and_copy!(record.data, data, upanchor!(stream):p-1)
|
merge(sam_metainfo_actions, Dict(
|
||||||
record.filled = (offset+1:p-1) .- offset
|
:metainfo => quote
|
||||||
@assert isfilled(record)
|
resize_and_copy!(record.data, data, upanchor!(stream):p-1)
|
||||||
push!(reader.header.metainfo, record)
|
record.filled = (offset+1:p-1) .- offset
|
||||||
ensure_margin!(stream)
|
@assert isfilled(record)
|
||||||
record = MetaInfo()
|
push!(reader.header.metainfo, record)
|
||||||
end,
|
ensure_margin!(stream)
|
||||||
:header => :(finish_header = true; @escape),
|
record = MetaInfo()
|
||||||
:countline => :(linenum += 1),
|
end,
|
||||||
:anchor => :(anchor!(stream, p); offset = p - 1))),
|
:header => :(finish_header = true; @escape),
|
||||||
quote
|
:countline => :(linenum += 1),
|
||||||
if !eof(stream)
|
:anchor => :(anchor!(stream, p); offset = p - 1))),
|
||||||
stream.position -= 1 # cancel look-ahead
|
quote
|
||||||
end
|
if !eof(stream)
|
||||||
end))
|
stream.position -= 1 # cancel look-ahead
|
||||||
|
end
|
||||||
|
end
|
||||||
|
) |> eval
|
||||||
|
|
||||||
const sam_record_actions = Dict(
|
const sam_record_actions = Dict(
|
||||||
:record_qname => :(record.qname = (mark:p-1) .- offset),
|
:record_qname => :(record.qname = (mark:p-1) .- offset),
|
||||||
|
@ -366,24 +369,28 @@ const sam_record_actions = Dict(
|
||||||
record.filled = (offset+1:p-1) .- offset
|
record.filled = (offset+1:p-1) .- offset
|
||||||
end,
|
end,
|
||||||
:anchor => :(),
|
:anchor => :(),
|
||||||
:mark => :(mark = p))
|
:mark => :(mark = p)
|
||||||
eval(
|
)
|
||||||
generate_index_function(
|
|
||||||
Record,
|
generate_index_function(
|
||||||
sam_record_machine,
|
Record,
|
||||||
:(mark = offset = 0),
|
sam_record_machine,
|
||||||
sam_record_actions))
|
:(mark = offset = 0),
|
||||||
eval(
|
sam_record_actions
|
||||||
generate_read_function(
|
) |> eval
|
||||||
Reader,
|
|
||||||
sam_body_machine,
|
generate_read_function(
|
||||||
:(mark = offset = 0),
|
Reader,
|
||||||
merge(sam_record_actions, Dict(
|
sam_body_machine,
|
||||||
:record => quote
|
:(mark = offset = 0),
|
||||||
resize_and_copy!(record.data, data, upanchor!(stream):p-1)
|
merge(sam_record_actions, Dict(
|
||||||
record.filled = (offset+1:p-1) .- offset
|
:record => quote
|
||||||
found_record = true
|
resize_and_copy!(record.data, data, upanchor!(stream):p-1)
|
||||||
@escape
|
record.filled = (offset+1:p-1) .- offset
|
||||||
end,
|
found_record = true
|
||||||
:countline => :(linenum += 1),
|
@escape
|
||||||
:anchor => :(anchor!(stream, p); offset = p - 1)))))
|
end,
|
||||||
|
:countline => :(linenum += 1),
|
||||||
|
:anchor => :(anchor!(stream, p); offset = p - 1))
|
||||||
|
)
|
||||||
|
) |> eval
|
||||||
|
|
Loading…
Reference in a new issue