Skip to content

Commit

Permalink
Update docs with semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
tsandall committed Feb 10, 2017
1 parent 49a963f commit 2b20dfb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions site/documentation/how-do-i-write-policies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ undefined
We can define rules in terms of [Variables](#variables) as well:

```ruby
t { x = 42, y = 41, x > y }
t { x = 42; y = 41; x > y }
```

The formal syntax uses the comma character `,` to separate expressions. Rule
bodies can separate expressions with newlines and omit the comma:
The formal syntax uses the semicolon character `;` to separate expressions. Rule
bodies can separate expressions with newlines and omit the semicolon:

```
t2 {
Expand Down Expand Up @@ -265,7 +265,7 @@ The result:
Composite values can also be defined in terms of [Variables](#variables) or [References](#references). For example:

```ruby
> a = 42, b = false, c = null, d = {"a": a, "x": [b, c]}
> a = 42; b = false; c = null; d = {"a": a, "x": [b, c]}
+----+-------+------+---------------------------+
| A | B | C | D |
+----+-------+------+---------------------------+
Expand All @@ -283,7 +283,7 @@ defined in terms of scalars, variables, references, and other composite values.
For example:

```ruby
> s = {cube.width, cube.height, cube.depth}, count(s, n)
> s = {cube.width, cube.height, cube.depth}; count(s, n)
+---+---------+
| n | s |
+---+---------+
Expand Down
6 changes: 3 additions & 3 deletions site/documentation/how-does-opa-work/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ import input.method
import input.user

# allow "bob" to perform read-only operations
allow { user = "bob", method = "GET" }
allow { user = "bob"; method = "GET" }

# allow "alice" to perform any operation
allow { user = "alice" }
Expand Down Expand Up @@ -533,9 +533,9 @@ Any rule can be used as the trigger for a notification. For example, let’s ass
# All production containers are running if...
containers_to_migrate[id] {
# ...the container exists
container = containers[id],
container = containers[id]
# ...and it is in production
container.site.name = "prod",
container.site.name = "prod"
# ...and its host is running.
container.host.state != "terminated"
}
Expand Down
2 changes: 1 addition & 1 deletion site/documentation/references/rest/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ Execute an ad-hoc query and return bindings for variables found in the query.
#### Example Request

```
GET /v1/query?q=data.servers[i].ports[_] = "p2", data.servers[i].name = name HTTP/1.1
GET /v1/query?q=data.servers[i].ports[_] = "p2"; data.servers[i].name = name HTTP/1.1
```

#### Example Response
Expand Down
4 changes: 2 additions & 2 deletions site/examples/working-with-the-opa-repl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ false
In addition to running queries, the REPL also lets you define rules:

```ruby
> p[x] { a = [1,2,3,4], a[x] }
> p[x] { a = [1,2,3,4]; a[x] }
> p[x] > 1
+---+
| x |
Expand Down Expand Up @@ -236,7 +236,7 @@ The REPL also understands the [Import and Package](/documentation/how-do-i-write

```ruby
> import data.servers
> servers[i].ports[_] = "p2", servers[i].id = id
> servers[i].ports[_] = "p2"; servers[i].id = id
+---+------+
| i | id |
+---+------+
Expand Down

0 comments on commit 2b20dfb

Please sign in to comment.