Changeset 13256


Ignore:
Timestamp:
03/21/11 06:24:58 (11 years ago)
Author:
Mark Evenson
Message:

The sharpsign backslash macro now understands \unnnn as an escape for a Unicode chararcter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/LispCharacter.java

    r12585 r13256  
    554554    LispCharacter lc = namedToChar.get(lower);
    555555    if (lc!=null) return lc.value;
     556    if (lower.length() == 5
     557        && lower.startsWith("u")) {
     558        try {
     559            int i = Integer.parseInt(lower.substring(1, 5), 16);
     560            return i;
     561        } catch (NumberFormatException e) {};
     562    }
     563
    556564    if (lower.equals("null"))
    557565      return 0;
     
    618626        return "Rubout";
    619627      }
    620     if (c<0 || c>255) return null;
     628
     629    if (c > 255) {
     630        return "U" + Integer.toString(c, 16);
     631    }
     632       
     633    if (c<0) return null;
    621634    return lispChars.get(c).name;
    622635  }
Note: See TracChangeset for help on using the changeset viewer.