|| (c == '_') || (c >= '0' && c <= '9'))
continue;
if(c == '<') {
+ if(a[++i] != '~')
+ GWI_ERR_B(_("illegal templating in name '%s'."), a)
lvl++;
++i;
continue;
- }
- if(c == ',') {
+ } else if(c == ',') {
if(!lvl)
GWI_ERR_B(_("illegal use of ',' outside of templating in name '%s'."), a)
- continue;
- }
- if(c == '~') {
- if(!lvl)
+ } else if(c == '~') {
+ if(!lvl || a[++i] != '>')
GWI_ERR_B(_("illegal templating in name '%s'."), a)
lvl--;
- continue;
- }
- GWI_ERR_B(_("illegal character '%c' in name '%s'."), c, a)
+ } else
+ GWI_ERR_B(_("illegal character '%c' in name '%s'."), c, a)
}
return !lvl ? 1 : -1;
}
--- /dev/null
+#include <stdlib.h>
+#include <math.h>
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "env.h"
+#include "vm.h"
+#include "gwion.h"
+#include "type.h"
+#include "instr.h"
+#include "object.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "ugen.h"
+#include "func.h"
+#include "gwi.h"
+
+GWION_IMPORT(trig) {
+ const Type t0 = gwi_mk_type(gwi, "T~", SZ_INT, NULL);
+ gwi_add_type(gwi, t0);
+
+ const Type t1 = gwi_mk_type(gwi, "T,", SZ_INT, NULL);
+ gwi_add_type(gwi, t1);
+
+ const Type t2 = gwi_mk_type(gwi, "<a>T", SZ_INT, NULL);
+ gwi_add_type(gwi, t2);
+
+ const Type t3 = gwi_mk_type(gwi, "<~a~>T", SZ_INT, NULL);
+ gwi_add_type(gwi, t3);
+
+ return GW_OK;
+}