Parse and transpile unary operations

This commit is contained in:
2025-06-06 18:25:53 +02:00
parent 3ca8491f64
commit 8d52410be9
6 changed files with 297 additions and 29 deletions

View File

@ -301,6 +301,8 @@ end;
(* Delimited string action. *)
proc transition_action_delimited(lexer: PLexer, token: PLexerToken);
var
text_length: CARDINAL;
begin
if lexer^.Start^ = '(' then
token^.kind := lexerKindComment
@ -309,6 +311,10 @@ begin
token^.kind := lexerKindCharacter
end;
if lexer^.Start^ = "'" then
text_length := lexer^.Current - lexer^.Start;
MemZero(ADR(token^.stringKind), TSIZE(ShortString));
MemCopy(lexer^.Start, text_length, ADR(token^.stringKind));
token^.kind := lexerKindString
end;
INC(lexer^.Current)
@ -432,8 +438,8 @@ begin
if lexer^.Current^ = ',' then
token^.kind := lexerKindComma
end;
if lexer^.Current^ = ',' then
token^.kind := lexerKindComma
if lexer^.Current^ = '~' then
token^.kind := lexerKindTilde
end;
if lexer^.Current^ = ')' then
token^.kind := lexerKindRightParen