Author Topic: Another issue of Parser of QB64. Sorry  (Read 2697 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Another issue of Parser of QB64. Sorry
« on: June 09, 2019, 10:40:58 am »
Hi guys
following another thread  https://www.qb64.org/forum/index.php?topic=1407.msg105935#msg105935 I use this code in QB64IDE  1.2[dev build] 81063e1
Code: QB64: [Select]
  1. PRINT A = (B = (C = (D = (E = (F = 0)))))
  2. PRINT A = B = C = D = F = 0
and I got a strange behaviour of parser (or only of colorizer? I don't know the internal structure of QBIDE64). About what am I talking? see attachment of the link below... if you can see the code shows variable names D and E with the same color of numbers...
Why? It may be that Parser see D like &HD and E like &HE !
yes and Why not F?  O_o 

going on with experience to catch the bug...
and if doesn't parser recognize that they are names of variables?
Well, we add as first line the all_Loved
Code: QB64: [Select]
  1. DEFINT A-Z
and it seems to solve the issue
see attachment1 image

   [ You are not allowed to view this attachment ]  

but just if you press F5 to compile after starting the compiled code the QB64IDE shows again the wrong color for D and E.  :-(

  [ You are not allowed to view this attachment ]  
Sorry the same seems to happen with QB64IDE 1.3 stable version 96937f0 :-((

  [ You are not allowed to view this attachment ]  

More experiences
If I add DEFINT A-Z the ide normalizes the color of D and E
then if I put ' at the beginning of the first line (i rem first line of code) the right color of D and E as variable stays, also after compiling the code.

Thanks to read


Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Another issue of Parser of QB64. Sorry
« Reply #1 on: June 09, 2019, 11:45:57 am »
Quote
Why? It may be that Parser see D like &HD and E like &HE !

Ah!, D and E are the letters used for expotential Scientific Notation:
Code: QB64: [Select]
  1. PRINT 23000.00000000123 * 10 ^ 20
  2. s = 23000.00000000123 * 10 ^ 20
  3.  
« Last Edit: June 09, 2019, 11:48:34 am by bplus »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Another issue of Parser of QB64. Sorry
« Reply #2 on: June 09, 2019, 05:54:52 pm »
Rats, late to the party again. Yes. I noticed that when I was working with string-math.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Another issue of Parser of QB64. Sorry
« Reply #3 on: June 10, 2019, 08:57:00 am »
@Bplus
Quote
D and E are the letters used for Scientific Notation

so parser cannot distinguish between name variables and exponential number in the text code...


@Pete
Quote
Rats, late to the party again
can I sell you a rat poison with dicumarol? It says it works  well!


Yesterday I have seen the Daily Show with Trevor Noah and he had talked about the  LGBTQ and the response of the march for eterosexual people defence. Does this last calm a bit  you?
Programming isn't difficult, only it's  consuming time and coffee

FellippeHeitor

  • Guest
Re: Another issue of Parser of QB64. Sorry
« Reply #4 on: June 10, 2019, 10:46:06 am »
It's a bug I've been trying to fix for a while now.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Another issue of Parser of QB64. Sorry
« Reply #5 on: June 10, 2019, 12:17:41 pm »
Yesterday I have seen the Daily Show with Trevor Noah and he had talked about the  LGBTQ and the response of the march for eterosexual people defence. Does this last calm a bit  you?

What does LBGTQ have to do with D and E? :D

I had to laugh at one activist who wanted to change that to LGBTSQ, with "S" standing for "straights" as that would be more "inclusive." :D :D

Well, back on topic. Wherever the bug is in the code, apparently the coder needed to further the check to include more info to determine if the D or E was being used as scientific notation or not. You also have to include for dismissing it if enclosed in quotes, etc. This parsing stuff can be a bit bitchy.

Pete

 - Happy Gay Tolerance Month!
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/