-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
hq doesn't accept underscores in the key names. This is surprising to me and the generic error message didn't make this limitation easy to find.
Example:
❯ echo '<div class="a">test</div>' | hq '{ a: .a }'
{"a":"test"}
❯ echo '<div class="a">test</div>' | hq '{ a_text: .a }'
Error parsing:
0: at line 1:
{ a_text: .a }
^
expected '}', found a
If I'm not mistaken, it's from the use of alphanumeric1 in the parsing function. Is underscore support something you would add? If it helps, there's a Stack Overflow answer that seems to have exactly the nom parser combinator invocations you need.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels