| trunk/RemObjects.Oxygene.CS2Pas/OxygeneVisitor.pas |
| 165 | 165 | |
| 166 | 166 | method OxygeneOutputVisitor.EndVisit(node: INode); |
| 167 | 167 | begin |
| 168 | AfterNodeVisit(node); |
| 168 | 169 | inherited; |
| 169 | | AfterNodeVisit(node); |
| 170 | 170 | end; |
| 171 | 171 | |
| 172 | 172 | method OxygeneOutputVisitor.TrackedVisitCompilationUnit(compilationUnit: CompilationUnit; data: Object): Object; |
| ... | ... | |
| 1064 | 1064 | end; |
| 1065 | 1065 | write(';'); |
| 1066 | 1066 | WriteEnter; |
| 1067 | BeginVisit(methodDeclaration.Body); |
| 1067 | 1068 | write('begin'); |
| 1068 | 1069 | fIndent := fIndent + 1; |
| 1069 | 1070 | for i: Integer := 0 to methodDeclaration.Body.Children.Count -1 do begin |
| ... | ... | |
| 1074 | 1075 | WriteEnter; |
| 1075 | 1076 | fIndent := fIndent - 1; |
| 1076 | 1077 | write('end;'); |
| 1078 | EndVisit(methodDeclaration.Body); |
| 1077 | 1079 | writeenter; |
| 1078 | 1080 | fWriteInterface := true; |
| 1079 | 1081 | fIndent := lIdent; |
| ... | ... | |
| 1462 | 1464 | end; // case |
| 1463 | 1465 | end; |
| 1464 | 1466 | |
| 1465 | | method OxygeneOutputVisitor.PrintPreprocessingDirective(directive: PreprocessingDirective; forceWriteInPreviousBlock: Boolean); |
| 1467 | method OxygeneOutputVisitor.PrintPreprocessingDirective(directive: PreprocessingDirective; |
| 1468 | forceWriteInPreviousBlock: Boolean); |
| 1466 | 1469 | begin |
| 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 | |
| 1467 | 1486 | var lCmd := directive.Cmd.Substring(1); |
| 1468 | 1487 | if String.Equals(lCmd, 'ifnot', StringComparison.InvariantCultureIgnoreCase) then lCmd := 'ifndef' else |
| 1469 | 1488 | if String.Equals(lCmd, 'if', StringComparison.InvariantCultureIgnoreCase) then lCmd := 'ifdef'; |
| ... | ... | |
| 1474 | 1493 | write('}'); |
| 1475 | 1494 | end else |
| 1476 | 1495 | write ('{$'+lCmd + iif(String.IsNullOrEmpty(directive.Arg), '', " " + directive.Arg)+'}'); |
| 1496 | writeenter; |
| 1497 | write(lToWrite); |
| 1477 | 1498 | end; |
| 1478 | 1499 | |
| 1479 | 1500 | method OxygeneOutputVisitor.ChangeVisibility(&mod: Modifiers); |
| 1480 | 1501 | |