summaryrefslogtreecommitdiff
path: root/src/nxspp.c
blob: 7888cbb1ad4c147a341fd38c73806026bafb9006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "./include/nxspp.h"
#include "./include/macros.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

npp_t *init_npp(char *source) {
  npp_t *n = malloc(sizeof(npp_t));
  if (n == NULL)
    die("malloc on nxspp");
  n->source = source;
  n->i = 0;
  n->c = source[n->i];
  return n;
}

char *nxspp_collect_id(char *source, int i) {}

void npp_move(npp_t *p) {
  if (p->c != '\0') {
    p->i++;
    p->c = p->source[p->i];
  }
}