factor: more char:

modern-harvey2
Doug Coleman 2018-08-02 08:03:45 -04:00
parent 7730fc5c64
commit a1ad3385b9
4 changed files with 18 additions and 18 deletions

View File

@ -217,7 +217,7 @@ TUPLE: registry-enum-key ;
string-type? [
type DWORD deref REG_MULTI_SZ = [
"\0" join 2
] [ 1 ] if [ CHAR: \0 suffix ] times utf16n encode
] [ 1 ] if [ char: \0 suffix ] times utf16n encode
] when
[ hkey value-name type DWORD deref ] dip dup length
set-reg-key

View File

@ -48,11 +48,11 @@ USING: kernel sequences tools.test gap-buffer strings math ;
! test changing buffer contents
{ "factory" }
[ "factor" <gb> CHAR: y 6 pick insert* >string ] unit-test
[ "factor" <gb> char: y 6 pick insert* >string ] unit-test
! test inserting multiple elements in different places. buffer should grow
{ "refractory" }
[ "factor" <gb> CHAR: y 6 pick insert* "re" 0 pick insert* CHAR: r 3 pick insert* >string ] unit-test
[ "factor" <gb> char: y 6 pick insert* "re" 0 pick insert* char: r 3 pick insert* >string ] unit-test
! test deleting elements. buffer should shrink
{ "for" }
@ -60,19 +60,19 @@ USING: kernel sequences tools.test gap-buffer strings math ;
! more testing of nth and set-nth
{ "raptor" }
[ "factor" <gb> CHAR: p 2 pick set-nth 5 over nth 0 pick set-nth >string ] unit-test
[ "factor" <gb> char: p 2 pick set-nth 5 over nth 0 pick set-nth >string ] unit-test
! test stack/queue operations
{ "slaughter" }
[ "laughter" <gb> CHAR: s over push-start >string ] unit-test
[ "laughter" <gb> char: s over push-start >string ] unit-test
{ "pantonio" }
[ "pant" <gb> "onio" over push-end >string ] unit-test
{ CHAR: f "actor" }
{ char: f "actor" }
[ "factor" <gb> dup pop-start swap >string ] unit-test
{ CHAR: s "pant" }
{ char: s "pant" }
[ "pants" <gb> dup pop-end swap >string ] unit-test
{ "end this is the " }

View File

@ -42,8 +42,8 @@ general parsers work and the 'list of sucesses' that are returned as a
result.</p>
<pre class="code">
(1) : char-a ( inp -- result )
0 over string-nth CHAR: a = [
1 swap string-tail CHAR: a cons unit delay lunit
0 over string-nth char: a = [
1 swap string-tail char: a cons unit delay lunit
] [
drop lnil
] ifte ;

View File

@ -58,14 +58,14 @@ BT
( )'
(: pdf-string \( str -- str' \))'
( H{)'
( { HEX: 08 "\\\\b" })'
( { HEX: 0c "\\\\f" })'
( { CHAR: \\n "\\\\n" })'
( { CHAR: \\r "\\\\r" })'
( { CHAR: \\t "\\\\t" })'
( { CHAR: \\\\ "\\\\\\\\" })'
( { CHAR: \( "\\\\\(" })'
( { CHAR: \) "\\\\\)" })'
( { hex: 08 "\\\\b" })'
( { hex: 0c "\\\\f" })'
( { char: \\n "\\\\n" })'
( { char: \\r "\\\\r" })'
( { char: \\t "\\\\t" })'
( { char: \\\\ "\\\\\\\\" })'
( { char: \( "\\\\\(" })'
( { char: \) "\\\\\)" })'
( } escape-string-by "\(" "\)" surround ;)'
( )'
(: pdf-object \( str n -- str' \))'
@ -251,4 +251,4 @@ trailer
>>
startxref
4845
%%EOF
%%EOF