Pascal

1 program Added 2025-10-22T09:35:47Z Model: meta-llama/llama-3.1-70b-instructTemp: 0.4 Evidence Report issue View issues
Aliases: Object Pascal
Provenance: commit 766376e3a8 · authored 2025-10-22T11:35:47+02:00 · model meta-llama/llama-3.1-70b-instruct

Sources mentioning this language

8 sources · pl_id: pl/pascal
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q81571

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsimperative · structured
Typingstatic
Designed byNiklaus Wirth
First appeared1970
Influenced byALGOL W · Simula 67

Extensions claimed by this language

12 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.pwikidataprimary5.0M files
.paslinguistprimary5.0M files
.paspygmentsprimary5.0M files
.paswikidataprimary5.0M files
.ppwikidataprimary2.4M files
.dfmlinguistsecondary1.0M files
.dprlinguistsecondary278.4K files
.dprpygmentssecondary278.4K files
.inclinguistsecondary6.3M files
.lprlinguistsecondary79.9K files
.pascallinguistsecondary1.6K files
.pplinguistsecondary2.4M files

Related languages

Clascal (0.75)Object Pascal (0.47)PT Pascal (0.41)Pascal Script (0.35)Delphi (0.34)

LLM-contributed programs

Pascal's Triangle

Provenance: commit 766376e3a8 · authored 2025-10-22T11:35:47+02:00 · model meta-llama/llama-3.1-70b-instruct · Temp 0.4
code.pas · added: 2025-10-22T09:35:47Z
program pascal_triangle;

procedure print_triangle(n: integer);
var
  i, j: integer;
  a: array of array of integer;
begin
  setlength(a, n, n);
  for i := 0 to n - 1 do
  begin
    for j := 0 to i do
    begin
      if (j = 0) or (j = i) then
        a[i, j] := 1
      else
        a[i, j] := a[i - 1, j - 1] + a[i - 1, j];
      write(a[i, j], ' ');
    end;
    writeln;
  end;
end;

begin
  print_triangle(10);
end.

Real programs from Software Heritage

5 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
arrays2.pas · 333 B · ext .pas · seen 2256× in SWH
via fallback
swh:1:cnt:d9122e8a2adc578130a43181eff6e674b0d9d4e2;origin=https://github.com/pascalabcnet/pascalabcnet;anchor=swh:1:rev:e6e67c193c17759ee72a42dce8c2e98784b1ca3a;path=/TestSuite/arrays2.pas
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
type TArr = array[1..4] of integer;
     TMatr = array[1..3,1..3] of integer;
     
const a : TArr = (2,3,4,5);
      a2 : TMatr = ((1,2,3),(4,5,6),(7,8,9));
      
var b : TArr := (2,3,4,5);
    b2 : TMatr := ((1,2,3),(4,5,6),(7,8,9));
    
begin
assert(a[3] = 4);
assert(b[3] = 4);
assert(a2[2,2] = 5);
assert(b2[2,2] = 5);
end.
RBDMUtils.pas · 2195 B · ext .pas · seen 2228× in SWH
via fallback
swh:1:cnt:16d9306e3796192f288d337bcbf22cbf9cb8f497;origin=https://github.com/pascalabcnet/pascalabcnet;anchor=swh:1:rev:49378a6750a8ee31b5083e0a2f0876bc3e2aee4c;path=/bin/Lib/RBDMUtils.pas
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
unit RBDMUtils;
// (недокументированные возможности PT4TaskMaker)
interface
//Записывают в файл результатов информацию о выполненном задании для Робота или Чертежника
//taskname - имя задания без префикса RB и DM (префикс добавляется автоматически)
procedure ResRB(taskname: string); 
procedure ResDM(taskname: string); 

//Записывают в файл regtasks.dat в каталоге Lib информацию о новой группе заданий
//для Робота или Чертежника
//Group       - имя группы (от 1 до 7 символов, без префиксов),
//Description - описание группы (первый символ автоматически преобразуется к нижнему
//              регистру, так как описание указывается после двоеточия),
//TaskCount   - число заданий в группе (от 1 до 999),
//Units       - имя модуля, содержащего группу (используется в шаблоне). 
//              Если Units является пустой строкой, то считается, что имя модуля 
//              совпадает с именем группы Group, дополненным префиксом RB или DM.
function RegisterRB(Group, Description: string; TaskCount: integer; 
  Units: string): integer;
function RegisterDM(Group, Description: string; TaskCount: integer; 
  Units: string): integer;

implementation

procedure ResRB(taskname: string); 
  external '%PABCSYSTEM%\PT4\PT4PABC.dll' name 'resrb';
procedure ResDM(taskname: string); 
  external '%PABCSYSTEM%\PT4\PT4PABC.dll' name 'resdm';
function registerrb(Group, Description: string; TaskCount: integer; 
  Units: string): integer;
  external '%PABCSYSTEM%\PT4\PT4PABC.dll' name 'registerrb';
function registerdm(Group, Description: string; TaskCount: integer; 
  Units: string): integer;
  external '%PABCSYSTEM%\PT4\PT4PABC.dll' name 'registerdm';
