aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-05-07 11:23:43 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-05-10 23:14:41 +0900
commit0eb44f044b6a4f051126e2e46fd8840dcb105ae9 (patch)
tree187217bcf636830a4746e4fc80ac8282d72ddd12 /README.md
parentAdd --json option to vartan-parse command (diff)
downloadurubu-0eb44f044b6a4f051126e2e46fd8840dcb105ae9.tar.gz
urubu-0eb44f044b6a4f051126e2e46fd8840dcb105ae9.tar.xz
Make #prec directive change only precedence and not associativity
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index f73d2a6..b7f6206 100644
--- a/README.md
+++ b/README.md
@@ -384,7 +384,7 @@ Labels are intended to identify elements in directives. An AST doesn't contain l
#### `#prec <symbol: Identifier>`
-A `#prec` directive gives alternatives the same precedence and associativety as `symbol`. To be precise, precedence and associativity are given to the right-most symbol in an alternative, not to an alternative.
+A `#prec` directive gives alternatives the same precedence as `symbol`.
See [Operator precedence and associativity](#operator-precedence-and-associativity) section for more details on the `#prec` directive.
@@ -499,7 +499,9 @@ foobar
`%left` and `%right` allow you to define precedence and associativiry of symbols. `%left`/`%right` each assign the left/right associativity to symbols.
-`#prec` directive assigns the same precedence and associativity as a specified symbol to an alternative.
+When the right-most terminal symbol of an alternative has precedence or associativity defined explicitly, the alternative inherits its precedence and associativity.
+
+`#prec` directive assigns the same precedence as a specified symbol to an alternative.
The grammar for simple four arithmetic operations and assignment expression can be defined as follows: