sergeyklay / bnf-mode

A GNU Emacs major mode for editing BNF grammars
GNU General Public License v3.0
45 stars 9 forks source link

No strings #16

Open mmoderau opened 4 years ago

mmoderau commented 4 years ago

This mode does not treat quoted strings as strings. I am aware this is on purpose:

    ;; In BNF there are no strings
    ;; so treat ' and " as a symbols
    (modify-syntax-entry ?\" "_" table)
    (modify-syntax-entry ?\' "_" table)

All resources I could find about pure BNF (as opposed to EBNF and ABNF) show quoted strings.

This decision prevents specifying terminals as strings, especially strings containing a semicolon (unless escaped with a backslash as "\;").

I believe double quoted strings should be restored.

sergeyklay commented 4 years ago

@macmodrov Well, we can add strings support as an optional feature. So that, users will able to configure symbols recognized by mode as a valid set. What do you think about this?