Changeset 132


Ignore:
Timestamp:
10/14/02 02:11:57 (21 years ago)
Author:
piso
Message:

depth()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/LispMode.java

    r131 r132  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: LispMode.java,v 1.4 2002-10-13 18:52:34 piso Exp $
     5 * $Id: LispMode.java,v 1.5 2002-10-14 02:11:57 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    127127            buffer.renumber();
    128128        Position start = findStartOfDefun(pos);
     129        if (pos.equals(start))
     130            return 0;
    129131        LispSyntaxIterator it = new LispSyntaxIterator(start);
    130         int depth = 0;
    131         while (it.getPosition().isBefore(pos)) {
     132        int depth = 1;
     133        while (true) {
    132134            char c = it.nextChar();
     135            if (!it.getPosition().isBefore(pos))
     136                break;
    133137            if (c == '(')
    134138                ++depth;
Note: See TracChangeset for help on using the changeset viewer.