Parslet is a parsing Ruby library based on PEG (Parsing Expression Grammar)
Questions tagged [parslet]
35 questions
1
vote
1 answer
Parsing text structured as tree with fixed width columns using parslet in ruby
I'm stuck. For couple of days been trying to parse this text (look at bottom). But can't figure out some things. Firstly text is formatted in tree structure with fixed width columns but exact column width depends on widest field.
I'm using ruby,…

davispuh
- 1,419
- 3
- 18
- 30
0
votes
0 answers
how to test parslet atom right in irb
I found in parslet gem introduction something like this:
# Without structure: just strings.
str('ooo').parse('ooo') # => "ooo"@0
str('o').repeat.parse('ooo') # => "ooo"@0
source: parslet gem
I did…

suhao399
- 628
- 7
- 11
0
votes
1 answer
SystemStackError: when parsing SCIM 2.0 filter query using Parslet
I am writing a SCIM 2.0 filter parser using Parslet. When I try to parse the following query, I end up with a SystemStackError.
'title pr or userType eq "Intern"'
I have converted the ABNF notation from https://www.rfc-editor.org/rfc/rfc7644#page-21…

mokha
- 47
- 5
0
votes
1 answer
Parslet: How to Buffer/parse incrementally data
I'm writing an HTTP/1 response parser with parslet. It works, but only when I send the full payload.
I have smth like this:
rule(:response) {
response_line >> crlf >>
header.repeat.as(:headers) >> crlf >>
data.as(:data)
}
root…

ChuckE
- 5,610
- 4
- 31
- 59
0
votes
2 answers
How do I get my parser atom to terminate inside a rule including optional spaces?
I can get the atoms to parse individually, but when I chain them using >> the parser doesn’t seem to want to leave the :integer rule.
I get this error:
Extra input after last repetition at line 1 char 2.
`- Expected one of [VALUE, BOOL_OPERATION] at…

peterhartman
- 171
- 1
- 9