[fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Dmitry Boyarintsev
Hello,

today I saw this kind of character escaping:
var
  a :char;
begin
  a:=^M; // char(13)
  writeln(^X);  // char(24)
end;

The code of the character is derived as ord(letter)-ord('A')+1
Not sure which pascal its inherited from... but Delphi 7 does compile it
too.

I vaguely remember it seeing before once .. and ... a lot of time ago.

Should it be added to this page:
http://www.freepascal.org/docs-html/ref/refse8.html#x20-190001.8 ? (need a
bug report created?) or is it documented somewhere else?

CodeTools syntax highlighter won't recognize the syntax as characters
either (delphi 7 highlighter doesn't recognize it as a character escaping
as well)

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Dmitry Boyarintsev
hmm.. the character escaping is somewhat tricky.
The following code compiles:
writeln(^_^));

thanks,
Dmitry

On Mon, Jan 19, 2015 at 8:17 AM, Dmitry Boyarintsev <
skalogryz.li...@gmail.com> wrote:

> Hello,
>
> today I saw this kind of character escaping:
> var
>   a :char;
> begin
>   a:=^M; // char(13)
>   writeln(^X);  // char(24)
> end;
>
> The code of the character is derived as ord(letter)-ord('A')+1
> Not sure which pascal its inherited from... but Delphi 7 does compile it
> too.
>
> I vaguely remember it seeing before once .. and ... a lot of time ago.
>
> Should it be added to this page:
> http://www.freepascal.org/docs-html/ref/refse8.html#x20-190001.8 ? (need
> a bug report created?) or is it documented somewhere else?
>
> CodeTools syntax highlighter won't recognize the syntax as characters
> either (delphi 7 highlighter doesn't recognize it as a character escaping
> as well)
>
> thanks,
> Dmitry
>
>
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Linker script doesn't search in /usr/lib32 when cross compiling from x86_64 to i386

2015-01-19 Thread Jonas Maebe


On 11 Jan 2015, at 08:53, leledumbo wrote:

The weird thing is that the linker only looks at /lib and /usr/lib,  
but not

/usr/lib32, which should be the location of 32-bit libraries on 64-bit
system. Using -Cn, I can see that link.res doesn't contain path to
/usr/lib32, and manually changing it makes the linking success.


Because we don't use the linker's "-T" option (the one the linker  
warning refers to), the link.res should be added to the built-in  
linker script of your system rather than replace it. This built-in  
linker script should already contain the default library paths. Run  
"ld -m elf_i386 --verbose" to see this built-in linker script. The  
default directories are listed via SEARCH_DIR() near the top.


I don't know what could have changed in FPC to cause your observed  
change. Did you perhaps also regenerate your fpc.cfg configuration  
file when updating? Maybe something changed in that regard.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Frederic Da Vitoria
2015-01-19 14:17 GMT+01:00 Dmitry Boyarintsev :

> Hello,
>
> today I saw this kind of character escaping:
> var
>   a :char;
> begin
>   a:=^M; // char(13)
>   writeln(^X);  // char(24)
> end;
>
> The code of the character is derived as ord(letter)-ord('A')+1
> Not sure which pascal its inherited from... but Delphi 7 does compile it
> too.
>
> I vaguely remember it seeing before once .. and ... a lot of time ago.
>

IIRC good old Turbo Pascal had this too.

-- 
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Linker script doesn't search in /usr/lib32 when cross compiling from x86_64 to i386

2015-01-19 Thread leledumbo
> Because we don't use the linker's "-T" option (the one the linker   
> warning refers to), the link.res should be added to the built-in   
> linker script of your system rather than replace it. This built-in   
> linker script should already contain the default library paths. Run   
> "ld -m elf_i386 --verbose" to see this built-in linker script. The   
> default directories are listed via SEARCH_DIR() near the top. 
> 
> I don't know what could have changed in FPC to cause your observed   
> change. Did you perhaps also regenerate your fpc.cfg configuration   
> file when updating? Maybe something changed in that regard.

Sorry, I forget to tell you that Marco has given the answer by using -Xd. ld
-m elf_i386 --verbose does show the forbidden-for-32-bit-target paths, so
it's ld behavior. I now specify correct -Fl surrounded in #ifdef - #endif
with target cpu as condition in my fpc.cfg.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Linker-script-doesn-t-search-in-usr-lib32-when-cross-compiling-from-x86-64-to-i386-tp5720749p5720799.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Howard Page-Clark

On 19/01/2015 13:29, Dmitry Boyarintsev wrote:


Not sure which pascal its inherited from... but Delphi 7 does
compile it too.


