Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updated: testdata for objectpascal lexer
  • Loading branch information
codiacdev authored Nov 18, 2023
commit f532c658cd8517149cffa496e0437d9c2402e416
27 changes: 26 additions & 1 deletion lexers/testdata/objectpascal.actual
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,38 @@ const
and now '''
some more text
''';

const
cMultiLineString2 = '''''
some text
and now '''
some more text
''''';

var
fp1: real := 6.123e-22;
fp2: real := 612.3e-24;
fp3: real := 61.23e-23;
fp4: real := 1.1e-8;
Epsilon: Single = 1E-40;

{$NODEFINE string 'UnicodeString' } {$OBJTYPENAME string 'NUnicodeString'} { defined in ustring.h }
{-NODEFINE string 'String' } {$OBJTYPENAME string 'NUnicodeString'} { defined in ustring.h }
{-EXTERNALSYM ShortInt 'signed char' } {-OBJTYPENAME ShortInt 'Bzc'}

const
CLineBreak = {$IFDEF POSIX} _AnsiStr(#10) {$ENDIF}
{$IFDEF MSWINDOWS} _AnsiStr(#13#10) {$ENDIF};

IntegerArray = array[0..$effffff] of Integer;
PIntegerArray = ^IntegerArray;

PointerArray = array [0..512*1024*1024 - 2] of Pointer;
PPointerArray = ^PointerArray;

TPCharArray = packed array[0..(High(Integer) div SizeOf(PChar))-1] of PChar;
PPCharArray = ^TPCharArray;

var
LNativeInt: NativeInt;
LNativeUInt: NativeUInt;
Expand Down
206 changes: 202 additions & 4 deletions lexers/testdata/objectpascal.expected
Original file line number Diff line number Diff line change
Expand Up @@ -325,19 +325,217 @@
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"'''\n some text\n and now '''\n some more text\n '''"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"KeywordReserved","value":"const"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"cMultiLineString2"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"'''''\n some text\n and now '''\n some more text\n '''''"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"KeywordReserved","value":"var"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"fp1"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"real"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberFloat","value":"6.123e-22"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"fp2"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"real"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberFloat","value":"612.3e-24"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"fp3"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"real"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberFloat","value":"61.23e-23"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"fp4"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"real"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":":="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberFloat","value":"1.1e-8"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"Epsilon"},
{"type":"Operator","value":":"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"Single"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberFloat","value":"1E-40"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"CommentPreproc","value":"{$NODEFINE string 'UnicodeString' }"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$OBJTYPENAME string 'NUnicodeString'}"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentMultiline","value":"{ defined in ustring.h }"},
{"type":"Text","value":"\n"},
{"type":"CommentPreproc","value":"{-NODEFINE string 'String' }"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$OBJTYPENAME string 'NUnicodeString'}"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentMultiline","value":"{ defined in ustring.h }"},
{"type":"Text","value":"\n"},
{"type":"CommentPreproc","value":"{-EXTERNALSYM ShortInt 'signed char' }"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{-OBJTYPENAME ShortInt 'Bzc'}"},
{"type":"Text","value":"\n\n"},
{"type":"KeywordReserved","value":"const"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"CLineBreak"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$IFDEF POSIX}"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"_AnsiStr"},
{"type":"Operator","value":"("},
{"type":"LiteralNumberHex","value":"#10"},
{"type":"Operator","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$ENDIF}"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$IFDEF MSWINDOWS}"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"_AnsiStr"},
{"type":"Operator","value":"("},
{"type":"LiteralNumberHex","value":"#13#10"},
{"type":"Operator","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"CommentPreproc","value":"{$ENDIF}"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"cMultiLineString2"},
{"type":"Text","value":"IntegerArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"array"},
{"type":"Punctuation","value":"["},
{"type":"LiteralNumberInteger","value":"0"},
{"type":"Operator","value":".."},
{"type":"LiteralNumberHex","value":"$effffff"},
{"type":"Punctuation","value":"]"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"of"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"Integer"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"PIntegerArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralString","value":"'''''\n some text\n and now '''\n some more text\n '''''"},
{"type":"Operator","value":"^"},
{"type":"Text","value":"IntegerArray"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"PointerArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"array"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"["},
{"type":"LiteralNumberInteger","value":"0"},
{"type":"Operator","value":".."},
{"type":"LiteralNumberInteger","value":"512"},
{"type":"Operator","value":"*"},
{"type":"LiteralNumberInteger","value":"1024"},
{"type":"Operator","value":"*"},
{"type":"LiteralNumberInteger","value":"1024"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"-"},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberInteger","value":"2"},
{"type":"Punctuation","value":"]"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"of"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"Pointer"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"PPointerArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"^"},
{"type":"Text","value":"PointerArray"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"TPCharArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"packed"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"array"},
{"type":"Punctuation","value":"["},
{"type":"LiteralNumberInteger","value":"0"},
{"type":"Operator","value":"..("},
{"type":"Text","value":"High"},
{"type":"Operator","value":"("},
{"type":"KeywordType","value":"Integer"},
{"type":"Operator","value":")"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"div"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"SizeOf"},
{"type":"Operator","value":"("},
{"type":"KeywordType","value":"PChar"},
{"type":"Operator","value":"))-"},
{"type":"LiteralNumberInteger","value":"1"},
{"type":"Punctuation","value":"]"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordReserved","value":"of"},
{"type":"TextWhitespace","value":" "},
{"type":"KeywordType","value":"PChar"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"PPCharArray"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"^"},
{"type":"Text","value":"TPCharArray"},
{"type":"Punctuation","value":";"},
{"type":"Text","value":"\n\n"},
{"type":"KeywordReserved","value":"var"},
{"type":"Text","value":"\n"},
{"type":"TextWhitespace","value":" "},
Expand Down Expand Up @@ -1526,8 +1724,8 @@
{"type":"Operator","value":"\u003e"},
{"type":"TextWhitespace","value":" "},
{"type":"Text","value":"Ord"},
{"type":"Operator","value":"(#"},
{"type":"LiteralNumberInteger","value":"10"},
{"type":"Operator","value":"("},
{"type":"LiteralNumberHex","value":"#10"},
{"type":"Operator","value":")"},
{"type":"Punctuation","value":"."},
{"type":"Text","value":"ToExtended"},
Expand Down