[Scilab-users] SciNotes and printf("...\n")

classic Classic list List threaded Threaded
11 messages Options
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] SciNotes and printf("...\n")

Dear all,

what is the reason that SciNotes changes the colour from

printf(".\n");
to

printf("...\n");
In fact colour changes already when printing 2 dots.

Though there is no error, its a bit confusing, since SciNotes indicates that the leading quote sign is missing.


I searched the SciNotes settings (scilab 6.0.2), but didn't find a setting that controls the appearance.


Thanks,
Philipp

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: SciNotes and printf("...\n")

Le 12/04/2019 à 11:47, P M a écrit :
Dear all,

what is the reason that SciNotes changes the colour from

printf(".\n");
to

printf("...\n");
In fact colour changes already when printing 2 dots.

Out of texts, ".." are continuation dots, but Scinotes no longer manages them correctly for the syntax highlighting: http://bugzilla.scilab.org/14565



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
amonmayr amonmayr
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? SciNotes and printf("...\n")

In reply to this post by der_Phil
Hello,

I've seen the same with scinotes in 6.0.2, I don't remember seeing this in previous version.
What occurs is that scinotes interprets two dots ".." as the continuation mark and stops coloring the rest of the line as string.
(if you separate the two consecutive dots, the coloring is back to something nice).

Cheers,

Antoine
 
 
Le Vendredi, Avril 12, 2019 11:47 CEST, P M <[hidden email]> a écrit:
 

> Dear all,
>
> what is the reason that SciNotes changes the colour from
>
> printf(".\n");
>
> to
>
> printf("...\n");
>
> In fact colour changes already when printing 2 dots.
>
> Though there is no error, its a bit confusing, since SciNotes indicates
> that the leading quote sign is missing.
>
>
> I searched the SciNotes settings (scilab 6.0.2), but didn't find a setting
> that controls the appearance.
>
>
> Thanks,
> Philipp

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? SciNotes and printf("...\n")


Antoine,

The continuation mark .. doesn't work within strings. Something like this

