Add example of trees for testing

This commit is contained in:
Bertrand Benjamin 2018-09-20 18:26:57 +02:00
parent 40cc8d00b6
commit a343d62078
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 lafrite <lafrite@Poivre>
#
# Distributed under terms of the MIT license.
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del

View File

@ -0,0 +1,24 @@
# vim:fenc=utf-8
#
# Copyright © 2017 lafrite <lafrite@Poivre>
#
# Distributed under terms of the MIT license.
"""
Example of trees
"""
from ..tree import Tree
simple_numeric = Tree.from_str("1+2*3")
big_sum = Tree.from_str("1+2+3+4+5+6+7+8+9")
big_minus = Tree.from_str("1-2-3-4-5-6-7-8-9")
big_mult = Tree.from_str("1*2*3*4*5*6*7*8*9")
big_sum_of_times = Tree.from_str("1*2+3*4+5*6+7*8+9*10")
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del