Formatting

This commit is contained in:
Ruben Shekspir 2019-04-21 11:31:43 +04:00
parent 3aa2bcec3e
commit e4232275bf
7 changed files with 40 additions and 33 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
./builds

View file

@ -88,7 +88,7 @@ BEGIN
END Create;
BEGIN
NEW(characterStack);
(* NEW(characterStack);
characterStack := Create();
characterStack.push(characterStack, 'a');
characterStack.push(characterStack, 'b');
@ -117,5 +117,5 @@ BEGIN
Out.Char(characterStack.top(characterStack));
Out.Ln();
Out.Char(characterStack.pop(characterStack));
Out.Ln();
Out.Ln(); *)
END CharacterStack.

BIN
HashMap

Binary file not shown.

View file

@ -1,5 +1,5 @@
MODULE HashMap;
IMPORT Logger, CharacterStack, Strings;
IMPORT Logger, CharacterStack, Strings, Out;
CONST
ArrayMaxNumber = 5000;
TYPE
@ -48,8 +48,6 @@ BEGIN
REPEAT
symbol := text[i];
INC(i);
IF symbol = symbolBracketStart THEN
Logger.Log("Starting Parse Json");
END;
@ -57,8 +55,12 @@ BEGIN
IF symbol = symbolBracketStart THEN
Logger.Log("End Parsing Json");
END;
INC(i);
Logger.LogInt(i);
UNTIL text[i] = 0AX;
Out.String(" test");
RETURN jsonRecord;
END Create;

View file

@ -1,9 +0,0 @@
#/bin/bash
voc -s \
./time.Mod \
./logger.Mod \
./diaspora2hugo/src/lists/Sys.Mod \
./diaspora2hugo/src/lists/List.Mod \
./CharacterStack.Mod \
./HashMapString.Mod -m

View file

@ -1,23 +1,35 @@
MODULE Logger;
IMPORT time, Out;
PROCEDURE LogInt*(number: LONGINT);
VAR
i: LONGINT;
BEGIN
WHILE number>10 DO
number := number DIV 10;
INC(i);
END;
Out.Int(number, i);
END LogInt;
PROCEDURE Log*(buff: ARRAY OF CHAR);
VAR
year, month, day, hour, min, sec: LONGINT;
BEGIN
time.Now(year, month, day, hour, min, sec);
Out.Int(year, 4);
LogInt(year);
Out.String("/");
Out.Int(month, 2);
LogInt(month);
Out.String("/");
Out.Int(day, 2);
LogInt(day);
Out.String(" ");
Out.Int(hour, 2);
LogInt(hour);
Out.String("-");
Out.Int(min, 2);
LogInt(min);
Out.String("-");
Out.Int(sec, 2);
LogInt(sec);
Out.String(" ");
Out.String(buff);
Out.Ln;

View file

@ -2,19 +2,20 @@
VOC = /opt/voc/bin/voc
all:
$(VOC) -s types.Mod sockets.Mod netdb.Mod Internet.Mod stringHelpers.Mod time.Mod IRC.Mod test.Mod -m
http:
$(VOC) -s types.Mod sockets.Mod netdb.Mod Internet.Mod time.Mod logger.Mod http.Mod -m
cd builds && \
$(VOC) -s \
../time.Mod \
../logger.Mod \
../diaspora2hugo/src/lists/Sys.Mod \
../diaspora2hugo/src/lists/List.Mod \
../CharacterStack.Mod \
../HashMapString.Mod -m
clean:
rm *.h &
rm *.c &
rm *.o &
rm *.sym &
rm http &
rm CharaterStack &
cd builds && rm * &
test: clean http
./http
run:
./builds/HashMap
test: clean all run