Add an empty cstdlib.elna source file
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
obtain one at https://mozilla.org/MPL/2.0/. *)
|
||||
module;
|
||||
|
||||
import Common, cstdlib;
|
||||
import cstdio, cstring, common;
|
||||
|
||||
const
|
||||
CHUNK_SIZE := 85536;
|
||||
@@ -11,10 +11,10 @@ const
|
||||
type
|
||||
(*
|
||||
* Classification table assigns each possible character to a group (class). All
|
||||
* characters of the same group a handled equivalently.
|
||||
*
|
||||
* Classification:
|
||||
*)
|
||||
* characters of the same group a handled equivalently.
|
||||
*
|
||||
* Classification:
|
||||
*)
|
||||
TransitionClass = (
|
||||
invalid,
|
||||
digit,
|
||||
@@ -293,7 +293,7 @@ begin
|
||||
i := 129u;
|
||||
while i <= 256u do
|
||||
classification[i] := TransitionClass.other;
|
||||
i := i + 1
|
||||
i := i + 1u
|
||||
end
|
||||
end;
|
||||
|
||||
@@ -410,16 +410,16 @@ begin
|
||||
if lexer^.start.iterator^ = '"' then
|
||||
text_length := lexer^.current.iterator - lexer^.start.iterator + 1;
|
||||
|
||||
MemZero(@token^.stringKind, #size(ShortString));
|
||||
MemCopy(lexer^.start.iterator, text_length, @token^.stringKind);
|
||||
memset(@token^.stringKind, 0, #size(ShortString));
|
||||
memcpy(@token^.stringKind, lexer^.start.iterator, text_length);
|
||||
|
||||
token^.kind := LexerKind.character
|
||||
end;
|
||||
if lexer^.start.iterator^ = "'" then
|
||||
text_length := lexer^.current.iterator - lexer^.start.iterator + 1;
|
||||
|
||||
MemZero(@token^.stringKind, #size(ShortString));
|
||||
MemCopy(lexer^.start.iterator, text_length, @token^.stringKind);
|
||||
memset(@token^.stringKind, 0, #size(ShortString));
|
||||
memcpy(@token^.stringKind, lexer^.start.iterator, text_length);
|
||||
|
||||
token^.kind := LexerKind.string
|
||||
end;
|
||||
@@ -432,7 +432,7 @@ begin
|
||||
token^.kind := LexerKind.identifier;
|
||||
|
||||
token^.identifierKind[1] := cast(lexer^.current.iterator - lexer^.start.iterator: Char);
|
||||
MemCopy(lexer^.start.iterator, ORD(token^.identifierKind[1]), @token^.identifierKind[2]);
|
||||
memcpy(@token^.identifierKind[2], lexer^.start.iterator, ORD(token^.identifierKind[1]));
|
||||
|
||||
if compare_keyword("program", lexer^.start, lexer^.current.iterator) then
|
||||
token^.kind := LexerKind._program
|
||||
@@ -590,8 +590,8 @@ begin
|
||||
token^.kind := LexerKind.integer;
|
||||
|
||||
integer_length := lexer^.current.iterator - lexer^.start.iterator;
|
||||
MemZero(@token^.identifierKind, #size(Identifier));
|
||||
MemCopy(lexer^.start.iterator, integer_length, @token^.identifierKind[1]);
|
||||
memset(@token^.identifierKind, 0, #size(Identifier));
|
||||
memcpy(@token^.identifierKind[1], lexer^.start.iterator, integer_length);
|
||||
|
||||
buffer := InitStringCharStar(@token^.identifierKind[1]);
|
||||
token^.integerKind := StringToInteger(buffer, 10, found);
|
||||
@@ -889,7 +889,7 @@ begin
|
||||
lexer^.length := 0;
|
||||
|
||||
lexer^.buffer := malloc(CHUNK_SIZE);
|
||||
MemZero(lexer^.buffer, CHUNK_SIZE);
|
||||
memset(lexer^.buffer, 0, CHUNK_SIZE);
|
||||
lexer^.size := CHUNK_SIZE
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user