You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example below shows a program that expects to construct the Header and Body terminals from sequences containing skipped input. However, the program instead given an error like.
1: >ID_8867
^
expected at least one element
I suspect that the implementation is unable to construct terminals from multiple non-contiguous substrings. This should either be fixed, or an error message should be presented that the grammar is malformed.
use"peg"actorMainnewcreate(env: Env) =>
let input = ">ID_8867\nGATTACA\nACATTAG\n"let src = Source.from_string(input, "text")
matchrecovervalFastaParser().parse(src) end
| (_, let ast: AST) =>
env.out.print(recoverPrinter(ast) end)
| (let offset: USize, let r: Parserval) =>
let e = recovervalSyntaxError(src, offset, r) end
env.out.writev(PegFormatError.console(e))
else
env.out.print("wat")
endprimitiveFastaParserfunapply(): Parserval =>
recoverlet id = (R('A', 'z') / L("_") / R('0', '9').many1()).many1()
let header = (L(">") * id * L("\n")).term(Header)
let body = ((L("A") / L("T") / L("G") / L("C")).many1() * -L("\n")).many().term(Body)
let records = (header * body).many1()
records
endprimitiveHeader is Labelfuntext(): String => "Header"primitiveBody is Labelfuntext(): String => "Body"
The text was updated successfully, but these errors were encountered:
The example below shows a program that expects to construct the
Header
andBody
terminals from sequences containing skipped input. However, the program instead given an error like.I suspect that the implementation is unable to construct terminals from multiple non-contiguous substrings. This should either be fixed, or an error message should be presented that the grammar is malformed.
The text was updated successfully, but these errors were encountered: