projects
/
fur
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a negation operator
[fur]
/
templates
/
program.c
diff --git
a/templates/program.c
b/templates/program.c
index
063587d
..
64e0152
100644
(file)
--- a/
templates/program.c
+++ b/
templates/program.c
@@
-114,6
+114,16
@@
Object stringLiteral(Runtime* runtime, const char* literal)
}
// TODO Make this conditionally added
}
// TODO Make this conditionally added
+Object builtin$negate(Object input)
+{
+ assert(input.type == INTEGER);
+
+ Object result;
+ result.type = INTEGER;
+ result.instance.integer = -input.instance.integer;
+ return result;
+}
+
Object builtin$add(Object left, Object right)
{
assert(left.type == INTEGER);
Object builtin$add(Object left, Object right)
{
assert(left.type == INTEGER);