diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-08-15 16:45:41 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-08-15 16:45:41 +0100 |
| commit | 2ac4af6946543ae96cf3659468e1b8cabb057f85 (patch) | |
| tree | 2e19460fec67666259afe529e7f4dff71b6451cf /py/runtime0.h | |
| parent | 6be0b0a8ec9a6badc601190ccee876755ce7efb7 (diff) | |
py: Allow viper to have type annotations.
Viper functions can now be annotated with the type of their arguments
and return value. Eg:
@micropython.viper
def f(x:int) -> int:
return x + 1
Diffstat (limited to 'py/runtime0.h')
| -rw-r--r-- | py/runtime0.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/runtime0.h b/py/runtime0.h index eea578237..01504f59c 100644 --- a/py/runtime0.h +++ b/py/runtime0.h @@ -39,6 +39,12 @@ */ #define MP_SCOPE_FLAG_NOFREE 0x40 +// types for native (viper) function signature +#define MP_NATIVE_TYPE_OBJ (0x00) +#define MP_NATIVE_TYPE_BOOL (0x01) +#define MP_NATIVE_TYPE_INT (0x02) +#define MP_NATIVE_TYPE_UINT (0x03) + typedef enum { MP_UNARY_OP_BOOL, // __bool__ MP_UNARY_OP_LEN, // __len__ |
