﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1711	##sys#read with -keyword-style prefix transforms bare colon into empty symbol	alicemaz		"##sys#read recognizes prefix keywords by ignoring the leading colon and suffix keywords by consuming the trailing colon and then dropping it upon confirming it's the last token in an identifier. I added another case that adds the colon back in the prefix case if no tokens follow

the main purpose of this is to allow : from chicken.type to be used in prefix mode. presently it is a syntax error

also I fix a silly case where multiple colons would be dropped for prefix keywords, matching the suffix behavior where one is semantically meaningful and the rest go on the identifier

tested on PLATFORM=linux. code block below shows 5.2.0 behavior with prefix, patched behavior with prefix, and suffix behavior for comparison (which is unchanged between versions)

{{{
alice@bellona:~/work/misc/typetest % cat src/typetest.scm
(define prefix :pre)
(define suffix suf:)
(define canonical #:can)
(define blank :)

(define qpre :|qpre|)
(define qsuf |qsuf|:)
(define qpreblank :||)
(define qsufblank ||:)

(define triplepre :::tp)
(define triplesuf ts:::)

(: typesig fixnum)
(define typesig 1)
alice@bellona:~/work/misc/typetest % ( chicken src/typetest.scm -keyword-style prefix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null
[source]
(define prefix #:pre)
(define suffix |suf:|)
(define canonical #:can)
(define blank ||)
(define qpre #:qpre)
(define qsuf |qsuf:|)
(define qpreblank #:||)
(define qsufblank :)
(define triplepre #:tp)
(define triplesuf |ts:::|)
(|| typesig fixnum)
(define typesig 1)
alice@bellona:~/work/misc/typetest % ( dev-chicken src/typetest.scm -keyword-style prefix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null
[source]
(define prefix #:pre)
(define suffix |suf:|)
(define canonical #:can)
(define blank :)
(define qpre #:qpre)
(define qsuf |qsuf:|)
(define qpreblank #:||)
(define qsufblank :)
(define triplepre #:|::tp|)
(define triplesuf |ts:::|)
(: typesig fixnum)
(define typesig 1)
alice@bellona:~/work/misc/typetest % ( dev-chicken src/typetest.scm -keyword-style suffix -check-syntax -debug 1 | grep -v '^$' > /dev/tty ) > & /dev/null
[source]
(define prefix |:pre|)
(define suffix #:suf)
(define canonical #:can)
(define blank :)
(define qpre |:qpre|)
(define qsuf #:qsuf)
(define qpreblank :)
(define qsufblank #:||)
(define triplepre |:::tp|)
(define triplesuf #:|ts::|)
(: typesig fixnum)
(define typesig 1)
}}}
"	defect	closed	minor	someday	core libraries	5.2.0	fixed			easy
