File: bug40145.pas

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (82 lines) | stat: -rw-r--r-- 2,135 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
unit bug40145;

{$mode delphi}{$H+}

interface

uses
  Classes, SysUtils;

type

  bad=record
    field1:string;
    field2:integer;
    case integer of
      1:(hh:procedure());
      2:(ff1:function(a:integer;b:boolean):boolean of object);       //<<--- Codetools error:  unit2.pas(17,9): Error bracket ) not found
                                                                     // sometimes  unit2.pas(17,22) Error: identifier expected, but ( found.
      3:(pp2:procedure(aa:integer;bb:boolean));
      4:(pp3:procedure);
      5:(ff2:function(a:integer;b:boolean):boolean; bbb:integer);
      6:(ff3:function(a:integer;b:boolean):boolean of object);
  end;

  tt=record
    i: packed record
         j: integer;
         k: record end;
         case y: integer of
           0: (a: integer deprecated);
           1,2,3: (b: array[char] of char; c: char);
           3: ( d: record
                     case byte of
                       10: (i: integer; );
                       11: (y: byte);
                   end; );
           4: (e: integer;
               case enum:(one, two, three) of
                  one:(F: Integer);
                  two:(Dd: Byte);
                  three:(Z:PChar)
               );
       end;
  end;

implementation


var
    MyRecord: record
              i: packed record
                   j: integer;
                   k: record end;
                   case integer of
                     0: (a: integer);
                     1,2,3: (b: array[char] of char; c: char);
                     3: ( d: record
                               case byte of
                                 10: (i: integer; );
                                 11: (y: byte);
                             end;)
                 end;
            end;
    MyPointer: ^integer;

function TestFunction(Index : Integer) : Integer;
var
  wr:bad;
  wt:tt;
begin
  Result := 2*Index;
  wr.pp2(2,true);
  wr.pp3;
  wr.bbb:=1;
  wr.ff1(1,true);
  wr.ff2(2,false);
  wr.{completion:field1,field2,hh,ff1,pp2,pp3,ff2,bbb,ff3,!a,!b,!bb,!bad,!tt,!i,!j}               //<< cursor after . and press Ctrl+Space.
end;

end.