IRC channel logs
2024-09-05.log
back to list of logs
<ekaitz>hi, i have a PEG grammar that uses underscores in the nonterminals <ekaitz>that's not compatible with guile's PEG parser <ekaitz>is there any reason not to add _ in the nonterminals? <ekaitz>also peg-string-compile is documented but not exported :) <mwette>ekaitz: at some point `_' became syntax in Guile. It's not in 2.2. I don't know where it comes from. <dpk>that shouldn’t preclude rebinding it (though you might have to disable importing it) <ekaitz>dpk: i don't understand what you mean <dpk>‘_’ is just a normal identifier like any other <dpk>it might be an error if you try to define it at the top-level of a library or program after having imported it from another library (such as (guile) or (rnrs (6)) or whatever) <dpk>but you should be able to exclude it individually from the import set <ekaitz>that's why i don't understand why the PEG parser does not allow _ in identifiers <ekaitz>it doesn't even allow this_identifier <dpk>oh, it’s a problem with the string syntax for PEGs in (ice-9 peg) ? <dpk>i thought you had a nonterminal called _ defined in the string syntax, and it was erroring because it was trying to redefine _ <ekaitz>i just added the _ to the regexp and it just works <ekaitz>but i had to make a new module on my own <ekaitz>does it make any sense to allow the _ in the peg parser strings directly? should I make a patch with this? <ekaitz>i guess they should have a similar syntax to scheme symbols, as they are going to be defined in the current scope <lilyp>I'm not sure why you'd want "_" to be allowed in the PEG parser – what's the rationale? <ekaitz>lilyp: just compatibility with some other parser tools <lilyp>even space if you know how to type them ;) <lilyp>my point was rather that PEG ids could be a subset of Scheme symbols <ekaitz>what I meant is adding _ would not be a superset of the scheme symbol syntax <ekaitz>i asked if there was any reason for it <ekaitz>does the peg string support escape sequences? <lilyp>I don't think so – maybe the Scheme API has some <ekaitz>ugh this is going to be a little bit harder than I expected <lilyp>for the underline: I think funny characters shouldn't show up in the peg due to possible ambiguities