aboutsummaryrefslogtreecommitdiff
path: root/grammars/builtins.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-05 00:09:30 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-05 00:09:30 -0800
commit4350d996d1f4987ae83569acfdec2e25b996f599 (patch)
tree835ab3332ec593c748f4eabd7490266b2e22aa30 /grammars/builtins.bp
parent8d14bf01bc3c3cfbb3613487b59fe0bc4d6efba6 (diff)
Simplified `...` to `..%\n` and `$.` to `./\n`
Diffstat (limited to 'grammars/builtins.bp')
-rw-r--r--grammars/builtins.bp20
1 files changed, 10 insertions, 10 deletions
diff --git a/grammars/builtins.bp b/grammars/builtins.bp
index 9c34fe4..f68b2a7 100644
--- a/grammars/builtins.bp
+++ b/grammars/builtins.bp
@@ -11,7 +11,7 @@ pattern: !'' # Not defined by default
replacement: !'' # Not defined by default
replace-all: (
(include-binary-files / is-text-file)
- +(...(>pattern replacement)) ...
+ +(..(>pattern replacement)%\n) ..%\n
)
find-all: (
(include-binary-files / is-text-file)
@@ -21,7 +21,7 @@ find-all: (
)
only-matches: (
(include-binary-files / is-text-file)
- +(...@pattern =>'@1\n')
+ +(..@pattern%\n =>'@1\n')
)
# Helper definitions (commonly used)
@@ -49,10 +49,10 @@ utf8-codepoint: (
)
crlf: \r\n
cr: \r
-anglebraces: `<...`> % (anglebraces/string)
-brackets: `[...`] % (brackets/string)
-braces: `{...`} % (braces/string)
-parens: `(...`) % (parens/string)
+anglebraces: `<..`> % (\n/anglebraces/string)
+brackets: `[..`] % (\n/brackets/string)
+braces: `{..`} % (\n/braces/string)
+parens: `(..`) % (\n/parens/string)
string: `"..`" % (`\.) / `'..`' % (`\.)
id: !<`a-z,A-Z,_,0-9 `a-z,A-Z,_ *`a-z,A-Z,_,0-9
id-char: `a-z,A-Z,_,0-9
@@ -70,16 +70,16 @@ abc: `a-z
esc: \e
tab: \t
nl: \n; lf: \n
-c-block-comment: '/*' ... '*/'
-c-line-comment: '//' ..$
+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)
^: !<.
__: *(` /\t/\n/\r/comment)
_: *(` /\t)