From 71868fa053192f7250373eb984690f8e27cbb247 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 3 Oct 2013 08:21:31 +0000 Subject: [PATCH] the symbol for nonExist in the GF runtime should be the last. this simplifies the binary search in the C runtime --- src/runtime/c/pgf/data.h | 4 ++-- src/runtime/haskell/PGF/Data.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h index 2d7fc450e..f4513d240 100644 --- a/src/runtime/c/pgf/data.h +++ b/src/runtime/c/pgf/data.h @@ -178,8 +178,8 @@ typedef enum { PGF_SYMBOL_VAR, PGF_SYMBOL_KS, PGF_SYMBOL_KP, - PGF_SYMBOL_NE, - PGF_SYMBOL_BIND + PGF_SYMBOL_BIND, + PGF_SYMBOL_NE } PgfSymbolTag; typedef struct { diff --git a/src/runtime/haskell/PGF/Data.hs b/src/runtime/haskell/PGF/Data.hs index e86b02778..06ace4565 100644 --- a/src/runtime/haskell/PGF/Data.hs +++ b/src/runtime/haskell/PGF/Data.hs @@ -59,9 +59,9 @@ data Symbol | SymLit {-# UNPACK #-} !Int {-# UNPACK #-} !LIndex | SymVar {-# UNPACK #-} !Int {-# UNPACK #-} !Int | SymKS Token - | SymNE -- non exist - | SymBIND -- the special BIND token | SymKP [Symbol] [([Symbol],[String])] + | SymBIND -- the special BIND token + | SymNE -- non exist (this should be last constructor to simplify the binary search in the runtime) deriving (Eq,Ord,Show) data Production = PApply {-# UNPACK #-} !FunId [PArg]