You've already forked lazarus-ccr
extrasyn: Improved test program (sorted highlighters). Sample code in some highlighters.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6221 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -155,6 +155,7 @@ type
|
||||
procedure CommentProc;
|
||||
protected
|
||||
function GetIdentChars: TSynIdentChars; override;
|
||||
function GetSampleSource: String; override;
|
||||
function IsFilterStored: Boolean; override;
|
||||
public
|
||||
class function GetLanguageName: string; override;
|
||||
@@ -962,6 +963,43 @@ begin
|
||||
Result := TSynValidStringChars;
|
||||
end;
|
||||
|
||||
function TSynFortranSyn.GetSampleSource: String;
|
||||
begin
|
||||
Result :=
|
||||
'* euclid.f (FORTRAN 77)' + LineEnding +
|
||||
'* Find greatest common divisor using the Euclidean algorithm' + LineEnding +
|
||||
LineEnding +
|
||||
' PROGRAM EUCLID' + LineEnding +
|
||||
' PRINT *, ''A?''' + LineEnding +
|
||||
' READ *, NA' + LineEnding +
|
||||
' IF (NA.LE.0) THEN' + LineEnding +
|
||||
' PRINT *, ''A must be a positive integer.''' + LineEnding +
|
||||
' STOP' + LineEnding +
|
||||
' END IF' + LineEnding +
|
||||
' PRINT *, ''B?''' + LineEnding +
|
||||
' READ *, NB' + LineEnding +
|
||||
' IF (NB.LE.0) THEN' + LineEnding +
|
||||
' PRINT *, ''B must be a positive integer.''' + LineEnding +
|
||||
' STOP' + LineEnding +
|
||||
' END IF' + LineEnding +
|
||||
' PRINT *, ''The GCD of'', NA, '' and'', NB, '' is'', NGCD(NA, NB), ''.''' + LineEnding +
|
||||
' STOP' + LineEnding +
|
||||
' END' + LineEnding +
|
||||
LineEnding +
|
||||
' FUNCTION NGCD(NA, NB)' + LineEnding +
|
||||
' IA = NA' + LineEnding +
|
||||
' IB = NB' + LineEnding +
|
||||
' 1 IF (IB.NE.0) THEN' + LineEnding +
|
||||
' ITEMP = IA' + LineEnding +
|
||||
' IA = IB' + LineEnding +
|
||||
' IB = MOD(ITEMP, IB)' + LineEnding +
|
||||
' GOTO 1' + LineEnding +
|
||||
' END IF' + LineEnding +
|
||||
' NGCD = IA' + LineEnding +
|
||||
' RETURN' + LineEnding +
|
||||
' END';
|
||||
end;
|
||||
|
||||
function TSynFortranSyn.IsFilterStored: Boolean;
|
||||
begin
|
||||
Result := fDefaultFilter <> SYNS_FilterFortran;
|
||||
|
||||
Reference in New Issue
Block a user