Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
abcl
abcl
Commits
2219fe78
Commit
2219fe78
authored
Jan 16, 2013
by
mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files
Fixes #294: Reader doesn't recognize terminating characters in some cases.
Patch and test by Stas.
parent
5651c144
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/org/armedbear/lisp/Stream.java
View file @
2219fe78
...
...
@@ -739,18 +739,11 @@ public class Stream extends StructureObject {
private
static
final
boolean
isTokenDelimiter
(
char
c
,
Readtable
rt
)
{
switch
(
c
)
{
case
'"'
:
case
'\''
:
case
'('
:
case
')'
:
case
','
:
case
';'
:
case
'`'
:
return
true
;
default
:
return
rt
.
isWhitespace
(
c
);
}
byte
type
=
rt
.
getSyntaxType
(
c
);
return
type
==
Readtable
.
SYNTAX_TYPE_TERMINATING_MACRO
||
type
==
Readtable
.
SYNTAX_TYPE_WHITESPACE
;
}
public
LispObject
readDispatchChar
(
char
dispChar
,
...
...
@@ -909,7 +902,8 @@ public class Stream extends StructureObject {
c
=
(
char
)
n
;
// ### BUG: Codepoint conversion
if
(
rt
.
isWhitespace
(
c
))
break
;
if
(
c
==
'('
||
c
==
')'
)
{
if
(
rt
.
getSyntaxType
(
c
)
==
Readtable
.
SYNTAX_TYPE_TERMINATING_MACRO
)
{
_unreadChar
(
c
);
break
;
}
...
...
test/lisp/abcl/bugs.lisp
View file @
2219fe78
...
...
@@ -133,3 +133,11 @@ nil)
:collecting
(
cons
x
y
))
((
0.0
.
0
)
(
0.0
.
1
)))
;; http://trac.common-lisp.net/armedbear/ticket/294
(
deftest
bugs.reader.1
(
let
((
*readtable*
*readtable*
))
(
set-macro-character
#\?
(
lambda
(
stream
char
)
(
code-char
(
read
stream
nil
nil
t
))))
'
(
a
.
?0
))
(
A
.
#\Null
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment