Skip to content
Snippets Groups Projects
Open macr2tree (and tree2code ?) fails for braces {2} as cells constructor
  • View options
  • macr2tree (and tree2code ?) fails for braces {2} as cells constructor

  • View options
  • Open Issue created by scilab bot

    Reported by Samuel GOUGEON (@sgougeon)

    BUG DESCRIPTION:
    ----------------
    macr2tree (and tree2code ?) fails for braces {2} as cells constructor
    
    --> function test()
      >     e = {2}
      > endfunction
    
    --> t = macr2tree(test);
    
    --> tree2code(t)
     ans  =
    
      "function test()"
      "e = 1"            <<<< WRONG
      "endfunction"    
      ""               
    
    Displaying t shows that macr2tree is guilty:
    ...
                         t(5)(2)(1)
      "equal"  "expression"  "lhs"  "endsymbol"
    
                         t(5)(2)(2)
                                t(5)(2)(2)(1)
      "cste"  "value"
                                t(5)(2)(2)(2)
    
       1.                                      <<<<< NOT in the initial code == BUG
    
    
    ---------
    
    --> function test()
      >     e = {2, "ab"}
      > endfunction
    
    --> t = macr2tree(test);
    
    --> tree2code(t)
     ans  =
    
      "function test()"
      "e = [2,"ab"]"     <<<< Brackets are used instead of braces
      "endfunction"    
      ""               
    
    
    ERROR LOG:
    ----------
    
    
    HOW TO REPRODUCE THE BUG:
    -------------------------
    function test()
        e = {2}
    endfunction
    t = macr2tree(test);
    tree2code(t)
    
    function test()
        e = {2, "ab"}
    endfunction
    t = macr2tree(test);
    tree2code(t)
    
    
    OTHER INFORMATION:
    ------------------
    * The bug 16297 could be related to this one.
    * This bug prevents upgrading mfile2sci() for braces with Scilab 6.
    • Merge request
    • Branch

    Linked items 0

  • Link items together to show that they're related or that one is blocking others.

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading