Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2003-04

(no subject)

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jeff Pohlmeyer

Patch for /fpc/fcl/passrc/pscanner.pp
so it will recognize '<', '>', and ''

- Not sure why these were omitted, maybe it has
something to do with fpdoc's tag generation?

[PATCH]

--- pscanner.old Thu Mar 27 10:32:48 2003
+++ pscanner.new Thu Apr 3 23:48:57 2003
@@ -51,7 +51,9 @@
tkDivision, // '/'
tkColon, // ':'
tkSemicolon, // ';'
+ tkLessThan, // '<'
tkEqual, // '='
+ tkGreaterThan, // '>'
tkAt, // '@'
tkSquaredBraceOpen, // '['
tkSquaredBraceClose,// ']'
@@ -59,6 +61,7 @@

     // Two-character tokens
     tkDotDot,		// '..'
     tkAssign,		// ':='

+ tkNotEqual, // ''

     // Reserved words
     tkabsolute,
     tkand,

@@ -230,13 +233,16 @@
'/',
':',
';',
+ '<',
'=',
+ '>',
'@',
'[',
']',
'^',
'..',

     ':=',

+ '',

     // Reserved words
     'absolute',
     'and',

@@ -726,10 +732,25 @@

         Inc(TokenStr);
         Result := tkSemicolon;
       end;

+ '<':
+ begin
+ Inc(TokenStr);
+ if TokenStr[0] = '>' then
+ begin
+ Inc(TokenStr);
+ Result := tkNotEqual;
+ end else
+ Result := tkLessThan;
+ end;
'=':

       begin
         Inc(TokenStr);
         Result := tkEqual;

+ end;
+ '>':
+ begin
+ Inc(TokenStr);
+ Result := tkGreaterThan;

       end;
     '@':
       begin

[/PATCH]

Hoping to use this unit in a little project I am working on...

Thanks,
- Jeff

__________________________________________________ Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more http://tax.yahoo.com

Reply by email

Michael Van Canneyt
to Jeff Pohlmeyer
Jeff Pohlmeyer wrote 5 lines
Patch for /fpc/fcl/passrc/pscanner.pp so it will recognize '<', '>', and '' - Not sure why these were omitted, maybe it has something to do with fpdoc's tag generation?

Normally not. I think that the explanation is that pscanner is used for the interface section only. Normally you don't find < > or in the interface section, except maybe in exotic things like

Const
  N1 = 12;
  N2 = 13;
  Bigger = (N1>N2) ; // Boolean type

However, don't let that stop you. Any improvements are welcome.

Michael.

Reply by email

Sebastian Günther
to Jeff Pohlmeyer: Patch for /fpc/fcl/passrc/pscanner.pp so it will recognize '<', '>', and '' - Not sure…
Jeff Pohlmeyer wrote 5 lines
Patch for /fpc/fcl/passrc/pscanner.pp so it will recognize '<', '>', and '' - Not sure why these were omitted, maybe it has something to do with fpdoc's tag generation?

No, as Michael said, it's just because until now it only scans interfaces; and at the moment I only implement what I need. But I think these units will evolve and improve a lot over time. Thanks for the patch for now...
(In the future, the scanner will recognise more symbols, and will be much faster as well.)

- Sebastian

Reply by email