I'm using dragonfly2, and I want to create a grammar that, like vim
, is modal. I want to be able to enable and disable grammars using commands.
For example, if I say link
, I have an action that shows a list of possible links on screen with 2-letter labels, so I want the grammar to enable a mode that only accepts 2-letter words. In particular, after saying link
, I don't want the grammar to accept any normal command, like another link
.
Is this possible?
Ah ha! I just found this in someone else's grammar:
So basically, you can simply use
some_grammar.disable()
orsome_grammar.enable
!