Skip to content

Commit

Permalink
Fixed semantics of if_true and if_false.
Browse files Browse the repository at this point in the history
Fixed syntax of `term'
  • Loading branch information
nineties committed Feb 19, 2013
1 parent f7f9efb commit 0e51c50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 3 additions & 6 deletions lib/amber/syntax.ab
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ReplaceSyntax{comment, shell_style_comment}


# Copyright (C) 2010 nineties # Copyright (C) 2010 nineties
# #
# $Id: syntax.ab 2013-02-19 14:06:22 nineties $ # $Id: syntax.ab 2013-02-19 21:33:42 nineties $


# Syntax definition of the Amber language. # Syntax definition of the Amber language.
# This file will be loaded first. # This file will be loaded first.
Expand Down Expand Up @@ -172,9 +172,6 @@ primary_block
| [multiline] "seq" "{" aligned(located(statement)) "}" | [multiline] "seq" "{" aligned(located(statement)) "}"
{ MakeObject{Quote{Seq}, List{node2}} } { MakeObject{Quote{Seq}, List{node2}} }


| [multiline] "(" qualified_symbol ")" "{" scoped(node1, block_body) "}"
{ node4 }

block ::= primary_block block ::= primary_block
| block_body | block_body


Expand Down Expand Up @@ -235,7 +232,7 @@ quote_expr
| postfix_expr | postfix_expr


pattern ::= quote_expr pattern ::= quote_expr
term ::= quote_expr term ::= primary_expr


# enable use of quotation expressions for following definitions. # enable use of quotation expressions for following definitions.
ReplaceSyntax{expr, quote_expr} ReplaceSyntax{expr, quote_expr}
Expand Down Expand Up @@ -386,7 +383,7 @@ statement
## Reserved Keywords ## Reserved Keywords
ReserveSymbol{not, and, or, where, open, if, else, case, of, ReserveSymbol{not, and, or, where, open, if, else, case, of,
while, for, reverse_for, in, continue, break, return, while, for, reverse_for, in, continue, break, return,
throw, try, catch, seq throw, try, catch, seq, scope
} }


## Syntax Sugars ## Syntax Sugars
Expand Down
10 changes: 5 additions & 5 deletions rowl1/vm-insn.rlc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; rowl - 1st generation ; rowl - 1st generation
; Copyright (C) 2010 nineties ; Copyright (C) 2010 nineties
; ;
; $Id: vm-insn.rlc 2013-02-18 08:05:47 nineties $ ; $Id: vm-insn.rlc 2013-02-19 14:25:05 nineties $
; ;


(define gen_field_get (idx) `( (define gen_field_get (idx) `(
Expand Down Expand Up @@ -1602,19 +1602,19 @@
(if_undef (-1 addr) @nil @(gen_comparison4 C_UNDEF)) (if_undef (-1 addr) @nil @(gen_comparison4 C_UNDEF))
(if_true (-1 addr) @nil ( (if_true (-1 addr) @nil (
(vmpop %eax) (vmpop %eax)
(asm "cmpl $" @C_FALSE ", %eax") (asm "cmpl $" @C_TRUE ", %eax")
(asm "movl $3, %eax") (asm "movl $3, %eax")
(vmsshort 1 %ecx) (vmsshort 1 %ecx)
(asm "cmovne %ecx, %eax") (asm "cmove %ecx, %eax")
(vmsucc %eax) (vmsucc %eax)
(vmfetch) (vmfetch)
)) ))
(if_false (-1 addr) @nil ( (if_false (-1 addr) @nil (
(vmpop %eax) (vmpop %eax)
(asm "cmpl $" @C_FALSE ", %eax") (asm "cmpl $" @C_TRUE ", %eax")
(asm "movl $3, %eax") (asm "movl $3, %eax")
(vmsshort 1 %ecx) (vmsshort 1 %ecx)
(asm "cmove %ecx, %eax") (asm "cmovne %ecx, %eax")
(vmsucc %eax) (vmsucc %eax)
(vmfetch) (vmfetch)
)) ))
Expand Down

0 comments on commit 0e51c50

Please sign in to comment.