#888 javascript symbol parsing incorrect

v1.23
closed-fixed
Filetypes (68)
3
2014-08-14
2012-09-17
Mike D
No

Geany 1.22
The parsed symbols in a javascript file are corrupted/lost with the use of this simple syntax:

for(i=0;i<1;i++)
if(something)
do_whatever();

The lack of brackets is allowable for single-statements following both 'for' and 'if' keywords, but Geany is not parsing it correctly.
I haven't tried with other similar languages.

Discussion

  • Mike D
    Mike D
    2012-09-17

    On Ubuntu 12.04, also.

     
    • priority: 5 --> 3
    • status: open --> open-accepted
     
  • OK I can confirm this with Git version too, nesting constructs without braces if this construct is the last one in a function breaks further parsing. It seems like it prevents the next token to be properly parsed. Note that this doesn't happen if removing either the "if" or the "for".

     
  • Hum no, actually it only happens with any unbraced "if", next token is eaten. But that JS parser is a mess.

     
  • Now fixed in Git, thanks for reporting.

     
    • milestone: --> v1.23
    • assigned_to: nobody --> colombanw
    • status: open-accepted --> closed-fixed