-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ #266 ] Ocaml had problem with nested defined constructors
The transation to Ocaml syntax was missing some parentheses.
- Loading branch information
1 parent
ba485f6
commit d9b4456
Showing
6 changed files
with
40 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ Andreas Abel <[email protected]> (unreleased) | |
* Haskell: fixes in layout preprocessor [#343,#344,#345] | ||
* C: fixed a space leak when parsing from a string in memory [#347] | ||
* C: new methods `free*` to deallocate syntax trees [#348] | ||
* Ocaml: fixed translation of nested `define`d constructors | ||
|
||
# 2.9.1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
-- #266 "define" pragma | ||
|
||
terminator Stm ""; | ||
terminator Stm "" ; | ||
|
||
SInts. Stm ::= "integers" Ints; | ||
SChars. Stm ::= "chars" Chars; | ||
SExp. Stm ::= "expression" Exp ; | ||
SInts. Stm ::= "integers" Ints ; | ||
SChars. Stm ::= "chars" Chars ; | ||
SExp. Stm ::= "expression" Exp ; | ||
|
||
EHalf. Exp2 ::= "1/2" ; | ||
EDouble. Exp2 ::= Double ; | ||
eSqrt. Exp1 ::= "sqrt" Exp1 ; | ||
EPower. Exp ::= Exp1 "**" Exp ; | ||
EHalf. Exp2 ::= "1/2" ; | ||
EDouble. Exp2 ::= Double ; | ||
eSqrt. Exp1 ::= "sqrt" Exp1 ; | ||
eSqrt4. Exp1 ::= "sqrt4" Exp1 ; | ||
EPower. Exp ::= Exp1 "**" Exp ; | ||
|
||
coercions Exp 2 ; | ||
coercions Exp 2 ; | ||
|
||
define eSqrt e = EPower e EHalf ; | ||
define eSqrt e = EPower e EHalf ; | ||
define eSqrt4 e = eSqrt (eSqrt e) ; | ||
|
||
-- #285 "define" pragma involving token categories | ||
|
||
INil. Ints ::= ; | ||
iSg. Ints ::= Integer ; | ||
ISnoc. Ints ::= Ints "," Integer ; | ||
INil. Ints ::= ; | ||
iSg. Ints ::= Integer ; | ||
ISnoc. Ints ::= Ints "," Integer ; | ||
|
||
define iSg i = ISnoc INil i ; | ||
define iSg i = ISnoc INil i ; | ||
|
||
CNil. Chars ::= ; | ||
cSg. Chars ::= Char ; | ||
CSnoc. Chars ::= Chars Dot Char ; | ||
CNil. Chars ::= ; | ||
cSg. Chars ::= Char ; | ||
CSnoc. Chars ::= Chars Dot Char ; | ||
|
||
define cSg c = CSnoc CNil (Dot ".") c; | ||
define cSg c = CSnoc CNil (Dot ".") c ; | ||
|
||
token Dot '.' ; | ||
token Dot '.' ; |