Changeset 3493


Ignore:
Timestamp:
08/24/03 18:30:18 (19 years ago)
Author:
piso
Message:

isDefiner(): don't include DEFCONSTANT, DEFPARAMETER or DEFVAR!

File:
1 edited

Legend:

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

    r2969 r3493  
    33 *
    44 * Copyright (C) 1998-2003 Peter Graves
    5  * $Id: LispFormatter.java,v 1.31 2003-07-17 00:47:06 piso Exp $
     5 * $Id: LispFormatter.java,v 1.32 2003-08-24 18:30:18 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    9696                case STATE_CAR: {
    9797                    String token = text.substring(tokenBegin, tokenEnd).trim();
    98                     if (LispMode.isDefiner(token)) {
     98                    if (isDefiner(token)) {
    9999                        if (isPositionFunctional(text, tokenBegin, currentLine))
    100100                            format = LISP_FORMAT_DEFUN;
     
    136136            tokenBegin = tokenEnd;
    137137        }
     138    }
     139
     140    // Don't include DEFCONSTANT, DEFPARAMETER or DEFVAR!
     141    private static final String[] definers = new String[] {
     142        "defclass", "define-condition", "defmacro", "defmethod", "defstruct",
     143        "deftype", "defun"
     144    };
     145
     146    private static final boolean isDefiner(String s)
     147    {
     148        if (s.length() >= 5 && s.startsWith("def"))
     149            if (Utilities.isOneOf(s, definers))
     150                return true;
     151
     152        return false;
    138153    }
    139154
Note: See TracChangeset for help on using the changeset viewer.