Menu

#24 patch for expression list

Unstable (example)
open
nobody
None
5
2014-04-15
2014-03-05
No

When one does
ngspice 101 -> print 1 2
one can get two value
1 = 1.000000e+00
2 = 2.000000e+00
.
However, '1 -1' is parsed to one equation and
ngspice 102 -> print 1 -1
1 -1 = 0.000000e+00
.

My patch is to parse the words separated with ',' to the list of nodes as the followings.
ngspice 101 -> print 1,-1
1 = 1.000000e+00
-1 = -1.00000e+00
This rule can be adopted to another command, e.g. plot so that one can plot two lines "x, -x".
The drawback of this patch is that one must use '()' to express the complex number:
ngspice 102 -> print (1,-1)
(1,-1) = 1.000000e+00,-1.00000e+00

1 Attachments

Discussion

  • Robert Larice

    Robert Larice - 2014-03-05

    ~~~~~
    :::html
    Hello,

    your patches would be easier to read and understand, if you
    1) would use "git format-patch"
    (which automatically includes a "commit" message,
    and the exact file paths, ready for use)
    2) would refrain from commenting existant code
    and adding new lines.
    Instead please simply remove lines and add lines.
    (not more than necessairy)
    Ususually one can then instantly see the business in
    the diff itself.
    If you have troubles with git,
    then please use "diff -U2" (ore more)

    Thank You,
    Robert

     

    Last edit: Robert Larice 2014-03-05
  • Anonymous

    Anonymous - 2014-03-06

    Hello Robert,
    I have made my patch again according to your advice.
    Thank you,
    Y. Niitsu

     
  • Robert Larice

    Robert Larice - 2014-04-15

    Thank You,

    modified versions of
    0004-parse-recursive-indexing-foo-bar-n.patch
    and
    0001-Fix-buffer-over-run.patch

    are in the ngspice source repository now.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.