2019-01-03 16:59:28 +01:00
|
|
|
|
#include <locale.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
2019-01-08 22:19:29 +01:00
|
|
|
|
#include "util.h"
|
|
|
|
|
#include "read.h"
|
2019-01-14 03:16:25 +01:00
|
|
|
|
#include "eval.h"
|
2019-01-08 22:19:29 +01:00
|
|
|
|
#include "print.h"
|
2019-01-03 16:59:28 +01:00
|
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
|
{
|
2019-01-06 12:30:07 +01:00
|
|
|
|
/* Омогућава библиотекама коришћеним у интерпретеру да протумаче српску ћирилицу */
|
|
|
|
|
if (setlocale(LC_ALL, "sr_RS.utf8") == NULL)
|
|
|
|
|
{
|
2019-01-06 15:27:54 +01:00
|
|
|
|
fprintf(stderr, "locale couldn't be set to \"sr_RS.utf8\",\
|
|
|
|
|
check if you've enabled it on your system\n");
|
2019-01-06 12:30:07 +01:00
|
|
|
|
exit(0);
|
|
|
|
|
}
|
2019-01-03 16:59:28 +01:00
|
|
|
|
|
2019-01-08 22:19:29 +01:00
|
|
|
|
for (;;)
|
2019-01-03 16:59:28 +01:00
|
|
|
|
{
|
2019-01-14 03:16:25 +01:00
|
|
|
|
print(eval(read("ШКЉ> ")));
|
2019-01-03 16:59:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
2019-01-08 22:19:29 +01:00
|
|
|
|
|