fix syntax colorer for #true and #false

This commit is contained in:
Matthew Flatt 2010-10-12 08:21:56 -06:00
parent b80d327d40
commit bf4fc2574c
2 changed files with 23 additions and 5 deletions

View File

@ -302,7 +302,14 @@
(lexer
[(:+ scheme-whitespace)
(ret lexeme 'white-space #f start-pos end-pos 'continue)]
[(:or "#t" "#f" "#T" "#F" character
[(:: (:or "#true" "#false" "#t" "#f" "#T" "#F")
(:* (:~ identifier-delims)))
(ret lexeme
(if (member lexeme '("#true" "#false" "#t" "#f" "#T" "#F"))
'constant
'error)
#f start-pos end-pos 'datum)]
[(:or character
(make-num digit2 radix2)
(make-num digit8 radix8)
(make-num digit10 (:? radix10))

View File

@ -89,10 +89,21 @@
(test "}" "p")
;; #
(test "#fq" "cci")
(test "#Fq" "cci")
(test "#tq" "cci")
(test "#Tq" "cci")
(test "#fq" "xxx")
(test "#Fq" "xxx")
(test "#tq" "xxx")
(test "#Tq" "xxx")
(test "#true" "ccccc")
(test "#false" "cccccc")
(test "#f q" "cc i")
(test "#F q" "cc i")
(test "#t q" "cc i")
(test "#T q" "cc i")
(test "#true q" "ccccc i")
(test "#false q" "cccccc i")
(test "#f(q" "ccpi")
(test "#T(q" "ccpi")
(test "#true{q" "cccccpi")
(test "#012423(a" "ppppppppi")
(test "#1{a" "pppi")
(test "#1[a" "pppi")