summaryrefslogtreecommitdiff
path: root/impl/systems
diff options
context:
space:
mode:
Diffstat (limited to 'impl/systems')
-rw-r--r--impl/systems/generate-random.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/impl/systems/generate-random.py b/impl/systems/generate-random.py
index 66467b6..5b54bef 100644
--- a/impl/systems/generate-random.py
+++ b/impl/systems/generate-random.py
@@ -11,8 +11,9 @@ def generate_variable(size):
def generate_expression(size):
if random.randint(1, 5) < 3:
- operator = random.choice(['+', '-'])
- return generate_variable(size) + operator + generate_expression(size);
+ operator = random.choice(['add', 'mul'])
+ args = (generate_expression(size) for i in xrange(random.randint(2, 4)))
+ return "%s(%s)" % (operator, ",".join(args))
else:
return generate_variable(size)