demo_compatibility.pp 524 B

123456789101112131415161718192021
  1. program test_compatibility;
  2. {$mode objfpc}{$H+}
  3. uses
  4. SysUtils, syntax.highlighter, syntax.pascal;
  5. var
  6. tokens: TSyntaxTokenArray;
  7. begin
  8. WriteLn('Testing backward compatibility function...');
  9. tokens := DoPascalHighlighting('begin end');
  10. if (Length(tokens) = 3) and (tokens[0].Kind = shKeyword) and (tokens[2].Kind = shKeyword) then
  11. WriteLn('PASS - Backward compatibility function works correctly')
  12. else
  13. WriteLn('FAIL - Backward compatibility function not working');
  14. WriteLn('Test completed.');
  15. end.