31 lines
455 B
C
31 lines
455 B
C
|
|
#include <debug.h>
|
|
|
|
#include <memory/smalloc.h>
|
|
|
|
#include <string/inc.h>
|
|
|
|
#include "struct.h"
|
|
#include "new.h"
|
|
|
|
struct position* new_position(
|
|
struct string* filename,
|
|
unsigned line,
|
|
unsigned column)
|
|
{
|
|
ENTER;
|
|
|
|
struct position* this = smalloc(sizeof(*this));
|
|
|
|
this->filename = inc_string(filename);
|
|
|
|
this->line = line;
|
|
|
|
this->column = column;
|
|
|
|
this->refcount = 1;
|
|
|
|
EXIT;
|
|
return this;
|
|
}
|
|
|