Permalink
Browse files

Fixed semantics of if_true and if_false.

Fixed syntax of `term'
  • Loading branch information...
1 parent f7f9efb commit 0e51c504ceb67264a9e5afa80bf69564c2c410b5 nineties committed Feb 19, 2013
Showing with 8 additions and 11 deletions.
  1. +3 −6 lib/amber/syntax.ab
  2. +5 −5 rowl1/vm-insn.rlc
View
@@ -2,7 +2,7 @@ ReplaceSyntax{comment, shell_style_comment}
# 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.
# This file will be loaded first.
@@ -172,9 +172,6 @@ primary_block
| [multiline] "seq" "{" aligned(located(statement)) "}"
{ MakeObject{Quote{Seq}, List{node2}} }
- | [multiline] "(" qualified_symbol ")" "{" scoped(node1, block_body) "}"
- { node4 }
-
block ::= primary_block
| block_body
@@ -235,7 +232,7 @@ quote_expr
| postfix_expr
pattern ::= quote_expr
-term ::= quote_expr
+term ::= primary_expr
# enable use of quotation expressions for following definitions.
ReplaceSyntax{expr, quote_expr}
@@ -386,7 +383,7 @@ statement
## Reserved Keywords
ReserveSymbol{not, and, or, where, open, if, else, case, of,
while, for, reverse_for, in, continue, break, return,
- throw, try, catch, seq
+ throw, try, catch, seq, scope
}
## Syntax Sugars
View
@@ -2,7 +2,7 @@
; rowl - 1st generation
; 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) `(
@@ -1602,19 +1602,19 @@
(if_undef (-1 addr) @nil @(gen_comparison4 C_UNDEF))
(if_true (-1 addr) @nil (
(vmpop %eax)
- (asm "cmpl $" @C_FALSE ", %eax")
+ (asm "cmpl $" @C_TRUE ", %eax")
(asm "movl $3, %eax")
(vmsshort 1 %ecx)
- (asm "cmovne %ecx, %eax")
+ (asm "cmove %ecx, %eax")
(vmsucc %eax)
(vmfetch)
))
(if_false (-1 addr) @nil (
(vmpop %eax)
- (asm "cmpl $" @C_FALSE ", %eax")
+ (asm "cmpl $" @C_TRUE ", %eax")
(asm "movl $3, %eax")
(vmsshort 1 %ecx)
- (asm "cmove %ecx, %eax")
+ (asm "cmovne %ecx, %eax")
(vmsucc %eax)
(vmfetch)
))

0 comments on commit 0e51c50

Please sign in to comment.