diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-17 22:35:13 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-17 22:35:13 -0800 |
| commit | 1b9e2957c0eeab592285f2cfcfd4e4ffe5586c97 (patch) | |
| tree | 4d803e812ac0a2c9965394e09a8fad921476b91b /grammars/builtins.bp | |
| parent | 395bdd664f0c34250bf12ae3d947882325380ad8 (diff) | |
Cleanup of builtins
Diffstat (limited to 'grammars/builtins.bp')
| -rw-r--r-- | grammars/builtins.bp | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/grammars/builtins.bp b/grammars/builtins.bp index c620164..e5106c0 100644 --- a/grammars/builtins.bp +++ b/grammars/builtins.bp @@ -1,28 +1,4 @@ -yes: '' -no: !'' - -# Configurable options: -is-tty: no # Defined as either always-match or always-fail, depending on stdout -include-binary-files: no; -is-text-file: >32(\t/\n/\r/\x20-x7e/!\x00-x7f utf8-codepoint/$$) - -# Meta-rules for acting on everything: -pattern: !'' # Not defined by default -replacement: !'' # Not defined by default - -# Helper definitions (commonly used) -url: ( - "file://" +(`/ *url-char) - / "mailto:" email - / ("https"/"http"/"ftp") "://" [>..`@ +url-char [`: +url-char] `@] - (ipv4/ipv6/domain) [`: int] [url-path] -) -url-path: +(`/ *url-char) [`? +(+url-char`=+url-char)%`&] -ipv4: 4 int % `. -ipv6: 8 (4 Hex) % `: -domain: +(+(Abc/digit/`-))%`. -url-char: Abc/digit/`$,-,_,.,+,!,*,',(,),,,% -email: +(Abc/digit/`.,-,+) `@ domain +# This file contains some default general-purpose definitions. nodent: \N !(\t/` ) indent: \N (` /\t) @@ -56,19 +32,16 @@ hex: `0-9,a-f number: +`0-9 [`. *`0-9] / `. +`0-9 int: +`0-9 digit: `0-9 +Abc123: `a-z,A-Z,0-9 +ABC123: `A-Z,0-9 +abc123: `a-z,0-9 Abc: `a-z,A-Z ABC: `A-Z abc: `a-z esc: \e tab: \t nl: \n; lf: \n -c-block-comment: '/*'..'*/'%\n -c-line-comment: '//'..$ -c-comment: c-line-comment / c-block-comment -hash-comment: `# ..$ comment: !''; # No default definition, can be overridden -WS: ` /\t/\n/\r/comment -ws: ` /\t $$: !(./\n) $: !. ^^: !<(./\n) |
