RemObjects
                        Software Gears code

C# to Oxygene

Sign in or create your account | Project List | Help

C# to Oxygene Commit Details

Date:2010-02-08 09:24:46 (5 months 22 days ago)
Author:Carlo Kok
Commit:71
Message:37700: Ifdef inserts in the wrong place
Files: trunk/RemObjects.Oxygene.CS2Pas/OxygeneExpressionVisitor.pas (1 diff)
trunk/RemObjects.Oxygene.CS2Pas/OxygeneVisitor.pas (5 diffs)

Change Details

trunk/RemObjects.Oxygene.CS2Pas/OxygeneExpressionVisitor.pas
7575  Write('inherited ');
7676  fSkipDot := true;
7777  baseReferenceExpression.AcceptChildren(self, nil);
78  fSkipDot := false;
7879end;
7980
8081method OxygeneOutputVisitor.TrackedVisitPrimitiveExpression(primitiveExpression: PrimitiveExpression; data: Object): Object;
trunk/RemObjects.Oxygene.CS2Pas/OxygeneVisitor.pas
165165
166166method OxygeneOutputVisitor.EndVisit(node: INode);
167167begin
168  AfterNodeVisit(node);
168169  inherited;
169  AfterNodeVisit(node);
170170end;
171171
172172method OxygeneOutputVisitor.TrackedVisitCompilationUnit(compilationUnit: CompilationUnit; data: Object): Object;
...... 
10641064    end;
10651065    write(';');
10661066    WriteEnter;
1067    BeginVisit(methodDeclaration.Body);
10671068    write('begin');
10681069    fIndent := fIndent + 1;
10691070    for i: Integer := 0 to methodDeclaration.Body.Children.Count -1 do begin
...... 
10741075    WriteEnter;
10751076    fIndent := fIndent - 1;
10761077    write('end;');
1078    EndVisit(methodDeclaration.Body);
10771079    writeenter;
10781080    fWriteInterface := true;
10791081    fIndent := lIdent;
...... 
14621464  end; // case
14631465end;
14641466
1465method OxygeneOutputVisitor.PrintPreprocessingDirective(directive: PreprocessingDirective; forceWriteInPreviousBlock: Boolean);
1467method OxygeneOutputVisitor.PrintPreprocessingDirective(directive: PreprocessingDirective;
1468  forceWriteInPreviousBlock: Boolean);
14661469begin
1470  var lToWrite : String;
1471  //if not forceWriteInPreviousBlock then begin
1472    lToWrite := nil;
1473    for i: Integer := Writer.Length -1 downto 0 do begin
1474      if Writer[i] in [#13, #10] then begin
1475        var lRes :=new char[Writer.Length -i-1];
1476        Writer.CopyTo(i+1, lRes, 0, lRes.Length);
1477        lToWrite := new string(lRes);
1478        if (i >0) and (Writer[i-1] = #13) and (Writer[i] = #10) then
1479          Writer.length := i+1;
1480        break;
1481      end;
1482    end;
1483    if lToWrite = nil then begin lToWrite := Writer.ToString; Writer.Length := 0; end;
1484  //end else lToWrite := String.Empty;
1485
14671486  var lCmd := directive.Cmd.Substring(1);
14681487  if String.Equals(lCmd, 'ifnot', StringComparison.InvariantCultureIgnoreCase) then lCmd := 'ifndef' else
14691488  if String.Equals(lCmd, 'if', StringComparison.InvariantCultureIgnoreCase) then lCmd := 'ifdef';
...... 
14741493    write('}');
14751494  end else
14761495        write ('{$'+lCmd + iif(String.IsNullOrEmpty(directive.Arg), '', " " + directive.Arg)+'}');
1496  writeenter;
1497  write(lToWrite);
14771498end;
14781499
14791500method OxygeneOutputVisitor.ChangeVisibility(&mod: Modifiers);
14801501

Archive Download the corresponding diff file

Revision: 71