Commit fa266ccd authored by Theophile Ranquet's avatar Theophile Ranquet

Fix a symbolic comparison token inversion in scanner

  * THANKS (Pablo Oliveira, Theophile Ranquet): Add.
  * src/Scan.hs (scanToKeyword): Here.
  * tests/Makefile.am: Adjust for...
  * tests/cmp.lir,
  * tests/cmp.out,
  * tests/cmp.test:
  ...this new test.

Reported by Pablo Oliveira.
parent 494fa07b
......@@ -9,6 +9,11 @@ People who contributed to Havm:
* Yann Rgis-Gianas yann.regisgianas@gmail.com
- Port to GHC 6.4
* Pablo Oliveira pablo@sifflez.org
- Patch scanner
* Thophile Ranquet ranquet@lrde.epita.fr
- Version 0.25
Local Variables:
mode: outline
......
......@@ -168,8 +168,8 @@ scanTokKeyword "ge" loc = TokRelop (Ge, loc)
scanTokKeyword "(=)" loc = TokRelop (Eq, loc)
scanTokKeyword "(<>)" loc = TokRelop (Ne, loc)
scanTokKeyword "(<)" loc = TokRelop (Lt, loc)
scanTokKeyword "(<=)" loc = TokRelop (Gt, loc)
scanTokKeyword "(>)" loc = TokRelop (Le, loc)
scanTokKeyword "(<=)" loc = TokRelop (Le, loc)
scanTokKeyword "(>)" loc = TokRelop (Gt, loc)
scanTokKeyword "(>=)" loc = TokRelop (Ge, loc)
scanTokKeyword str loc = TokString (str, loc)
......@@ -5,9 +5,9 @@
XFAIL_TESTS =
TESTS = \
trace.test
cmp.test trace.test
EXTRA_DIST = fact.lir fact.out $(TESTS)
EXTRA_DIST = cmp.lir cmp.out fact.lir fact.out $(TESTS)
# Each test case depends on defs.
check_SCRIPTS = defs
......
seq
label main
seq
cjump (>)
const 2
const 1
name L2 name L3
label L2
sxp
call
name print_int
const 1
call end
label L3
seq end
label end
seq end
1
\ No newline at end of file
#! /bin/sh
# Copyright (C) 2006 LRDE
#
# This file is part of HAVM.
#
# HAVM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# HAVM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Texinfo; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
. ./defs || exit 1
set -e
HAVM_pass --trace $srcdir/cmp.lir
cmp stdout $srcdir/cmp.out
test -s stderr
HAVM_pass --trace=3 $srcdir/cmp.lir 3>stdtrc
cmp stdout $srcdir/cmp.out
test ! -s stderr
test -s stdtrc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment