Lichen

lib/native.py

227:3a4ba5788f0f
2016-11-23 Paul Boddie Fixed list and tuple initialisation via their initialisers. Introduced generic string representation support for sequences. Removed superfluous tuple native functions. Added element-setting and size-setting native functions for fragments. Added __setitem__ support for sequences. Added initialisation and serialisation tests for lists and tuples.
     1 #!/usr/bin/env python     2      3 """     4 Native library functions.     5      6 Copyright (C) 2011, 2015, 2016 Paul Boddie <paul@boddie.org.uk>     7      8 This program is free software; you can redistribute it and/or modify it under     9 the terms of the GNU General Public License as published by the Free Software    10 Foundation; either version 3 of the License, or (at your option) any later    11 version.    12     13 This program is distributed in the hope that it will be useful, but WITHOUT    14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    15 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more    16 details.    17     18 You should have received a copy of the GNU General Public License along with    19 this program.  If not, see <http://www.gnu.org/licenses/>.    20 """    21     22 def _exit(status): pass    23 def _get_argv(): pass    24 def _get_path(): pass    25     26 def _is(x, y): pass    27 def _is_not(x, y): pass    28     29 def _int_add(self, other): pass    30 def _int_div(self, other): pass    31 def _int_mod(self, other): pass    32 def _int_mul(self, other): pass    33 def _int_neg(self): pass    34 def _int_pow(self, other): pass    35 def _int_sub(self, other): pass    36     37 def _int_and(self, other): pass    38 def _int_or(self, other): pass    39 def _int_xor(self, other): pass    40     41 def _int_lt(self, other): pass    42 def _int_gt(self, other): pass    43 def _int_eq(self, other): pass    44 def _int_ne(self, other): pass    45     46 def _int_str(self): pass    47     48 def _str_add(self, other): pass    49 def _str_lt(self, other): pass    50 def _str_gt(self, other): pass    51 def _str_eq(self, other): pass    52 def _str_len(self): pass    53 def _str_nonempty(self): pass    54     55 def _list_init(size): pass    56 def _list_setsize(self, size): pass    57 def _list_append(self, value): pass    58 def _list_concat(self, other): pass    59 def _list_len(self): pass    60 def _list_nonempty(self): pass    61 def _list_element(self, index): pass    62 def _list_setelement(self, index, value): pass    63     64 def _buffer_str(self): pass    65     66 def _isinstance(obj, cls): pass    67     68 def _read(fd, n): pass    69 def _write(fd, str): pass    70     71 # vim: tabstop=4 expandtab shiftwidth=4