Skip to content

Commit

Permalink
pip call operator precedence was fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ThakeeNathees committed Dec 23, 2024
1 parent 1942ca1 commit f53efae
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
16 changes: 8 additions & 8 deletions jac/jaclang/compiler/jac.lark
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,11 @@ expression: walrus_assign (KW_IF expression KW_ELSE expression)?
| lambda_expr

// Walrus assignments
walrus_assign: (named_ref WALRUS_EQ)? pipe
walrus_assign: (named_ref WALRUS_EQ)? elvis_check

// Lambda expressions
lambda_expr: KW_WITH func_decl_params? (RETURN_HINT expression)? KW_CAN expression

// Pipe expressions
pipe: (pipe PIPE_FWD)? pipe_back

// Pipe back expressions
pipe_back: (pipe_back PIPE_BKWD)? elvis_check

// Elvis expressions
elvis_check: (elvis_check ELVIS_OP)? bitwise_or

Expand Down Expand Up @@ -348,7 +342,13 @@ ds_spawn: (ds_spawn KW_SPAWN)? unpack
unpack: STAR_MUL? ref

// References (unused)
ref: BW_AND? pipe_call
ref: BW_AND? pipe

// Pipe expressions
pipe: (pipe PIPE_FWD)? pipe_back

// Pipe back expressions
pipe_back: (pipe_back PIPE_BKWD)? pipe_call

// Data spatial calls
pipe_call: (PIPE_FWD | A_PIPE_FWD | KW_SPAWN | KW_AWAIT)? atomic_chain
Expand Down
110 changes: 55 additions & 55 deletions jac/support/jac-lang.org/docs/learn/jac_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -794,42 +794,6 @@

--8<-- "examples/reference/lambda_expressions.md"

## Pipe expressions
**Code Example**
=== "Jac"
```jac linenums="1"
--8<-- "examples/reference/pipe_expressions.jac"
```
=== "Python"
```python linenums="1"
--8<-- "examples/reference/pipe_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="298"
--8<-- "jaclang/compiler/jac.lark:298:298"
```
**Description**

--8<-- "examples/reference/pipe_expressions.md"

## Pipe back expressions
**Code Example**
=== "Jac"
```jac linenums="1"
--8<-- "examples/reference/pipe_back_expressions.jac"
```
=== "Python"
```python linenums="1"
--8<-- "examples/reference/pipe_back_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="301"
--8<-- "jaclang/compiler/jac.lark:301:301"
```
**Description**

--8<-- "examples/reference/pipe_back_expressions.md"

## Elvis expressions
**Code Example**
=== "Jac"
Expand All @@ -841,8 +805,8 @@
--8<-- "examples/reference/elvis_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="304"
--8<-- "jaclang/compiler/jac.lark:304:304"
```yaml linenums="298"
--8<-- "jaclang/compiler/jac.lark:298:298"
```
**Description**

Expand All @@ -859,8 +823,8 @@
--8<-- "examples/reference/bitwise_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="307"
--8<-- "jaclang/compiler/jac.lark:307:310"
```yaml linenums="301"
--8<-- "jaclang/compiler/jac.lark:301:304"
```
**Description**

Expand All @@ -877,8 +841,8 @@
--8<-- "examples/reference/logical_and_compare_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="313"
--8<-- "jaclang/compiler/jac.lark:313:327"
```yaml linenums="307"
--8<-- "jaclang/compiler/jac.lark:307:321"
```
**Description**

Expand All @@ -895,8 +859,8 @@
--8<-- "examples/reference/arithmetic_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="330"
--8<-- "jaclang/compiler/jac.lark:330:333"
```yaml linenums="324"
--8<-- "jaclang/compiler/jac.lark:324:327"
```
**Description**

Expand All @@ -913,8 +877,8 @@
--8<-- "examples/reference/connect_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="336"
--8<-- "jaclang/compiler/jac.lark:336:336"
```yaml linenums="330"
--8<-- "jaclang/compiler/jac.lark:330:330"
```
**Description**

Expand All @@ -931,8 +895,8 @@
--8<-- "examples/reference/atomic_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="339"
--8<-- "jaclang/compiler/jac.lark:339:339"
```yaml linenums="333"
--8<-- "jaclang/compiler/jac.lark:333:333"
```
**Description**

Expand All @@ -949,8 +913,8 @@
--8<-- "examples/reference/atomic_pipe_back_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="342"
--8<-- "jaclang/compiler/jac.lark:342:342"
```yaml linenums="336"
--8<-- "jaclang/compiler/jac.lark:336:336"
```
**Description**

Expand All @@ -967,8 +931,8 @@
--8<-- "examples/reference/data_spatial_spawn_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="345"
--8<-- "jaclang/compiler/jac.lark:345:345"
```yaml linenums="339"
--8<-- "jaclang/compiler/jac.lark:339:339"
```
**Description**

Expand All @@ -985,8 +949,8 @@
--8<-- "examples/reference/unpack_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="348"
--8<-- "jaclang/compiler/jac.lark:348:348"
```yaml linenums="342"
--8<-- "jaclang/compiler/jac.lark:342:342"
```
**Description**

Expand All @@ -1002,13 +966,49 @@
```python linenums="1"
--8<-- "examples/reference/references_(unused).py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="345"
--8<-- "jaclang/compiler/jac.lark:345:345"
```
**Description**

--8<-- "examples/reference/references_(unused).md"

## Pipe expressions
**Code Example**
=== "Jac"
```jac linenums="1"
--8<-- "examples/reference/pipe_expressions.jac"
```
=== "Python"
```python linenums="1"
--8<-- "examples/reference/pipe_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="348"
--8<-- "jaclang/compiler/jac.lark:348:348"
```
**Description**

--8<-- "examples/reference/pipe_expressions.md"

## Pipe back expressions
**Code Example**
=== "Jac"
```jac linenums="1"
--8<-- "examples/reference/pipe_back_expressions.jac"
```
=== "Python"
```python linenums="1"
--8<-- "examples/reference/pipe_back_expressions.py"
```
??? example "Jac Grammar Snippet"
```yaml linenums="351"
--8<-- "jaclang/compiler/jac.lark:351:351"
```
**Description**

--8<-- "examples/reference/references_(unused).md"
--8<-- "examples/reference/pipe_back_expressions.md"

## Data spatial calls
**Code Example**
Expand Down

0 comments on commit f53efae

Please sign in to comment.