]> gitweb.factorcode.org Git - factor.git/commitdiff
ALIEN: now reads a hexadecimal integer instead of a decimal one, since in general...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 13 Sep 2009 02:17:53 +0000 (21:17 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sun, 13 Sep 2009 02:17:53 +0000 (21:17 -0500)
basis/alien/prettyprint/prettyprint.factor
basis/alien/syntax/syntax-docs.factor
basis/alien/syntax/syntax.factor
basis/compiler/tests/intrinsics.factor
core/alien/alien-tests.factor

index 0794ab7789848709de2ac80db8ccb8c604ccb75a..0ffd5023a74b403e422c844ff12a3fceefd5cbf7 100644 (file)
@@ -1,14 +1,15 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel combinators alien alien.strings alien.syntax
-prettyprint.backend prettyprint.custom prettyprint.sections ;
+math.parser prettyprint.backend prettyprint.custom
+prettyprint.sections ;
 IN: alien.prettyprint
 
 M: alien pprint*
     {
         { [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
         { [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
-        [ \ ALIEN: [ alien-address pprint* ] pprint-prefix ]
+        [ \ ALIEN: [ alien-address >hex text ] pprint-prefix ]
     } cond ;
 
 M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
index c9e03724f5a28a55f1fa04bbf584b53a4001c31b..c9190f68c0bc8db23b16117210b4658060abb932 100644 (file)
@@ -9,7 +9,7 @@ HELP: DLL"
 
 HELP: ALIEN:
 { $syntax "ALIEN: address" }
-{ $values { "address" "a non-negative integer" } }
+{ $values { "address" "a non-negative hexadecimal integer" } }
 { $description "Creates an alien object at parse time." }
 { $notes "Alien objects are invalidated between image saves and loads, and hence source files should not contain alien literals; this word is for interactive use only. See " { $link "alien-expiry" } " for details." } ;
 
index 2b0270d5f5897a4cf110a7c68a8fafb88d724531..e8206c6968fd993d11b30c3cc2ca737aa017c4f9 100644 (file)
@@ -9,7 +9,7 @@ IN: alien.syntax
 
 SYNTAX: DLL" lexer get skip-blank parse-string dlopen parsed ;
 
-SYNTAX: ALIEN: scan string>number <alien> parsed ;
+SYNTAX: ALIEN: 16 scan-base <alien> parsed ;
 
 SYNTAX: BAD-ALIEN <bad-alien> parsed ;
 
index 988164143f53c9c2d6f2775359685009b6fe2188..ad2d2c8be5c0ec2cd28997056507b39a4b89c85d 100644 (file)
@@ -472,15 +472,15 @@ cell 8 = [
 ] unit-test
 
 [ ALIEN: 123 ] [
-    123 [ <alien> ] compile-call
+    HEX: 123 [ <alien> ] compile-call
 ] unit-test
 
 [ ALIEN: 123 ] [
-    123 [ { fixnum } declare <alien> ] compile-call
+    HEX: 123 [ { fixnum } declare <alien> ] compile-call
 ] unit-test
 
 [ ALIEN: 123 ] [
-    [ 123 <alien> ] compile-call
+    [ HEX: 123 <alien> ] compile-call
 ] unit-test
 
 [ f ] [
@@ -522,8 +522,8 @@ cell 8 = [
 [ ALIEN: 1234 ALIEN: 2234 ] [
     ALIEN: 234 [
         { c-ptr } declare
-        [ 1000 swap <displaced-alien> ]
-        [ 2000 swap <displaced-alien> ] bi
+        [ HEX: 1000 swap <displaced-alien> ]
+        [ HEX: 2000 swap <displaced-alien> ] bi
     ] compile-call
 ] unit-test
 
index 2d2cec168fe662fde5aa3b9b1875b542647f84ad..7eaa5cc50b5a8c771347d4a1a42e565f4e7a9c3f 100644 (file)
@@ -55,7 +55,7 @@ cell 8 = [
     ] unit-test
 ] when
 
-[ "ALIEN: 1234" ] [ 1234 <alien> unparse ] unit-test
+[ "ALIEN: 1234" ] [ HEX: 1234 <alien> unparse ] unit-test
 
 [ ] [ 0 B{ 1 2 3 } <displaced-alien> drop ] unit-test