mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-12 14:29:31 -06:00
the compiler now allows + to be used as a floating point addition in the abstract syntax
This commit is contained in:
@@ -136,7 +136,8 @@ typedef enum {
|
||||
PGF_INSTR_PUSH = 9,
|
||||
PGF_INSTR_EVAL = 10,
|
||||
PGF_INSTR_DROP = 13,
|
||||
PGF_INSTR_FAIL = 14
|
||||
PGF_INSTR_FAIL = 14,
|
||||
PGF_INSTR_ADD = 15
|
||||
} PgfInstruction;
|
||||
|
||||
typedef GuSeq PgfConcrs;
|
||||
|
||||
@@ -1160,6 +1160,11 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
|
||||
#endif
|
||||
jit_jmpi(abstr->eval_gates->mk_const);
|
||||
break;
|
||||
case PGF_INSTR_ADD:
|
||||
#ifdef PGF_JIT_DEBUG
|
||||
gu_printf(out, err, "ADD\n");
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
gu_impossible();
|
||||
}
|
||||
|
||||
@@ -170,6 +170,7 @@ instance Binary Instr where
|
||||
put (EVAL (GLOBAL id) (UpdateCall b c)) = putWord8 51 >> put id >> put (b,c)
|
||||
put (DROP n l ) = putWord8 52 >> put (n,l)
|
||||
put (FAIL ) = putWord8 56
|
||||
put (ADD ) = putWord8 60
|
||||
|
||||
instance Binary Type where
|
||||
put (DTyp hypos cat exps) = put (hypos,cat,exps)
|
||||
|
||||
@@ -28,6 +28,7 @@ data Instr
|
||||
| EVAL IVal TailInfo
|
||||
| DROP {-# UNPACK #-} !Int {-# UNPACK #-} !CodeLabel
|
||||
| FAIL
|
||||
| ADD
|
||||
|
||||
data IVal
|
||||
= HEAP {-# UNPACK #-} !Int
|
||||
@@ -61,6 +62,7 @@ ppInstr (PUSH v) = text "PUSH " <+> ppIVal v
|
||||
ppInstr (EVAL v ti) = text "EVAL " <+> ppIVal v <+> ppTailInfo ti
|
||||
ppInstr (DROP n l ) = text "DROP " <+> int n <+> ppLabel l
|
||||
ppInstr (FAIL ) = text "FAIL"
|
||||
ppInstr (ADD ) = text "ADD"
|
||||
|
||||
ppIVal (HEAP n) = text "hp" <> parens (int n)
|
||||
ppIVal (ARG_VAR n) = text "stk" <> parens (int n)
|
||||
|
||||
Reference in New Issue
Block a user