Sign in Join

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

Mailing lists / fpc-devel / 2009-11

FPC conditionals

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner
to Mattias Gaertner
Show quoted text 11 lines
I'm extending the codetools scanner for directives conditionals. The doc mentions the following operators: =, , >, <, >=, <=, AND, NOT, OR, IN http://community.freepascal.org:10000/docs-html/prog/progsu99.html#x113-1120002.4.1 What does the IN operator? I mean, on what sets does it work? On pascal sets? Are these the only operators? What about +, -, *, <<, >>, shl, shr, xor?

Allowed:
1+1<3

Not allowed:
(1+1)<3

Are brackets not supported?
Maybe only in some modes?

Mattias

Reply by email

Jonas Maebe
to Mattias Gaertner
Mattias Gaertner wrote 8 lines
Allowed: 1+1<3 Not allowed: (1+1)<3 Are brackets not supported? Maybe only in some modes?

I doubt it. The preprocessor parser is very limited and completely separate from the regular parser. I think that it's in compiler/ scanner.pas, function parse_compiler_expr.

Disclaimer: I've never modified that code myself and don't know anything about it.

Jonas

Reply by email

Mattias Gaertner
to Jonas Maebe
Show quoted text 18 lines
On 26 Nov 2009, at 13:41, Mattias Gaertner wrote: > Allowed: > 1+1<3 > > Not allowed: > (1+1)<3 > > Are brackets not supported? > Maybe only in some modes? I doubt it. The preprocessor parser is very limited and completely separate from the regular parser. I think that it's in compiler/ scanner.pas, function parse_compiler_expr. Disclaimer: I've never modified that code myself and don't know anything about it.

Thanks. I searched scanner, but didn't found that proc.

Hmm. It has hasKlammer. Maybe it supports some brackets ...

Mattias

Reply by email