bp/grammars
2023-05-06 13:56:48 -04:00
..
bash.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
bp.bp Split backref/named captures into separate concepts for performance 2022-05-12 12:11:28 -04:00
builtins.bp Changed how tags work, changed Lua API for handling match captures 2022-05-14 22:43:13 -04:00
c.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
c++.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
cpp.bp Added C++ grammar and aliases. 2021-01-17 20:19:49 -08:00
go.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
html.bp Split backref/named captures into separate concepts for performance 2022-05-12 12:11:28 -04:00
javascript.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
js.bp Added Javscript and simplified python imports 2021-01-17 20:30:59 -08:00
lisp.bp Added | as alias for \b 2021-07-30 20:23:18 -07:00
lua.bp Split backref/named captures into separate concepts for performance 2022-05-12 12:11:28 -04:00
py.bp Added some aliases 2021-01-17 21:42:06 -08:00
python.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
README.md Adding more language grammars 2021-01-17 19:42:11 -08:00
rust.bp Changed how definitions work 2021-08-01 12:40:27 -07:00
sh.bp Added some aliases 2021-01-17 21:42:06 -08:00
shell.bp Split backref/named captures into separate concepts for performance 2022-05-12 12:11:28 -04:00
web.bp Fix domains to require a TLD (but allow non-tld domains like "localhost" 2023-05-06 13:56:48 -04:00

BP Grammars

The files in this directory are predefined grammars for different languages and contexts. They are intended to be used for common search patterns, and not intended to be complete PEG definitions of language grammars, other than bp.bp, which is included for stress-testing purposes, as well as a showcase of some BP features.

Adding Grammars

If you want to add your own grammar, the easiest way to do so is to create a .bp file in ~/.config/bp/. The syntax for grammar files is fully and formally defined in bp.bp, but in short, it's a list of whitespace-separated rule definitions of the form id __ ":" __ pattern.