parser V[chepa combien]

This commit is contained in:
Nathan Lebrun
2025-01-20 13:24:33 +01:00
parent 81e0c7c4ee
commit b319c2129f
6 changed files with 178 additions and 73 deletions

View File

@@ -0,0 +1,23 @@
#include "tokenizer.h"
char *copy_meta_xor(char *val, int *copied, int rev)
{
int i;
int j;
char *out;
i = 0;
while (is_meta(val[i]) ^ rev)
{
if (!rev && val[i] != val[0])
break ;
i++;
}
*copied = i;
out = malloc(i + 1);
j = -1;
while (++j < i)
out[j] = val[j];
out[i] = 0;
return (out);
}