end.
frReservedCapsSettings.dfm · 1787 B · ext .dfm · seen 54× in SWH
via fallback
swh:1:cnt:ef116707e31026d7f5c95a415b55a7cb1829cb67;origin=https://github.com/stokito/jedicodeformat;anchor=swh:1:rev:9c1c3f6c705d89b57e6d9286eabbdca1c956a221;path=/CodeFormat/Jcf2/Ui/Settings/frReservedCapsSettings.dfm
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
inherited frReservedCapsSettings: TfrReservedCapsSettings
  Width = 325
  Height = 359
  Font.Charset = ANSI_CHARSET
  Font.Height = -15
  Font.Name = 'Segoe UI'
  ParentFont = False
  ExplicitWidth = 325
  ExplicitHeight = 359
  object cbEnable: TCheckBox
    Left = 8
    Top = 6
    Width = 248
    Height = 17
    Caption = 'Enable fix capitalisation'
    Checked = True
    State = cbChecked
    TabOrder = 0
    OnClick = cbEnableClick
  end
  object rgReservedWords: TRadioGroup
    Left = 8
    Top = 26
    Width = 150
    Height = 106
    Caption = 'Reserved words'
    ItemIndex = 1
    Items.Strings = (
      'ALL CAPITALS'
      'all lowercase'
      'Mixed Case'
      'Leave alone')
    TabOrder = 1
  end
  object rgOperators: TRadioGroup
    Left = 164
    Top = 26
    Width = 150
    Height = 106
    Caption = 'Operators'
    ItemIndex = 1
    Items.Strings = (
      'ALL CAPITALS'
      'all lowercase'
      'Mixed Case'
      'Leave alone')
    TabOrder = 2
  end
  object rgTypes: TRadioGroup
    Left = 8
    Top = 248
    Width = 150
    Height = 106
    Caption = 'Types'
    ItemIndex = 1
    Items.Strings = (
      'ALL CAPITALS'
      'all lowercase'
      'Mixed Case'
      'Leave alone')
    TabOrder = 5
  end
  object rgConstants: TRadioGroup
    Left = 164
    Top = 138
    Width = 150
    Height = 106
    Caption = 'Constants'
    ItemIndex = 1
    Items.Strings = (
      'ALL CAPITALS'
      'all lowercase'
      'Mixed Case'
      'Leave alone')
    TabOrder = 4
  end
  object rgDirectives: TRadioGroup
    Left = 8
    Top = 138
    Width = 150
    Height = 106
    Caption = 'Directives'
    ItemIndex = 1
    Items.Strings = (
      'ALL CAPITALS'
      'all lowercase'
      'Mixed Case'
      'Leave alone')
    TabOrder = 3
  end
end
nessus_translator.P · 2310 B · ext .p · seen 42× in SWH
via fallback
swh:1:cnt:8bd0acb72f6634648a52b82f1a345ca1ed7d9c77;origin=https://github.com/risksense/mulval;anchor=swh:1:rev:369f7484ea5263074f70464a7fada98b6e546df6;path=/src/adapter/nessus_translator.P
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source

:- import member/2 from lists.
hasEffect(privEscalation).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC ).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC, Port, Prot ).

vulProperty(CVE, localExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(local,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect, Port, Prot):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, _Port, _Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


vulProperty(CVE, remoteClient, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(remoteExploit,RangeList),
  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


lossTypetoEffect(Losstype, Effect):-
            member('data_modification', Losstype),
            hasEffect(Effect).

lossTypetoEffect(Losstype, Effect):-
            member('data_loss', Losstype),
            hasEffect(Effect).

cvss(CVE, AC):-
	vuln_exists(Host, CVE, Prog, _RangeList, _Losstype, _Severity, AC ).

cvss(CVE, AC):-
        vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, AC, Port, Prot ).

networkServiceInfo(Host, Program, Prot, Port, someUser) :-
	vulExists(Host, CVE, Program),
        vulProperty(CVE, remoteExploit, _Effect, Port, Prot).

%hacl(Host, internet, Prot, Port) :-
 %       vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%hacl(internet, Host, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%this is not corrent, because it binds the CVE Port and Prot together which couldn't be true.
%hacl(Host, Host2, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  %     vuln_exists(Host2, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

MyServiceConsole.lpr · 1186 B · ext .lpr · seen 4× in SWH
via fallback
swh:1:cnt:b7aab49602c29c3ff2e545d6073c6b6d1f8e5647;origin=https://github.com/exilon/QuickLib;anchor=swh:1:rev:57b6ce5fec77a25bf54e231bb0bdb83f828bf43f;path=/samples/fpc/QuickAppService/ConsoleAndService/MyServiceConsole.lpr
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
program MyServiceConsole;

{$APPTYPE CONSOLE}

{$MODE DELPHI}

{$R *.res}

uses
  SysUtils,
  Quick.Commons,
  Quick.Console,
  Quick.AppService;

type

  TSrvFactory = class
    class procedure CreateMyService;
  end;

  TMyService = class
  public
    procedure Execute;
  end;

  procedure TMyService.Execute;
  begin
    //your code
  end;

var

  MyService : TMyService;

class procedure TSrvFactory.CreateMyService;
begin
 MyService := TMyService.Create;
end;

begin
  try
    if not AppService.IsRunningAsService then
    begin
      cout('Running in console mode',etInfo);
      MyService := TMyService.Create;
      MyService.Execute;
      cout('Press [Enter] to exit',etInfo);
      ConsoleWaitForEnterKey;
      cout('Closing app...',etInfo);
      MyService.Free;
    end
    else
    begin
        AppService.ServiceName := 'MyService';
        AppService.DisplayName := 'MyServicesvc';
        AppService.OnStart := TSrvFactory.CreateMyService;
        AppService.OnExecute := MyService.Execute;
        AppService.OnStop := MyService.Free;
        AppService.CheckParams;
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.inc/5.incpredicates[{"kind": "any", "regexes": ["(?i:^\\s*\\{\\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+\\})", "^\\s*end[.;]\\s*$"]}]
h/linguist/.pp/0.pppredicates[{"kind": "any", "regexes": ["^\\s*end[.;]"]}]

Contribute — propose a file extension

Tell us where to find evidence about Pascal (mapped to pl/pascal). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Pascal/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Partitioned Pascal Script →