disp("Hello, ..
world")

produces an error (actually, two errors).

I think it would be relatively simple to fix this syntax-highlighting bug by just not letting that 2 dots trigger a change in syntax color highlighting within a string.

Indeed, as per the documentation (help dot) this seems to be the only valid use of .. other than at the end of a line or followed by a comment.

If one runs
, for instance

a
= [1 2 3 .. 4 5 6]

the Console enters in a mode expecting something more (> instead of -->), the same as in the case of a line with a for, but I don't succeed finding how to finish except cancelling with Ctrl-C.

Regards,

Federico Miyara


On 12/04/2019 14:39, Antoine Monmayrant wrote:
Hello,

I've seen the same with scinotes in 6.0.2, I don't remember seeing this in previous version.
What occurs is that scinotes interprets two dots ".." as the continuation mark and stops coloring the rest of the line as string.
(if you separate the two consecutive dots, the coloring is back to something nice).

Cheers,

Antoine 
 
 
Le Vendredi, Avril 12, 2019 11:47 CEST, P M [hidden email] a écrit: 
 
Dear all,

what is the reason that SciNotes changes the colour from

printf(".\n");

to

printf("...\n");

In fact colour changes already when printing 2 dots.

Though there is no error, its a bit confusing, since SciNotes indicates
that the leading quote sign is missing.


I searched the SciNotes settings (scilab 6.0.2), but didn't find a setting
that controls the appearance.


Thanks,
Philipp
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users




Libre de virus. www.avast.com

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Christophe Dang Ngoc Chan Christophe Dang Ngoc Chan
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Re: ?==?utf-8?q? SciNotes and printf("...\n")

In reply to this post by amonmayr
Hello,

> De : Antoine Monmayrant
> Envoyé : vendredi 12 avril 2019 19:39
>
> > Le Vendredi, Avril 12, 2019 11:47 CEST, P M <[hidden email]> a
> > écrit:
> >
> > what is the reason that SciNotes changes the colour from
> >
> > printf(".\n");
> >
> > to
> >
> > printf("...\n");
>
> What occurs is that scinotes interprets two dots ".." as the continuation mark
> and stops coloring the rest of the line as string.

A workaround would be to use the typographic continuation dots « … »,
Unicode U+2026, although it is far less convenient to type
(and as long as everything involved supports Unicode, e.g. UTF-8 encoding).

And any typography freak LaTeXist would tell you that three dots
do not have the correct spacing :-D

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Re: ?==?utf-8?q? SciNotes and printf("...\n")

...interesting.....so it is possible to  printf(" Unicode \n")      ?

printf(<<...>>)

Am Mo., 15. Apr. 2019 um 08:55 Uhr schrieb Dang Ngoc Chan, Christophe <[hidden email]>:
Hello,

> De : Antoine Monmayrant
> Envoyé : vendredi 12 avril 2019 19:39
>
> > Le Vendredi, Avril 12, 2019 11:47 CEST, P M <[hidden email]> a
> > écrit:
> >
> > what is the reason that SciNotes changes the colour from
> >
> > printf(".\n");
> >
> > to
> >
> > printf("...\n");
>
> What occurs is that scinotes interprets two dots ".." as the continuation mark
> and stops coloring the rest of the line as string.

A workaround would be to use the typographic continuation dots « … »,
Unicode U+2026, although it is far less convenient to type
(and as long as everything involved supports Unicode, e.g. UTF-8 encoding).

And any typography freak LaTeXist would tell you that three dots
do not have the correct spacing :-D

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
der_Phil der_Phil
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Re: ?==?utf-8?q? SciNotes and printf("...\n")

sorry... I pressed the "send" button accidently


...interesting.....so it is possible to  printf(" Unicode \n")      ?

printf(<<...>>)                                    // creates an error as expected

printf("<< ... >>") and printf(" ... ")     // doesn't change anything compared to printf(" .. ")

I probably misunderstand...

BR
Philipp




Am Mo., 15. Apr. 2019 um 10:57 Uhr schrieb P M <[hidden email]>:
...interesting.....so it is possible to  printf(" Unicode \n")      ?

printf(<<...>>)

Am Mo., 15. Apr. 2019 um 08:55 Uhr schrieb Dang Ngoc Chan, Christophe <[hidden email]>:
Hello,

> De : Antoine Monmayrant
> Envoyé : vendredi 12 avril 2019 19:39
>
> > Le Vendredi, Avril 12, 2019 11:47 CEST, P M <[hidden email]> a
> > écrit:
> >
> > what is the reason that SciNotes changes the colour from
> >
> > printf(".\n");
> >
> > to
> >
> > printf("...\n");
>
> What occurs is that scinotes interprets two dots ".." as the continuation mark
> and stops coloring the rest of the line as string.

A workaround would be to use the typographic continuation dots « … »,
Unicode U+2026, although it is far less convenient to type
(and as long as everything involved supports Unicode, e.g. UTF-8 encoding).

And any typography freak LaTeXist would tell you that three dots
do not have the correct spacing :-D

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? SciNotes and printf("...\n")

In reply to this post by fmiyara
Hello Federico,

Le 13/04/2019 à 17:13, Federico Miyara a écrit :

Antoine,

The continuation mark .. doesn't work within strings. Something like this

disp("Hello, ..
world")

produces an error (actually, two errors).

I think it would be relatively simple to fix this syntax-highlighting bug by just not letting that 2 dots trigger a change in syntax color highlighting within a string.

Please do not hesitate to post a patch (on the bugzilla thread or on the CodeReview), if you have clear idea about how to fix this.

Regards
Samuel


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: {EXT} Re: ?==?utf-8?q? SciNotes and printf("...\n")

In reply to this post by der_Phil
Le 15/04/2019 à 11:01, P M a écrit :
> sorry... I pressed the "send" button accidently
>
>
> ...interesting.....so it is possible to  printf(" Unicode \n")      ?

Sure. (matrices of) strings and UTF-8 support are one of the big assets
of Scilab.

>
> printf(<<...>>)  // creates an error as expected
>
> printf("<< ... >>") and printf(" ... ")     // doesn't change anything
> compared to printf(" .. ")
>
> I probably misunderstand...

The input in your message are regular ascii characters. The difference
is here:

--> printf("<< ... >>") // ascii
<< ... >>

--> printf("« … »")
« … »

--> s = "ScilabはUTF-8文字を受け入れます"
  s  =
  ScilabはUTF-8文字を受け入れます

--> printf(s)
ScilabはUTF-8文字を受け入れます

--> part(s,13:$)
  ans  =
  文字を受け入れます

-->

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? SciNotes and printf("...\n")

In reply to this post by Samuel GOUGEON

Samuel,

I'm not sure I can (I have already said I'm not fluent in C), but if you would kindly hint me how to locate, in general, the source code of a specific feature, may be I can in a future try to do something about it...

Regards,

Federico


On 15/04/2019 06:04, Samuel Gougeon wrote:
Hello Federico,

Le 13/04/2019 à 17:13, Federico Miyara a écrit :

Antoine,

The continuation mark .. doesn't work within strings. Something like this

disp("Hello, ..
world")

produces an error (actually, two errors).

I think it would be relatively simple to fix this syntax-highlighting bug by just not letting that 2 dots trigger a change in syntax color highlighting within a string.

Please do not hesitate to post a patch (on the bugzilla thread or on the CodeReview), if you have clear idea about how to fix this.

Regards
Samuel



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


Libre de virus. www.avast.com

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? SciNotes and printf("...\n")

Le 15/04/2019 à 21:42, Federico Miyara a écrit :
>
> Samuel,
>
> I'm not sure I can (I have already said I'm not fluent in C), but if
> you would kindly hint me how to locate, in general, the source code of
> a specific feature, may be I can in a future try to do something about
> it...

Follow the bug's report, and you will get some hint in comments.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users