Skip to content

Commit

Permalink
Merge pull request #450 from ydah/add-news-until-069
Browse files Browse the repository at this point in the history
Add NEWS v0.6.6~v0.6.9
  • Loading branch information
ydah authored Jun 27, 2024
2 parents cac17e2 + d1bcbbc commit a092a83
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
# NEWS for Lrama

## Lrama 0.6.9 (2024-05-02)

### Callee side tag specification of parameterizing rules

Allow to specify tag on callee side of parameterizing rules.

```
%union {
int i;
}
%rule with_tag(X) <i>: X { $$ = $1; }
;
```

### Named References for actions of RHS in parameterizing rules

Allow to use named references for actions of RHS in parameterizing rules.

```
%rule option(number): /* empty */
| number { $$ = $number; }
;
```

## Lrama 0.6.8 (2024-04-29)

### Nested parameterizing rules with tag

Allow to nested parameterizing rules with tag.

```
%union {
int i;
}
%rule nested_nested_option(X): /* empty */
| X
;
%rule nested_option(X): /* empty */
| nested_nested_option(X) <i>
;
%rule option(Y): /* empty */
| nested_option(Y) <i>
;
```

## Lrama 0.6.7 (2024-04-28)

### RHS of user defined parameterizing rules contains `'symbol'?`, `'symbol'+` and `'symbol'*`.

User can use `'symbol'?`, `'symbol'+` and `'symbol'*` in RHS of user defined parameterizing rules.

```
%rule with_word_seps(X): /* empty */
| X ' '+
;
```

## Lrama 0.6.6 (2024-04-27)

### Trace actions

Support trace actions for debugging.
Run `exe/lrama --trace=actions` to show grammar rules with actions.

```
❯ exe/lrama --trace=actions sample/calc.y
Grammar rules with actions:
$accept -> list, YYEOF {}
list -> ε {}
list -> list, LF {}
list -> list, expr, LF { printf("=> %d\n", $2); }
expr -> NUM {}
expr -> expr, '+', expr { $$ = $1 + $3; }
expr -> expr, '-', expr { $$ = $1 - $3; }
expr -> expr, '*', expr { $$ = $1 * $3; }
expr -> expr, '/', expr { $$ = $1 / $3; }
expr -> '(', expr, ')' { $$ = $2; }
```

### Inlining

Support inlining for rules.
The `%inline` directive causes all references to symbols to be replaced with its definition.

```
%rule %inline op: PLUS { + }
| TIMES { * }
;
%%
expr : number { $$ = $1; }
| expr op expr { $$ = $1 $2 $3; }
;
```

as same as

```
expr : number { $$ = $1; }
| expr '+' expr { $$ = $1 + $3; }
| expr '*' expr { $$ = $1 * $3; }
;
```

## Lrama 0.6.5 (2024-03-25)

### Typed Midrule Actions
Expand Down

0 comments on commit a092a83

Please sign in to comment.