fede
Hi,
is it possible to add support for single-line (//) and multiple-line (/**/) comments for the ST language?
They are really very useful!

Thank you,
Federico
Reply 0 0
thiagoralves
Comments on ST are defined like this
(* THIS IS A COMMENT *)

This is already implemented and works
Reply 0 0
ptlia
This is only supported for multiple-line.

But is it possible to add support for single-line (//) ?  This is an issue when we import code for other editor, it's basic featcher.
Reply 0 0
r2k-in-the-vortex
IEC 61131-3:2003 Chapter 2.1.5, the only format specified is (* comments *), with (* (* nested *) *) comments specified as an error at that - such is the standard.
There is nothing mentioned about multi line comments, they recommend the following
(*****************************)
(* How's that for multiline  *)
(*****************************)

Actually, the previous section says you can't have whitespace in comments..... yeah, that's electricians writing programming language spec for you.

// comments are a vendor specific deviation from the standard which are not supported by Matiec compiler or Beremiz editor.

And it's not such a trivial implementation at all, consider the following line:
Str := '// this is not a comment'; // but this is


Or better yet, if the compiler deviates even more from standard
 
Str := '//and what about (*\
//if your compiler supports*) multiline string literals'; // and // comments both?
 

To give you some hope, I'm working on adding RuSTy as a experimental alternative to Matiec, that compiler does support // and /* */ comments both. Just don't expect it to be default experience of OpenPLC any time too soon never mind that I have no idea how to make it play nice with editor.
Reply 0 0
Reply