Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolony committed Mar 18, 2017
1 parent e090ca8 commit c532516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 55 deletions.
7 changes: 3 additions & 4 deletions src/com/bytezone/diskbrowser/visicalc/Expression.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public Expression (Sheet parent, Cell cell, String text)
switch (ch)
{
case '@': // function
String functionText = getBalancedText (line.substring (ptr));
// System.out.println ("Func : " + functionText);
String functionText = getFunctionCall (line.substring (ptr));
ptr += functionText.length ();
values.add (Function.getInstance (parent, cell, functionText));
break;
Expand Down Expand Up @@ -288,7 +287,7 @@ else if (c == ')')
}

// called for functions and expressions
static String getBalancedText (String text)
private String getBalancedText (String text)
{
int ptr = text.indexOf ('('); // find first left parenthesis
if (ptr < 0)
Expand Down Expand Up @@ -333,7 +332,7 @@ else if (c == ',' && depth == 0)
}

// receives a string starting with the function call
static String getFunctionCall (String text)
private String getFunctionCall (String text)
{
if (text.charAt (0) != '@')
throw new IllegalArgumentException ("Bad function name: " + text);
Expand Down
51 changes: 0 additions & 51 deletions src/com/bytezone/diskbrowser/visicalc/ValueList.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,6 @@ public ValueList (Sheet parent, Cell cell, String text)
}
}

// public ValueList (Sheet parent, Cell cell, String text)
// {
// this.parent = parent;
//
// int ptr = 0;
// while (ptr < text.length ())
// {
// if (text.charAt (ptr) == '@') // function
// {
// String functionText = Expression.getBalancedText (text.substring (ptr));
// Value v = new Expression (parent, cell, functionText).reduce ();
// values.add (v);
// ptr += functionText.length ();
// }
// else
// {
// String item = getNextItem (text, ptr);
// int pos = item.indexOf ("...");
// if (pos > 0) // range
// {
// Address from = new Address (item.substring (0, pos));
// Address to = new Address (item.substring (pos + 3));
// Range range = new Range (parent, from, to);
//
// for (Address address : range)
// values.add (parent.getCell (address));
// }
// else // cell/number/expression
// {
// Value v = new Expression (parent, cell, item).reduce ();
// values.add (v);
// }
// ptr += item.length ();
// }
//
// if (ptr < text.length () && text.charAt (ptr) == ',')
// ptr++;
// if (ptr < text.length () && text.charAt (ptr) == ')')
// break;
// }
// }

// return substring of text from ptr up to the next comma
// private String getNextItem (String text, int ptr)
// {
// int p = ptr;
// while (++p < text.length () && text.charAt (p) != ',')
// ;
// return text.substring (ptr, p);
// }

public int size ()
{
return values.size ();
Expand Down

0 comments on commit c532516

Please sign in to comment.