It was certainly a feature of the first TurboPascal, and perhaps was in 
even earlier Pascal compilers, enabling simple insertion of control 
characters from the keyboard.
Later superseded by the "control string" syntax (#nnn) which gave access 
to all 8-bit ASCII values, it was retained by Borland for backwards 
compatibility reasons. A complication for parsers since "^" has other 
meanings of far more significance in most Pascal code.



---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker script doesn't search in /usr/lib32 when cross compiling from x86_64 to i386

2015-01-19 Thread Jonas Maebe


On 19 Jan 2015, at 16:22, leledumbo wrote:


Because we don't use the linker's "-T" option (the one the linker
warning refers to), the link.res should be added to the built-in
linker script of your system rather than replace it. This built-in
linker script should already contain the default library paths. Run
"ld -m elf_i386 --verbose" to see this built-in linker script. The
default directories are listed via SEARCH_DIR() near the top.

I don't know what could have changed in FPC to cause your observed
change. Did you perhaps also regenerate your fpc.cfg configuration
file when updating? Maybe something changed in that regard.


Sorry, I forget to tell you that Marco has given the answer by using  
-Xd.


That should not be necessary.


ld
-m elf_i386 --verbose does show the forbidden-for-32-bit-target paths,


But does it also show the 32 bit ones? If not, you should probably  
file a bug report against your distribution, and the difference  
presumably did not come from an update of FPC, but from an update of  
your system.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread leledumbo
> Should it be added to this page:
http://www.freepascal.org/docs-html/ref/refse8.html#x20-190001.8 ? (need a
bug report created?) or is it documented somewhere else?

http://www.freepascal.org/docs-html/ref/refsu7.html



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/character-escaping-with-LETTER-tp5720795p5720802.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Mattias Gaertner
On Mon, 19 Jan 2015 08:17:52 -0500
Dmitry Boyarintsev  wrote:

>[...]
>   a:=^M; // char(13)
>[...]
> CodeTools syntax highlighter won't recognize the syntax as characters
> either (delphi 7 highlighter doesn't recognize it as a character escaping
> as well)

FYI: Codetools do not have a syntax highlighter. In Lazarus the
highligher of synedit (TSynPasSyn) is used.

Codetools should parse it correctly.

Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Dmitry Boyarintsev
On Mon, Jan 19, 2015 at 11:02 AM, leledumbo 
wrote:

>
> http://www.freepascal.org/docs-html/ref/refsu7.html
>

The beginning of the section. Shame on me.
"The compiler is rather sloppy about the characters it allows after the
caret, but in general one should assume only letters"

Looking at scanner.pas, characters are interpreted as following:
 '^' :
 begin
   readchar;
   c:=upcase(c);
   if c<#64 then
 c:=chr(ord(c)+64)
   else
 c:=chr(ord(c)-64);
  ...

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Dmitry Boyarintsev
On Mon, Jan 19, 2015 at 11:05 AM, Mattias Gaertner <
nc-gaert...@netcologne.de> wrote:

> FYI: Codetools do not have a syntax highlighter. In Lazarus the
> highligher of synedit (TSynPasSyn) is used.
>

I was hoping to hear that. I had some concerns about it at the time I was
looking at SynEdit's code and saw a lot of {$ifdef lazarus}.
SynPas doesn't recognize the expression as a character, but I can't say
that's a big issue :)

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Martin Frb

On 19/01/2015 13:17, Dmitry Boyarintsev wrote:


CodeTools syntax highlighter won't recognize the syntax as characters 
either (delphi 7 highlighter doesn't recognize it as a character 
escaping as well)




Add  that to the bugtracker please (as synedit HL issue).

It is probably easy to fix, simple a question of not forgetting it
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] SCGI in Pascal?

2015-01-19 Thread silvioprog
Hello,

Can any one inform if exists a FPC or Delphi implementation to this
protocol [1]?

Thank you!

[1] - http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface

--
Silvio Clécio
My public projects - github.com/silvioprog
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Linker script doesn't search in /usr/lib32 when cross compiling from x86_64 to i386

2015-01-19 Thread Marco van de Voort
In our previous episode, Jonas Maebe said:
> >
> > Sorry, I forget to tell you that Marco has given the answer by using  
> > -Xd.
> 
> That should not be necessary.

-Xd has nothing to do with linker scripts from ld. It prevents FPC t_linux
  code from adding default paths to the script.
 
For target i386  t_linux:133

Which are fine for i386 hosted-and-targeted binaries, but not for i386 
targeting binaries
on a x86_64 hosted system.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker script doesn't search in /usr/lib32 when cross compiling from x86_64 to i386

2015-01-19 Thread Jonas Maebe
On 19/01/15 20:27, Marco van de Voort wrote:
> In our previous episode, Jonas Maebe said:
>>>
>>> Sorry, I forget to tell you that Marco has given the answer by using  
>>> -Xd.
>>
>> That should not be necessary.
> 
> -Xd has nothing to do with linker scripts from ld. It prevents FPC t_linux
>   code from adding default paths to the script.

I know, and it should not be necessary.

> For target i386  t_linux:133
> 
> Which are fine for i386 hosted-and-targeted binaries, but not for i386 
> targeting binaries
> on a x86_64 hosted system.

The linker will simply skip libraries for incompatible architectures.


Jonas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] SCGI in Pascal?

2015-01-19 Thread Michael Van Canneyt



On Mon, 19 Jan 2015, silvioprog wrote:


Hello,
Can any one inform if exists a FPC or Delphi implementation to this protocol 
[1]?

Thank you!

[1] - http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface


I haven't found any.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal