]> gitweb.factorcode.org Git - factor.git/commitdiff
let's pretend BIN: HEX: OCT: never happened
authorJoe Groff <arcata@gmail.com>
Thu, 24 Nov 2011 03:22:37 +0000 (19:22 -0800)
committerJoe Groff <arcata@gmail.com>
Thu, 24 Nov 2011 03:22:37 +0000 (19:22 -0800)
basis/io/files/info/unix/unix-docs.factor
basis/xmode/modes/factor.xml
core/parser/parser-docs.factor
core/parser/parser-tests.factor
core/syntax/syntax-docs.factor
misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage
misc/fuel/fuel-syntax.el
misc/vim/syntax/factor.vim

index 82d1e727f947ffbd2f2ea172ad30d8ba1acde5a7..425f76b18d9e8799189b85c1767583925756bcf0 100644 (file)
@@ -100,8 +100,8 @@ HELP: set-file-ids
 HELP: set-file-permissions
 { $values
      { "path" "a pathname string" } { "n" "an integer, interepreted as a string of bits" } }
-{ $description "Sets the file permissions for a given file with the supplied Unix permissions integer. Supplying an octal number with " { $link POSTPONE: OCT: } " is recommended." }
-{ $examples "Using the tradidional octal value:"
+{ $description "Sets the file permissions for a given file with the supplied Unix permissions integer." }
+{ $examples "Using the traditional octal value:"
     { $code "USING: io.files.info.unix kernel ;"
         "\"resource:license.txt\" 0o755 set-file-permissions"
     }
index 9aa545eaec5b1e30f387e3f44909ce2d53fa8777..4b4abfdb4397948554068c9230eb7dd71f3e6453 100644 (file)
                <SEQ_REGEXP TYPE="LITERAL2"\r
                        HASH_CHAR="CHAR:"\r
                        AT_WORD_START="TRUE">CHAR:\s+(\S+)</SEQ_REGEXP>\r
-               <SEQ_REGEXP TYPE="LITERAL2"\r
-                       HASH_CHAR="BIN:"\r
-                       AT_WORD_START="TRUE">BIN:\s+(\S+)</SEQ_REGEXP>\r
-               <SEQ_REGEXP TYPE="LITERAL2"\r
-                       HASH_CHAR="OCT:"\r
-                       AT_WORD_START="TRUE">OCT:\s+(\S+)</SEQ_REGEXP>\r
-               <SEQ_REGEXP TYPE="LITERAL2"\r
-                       HASH_CHAR="HEX:"\r
-                       AT_WORD_START="TRUE">HEX:\s+(\S+)</SEQ_REGEXP>\r
 \r
                <SPAN TYPE="COMMENT3" DELEGATE="STACK_EFFECT" NO_LINE_BREAK="TRUE">\r
                        <BEGIN>( </BEGIN>\r
index 9aed5b50047fdd009f47bbd9b72ee9a41ed0c7df..84f8b6dee4ece17b0a1e78a91c6cc549809562a5 100644 (file)
@@ -21,11 +21,9 @@ ARTICLE: "reading-ahead" "Reading ahead"
     (scan-token)
     (scan-datum)
 }
-"For example, the " { $link POSTPONE: HEX: } " word uses this feature to read hexadecimal literals:"
-{ $see POSTPONE: HEX: }
 "It is defined in terms of a lower-level word that takes the numerical base on the data stack, but reads the number from the parser and then adds it to the parse tree:"
 { $see parse-base }
-"Another simple example is the " { $link POSTPONE: \ } " word:"
+"A simple example is the " { $link POSTPONE: \ } " word:"
 { $see POSTPONE: \ } ;
 
 ARTICLE: "parsing-word-nest" "Nested structure"
index 560930c5ecacb49485f96f97988ad82ee002e4e0..57f060e9371ffaa7abe32297b753e3113643e953 100644 (file)
@@ -81,11 +81,6 @@ unit-test
 ! Funny bug
 [ 2 ] [ "IN: parser.tests : \0. ( -- x ) 2 ; \0." eval( -- n ) ] unit-test
 
-! These should throw errors
-[ "HEX: zzz" eval( -- obj ) ] must-fail
-[ "OCT: 999" eval( -- obj ) ] must-fail
-[ "BIN: --0" eval( -- obj ) ] must-fail
-
 DEFER: foo
 
 "IN: parser.tests USING: math prettyprint ; SYNTAX: foo 2 2 + . ;" eval( -- )
index 5a3e237ab3cc797f05218882a46eb935b8d0d88a..81d24079b0c60b3ed973ab77b0cf6f763abba4d2 100644 (file)
@@ -45,11 +45,14 @@ ARTICLE: "syntax-integers" "Integer syntax"
     "-10"
     "2432902008176640000"
 }
-"Integers are entered in base 10 unless prefixed with a base change parsing word."
-{ $subsections
-    POSTPONE: BIN:
-    POSTPONE: OCT:
-    POSTPONE: HEX:
+"Integers are entered in base 10 unless prefixed with a base-changing prefix. " { $snippet "0x" } " begins a hexadecimal literal, " { $snippet "0o" } " an octal literal, and " { $snippet "0b" } " a binary literal. A sign, if any, goes before the base prefix."
+{ $example
+    "USE: prettyprint"
+    "10 ."
+    "0b10 ."
+    "-0o10 ."
+    "0x10 ."
+    "10\n2\n-8\n16"
 }
 "More information on integers can be found in " { $link "integers" } "." ;
 
@@ -109,14 +112,14 @@ ARTICLE: "syntax-floats" "Float syntax"
     "t"
 }
 { $example
-    "1024.0 0x1.0P10 = ."
+    "-1024.0 -0x1.0P10 = ."
     "t"
 }
 { $example
     "10.125 0x1.44p3 = ."
     "t"
 }
-"The normalized hex form " { $snippet "HEX: ±1.MMMMMMMMMMMMMp±EEEE" } " allows any floating-point number to be specified precisely. The values of MMMMMMMMMMMMM and EEEE map directly to the mantissa and exponent fields of IEEE 754 representation."
+"The normalized hex form " { $snippet "±0x1.MMMMMMMMMMMMMp±EEEE" } " allows any floating-point number to be specified precisely. The values of MMMMMMMMMMMMM and EEEE map directly to the mantissa and exponent fields of the binary IEEE 754 representation."
 $nl
 "More information on floats can be found in " { $link "floats" } "." ;
 
@@ -658,27 +661,6 @@ HELP: #!
 { $values { "comment" "characters" } }
 { $description "Discards all input until the end of the line." } ;
 
-HELP: HEX:
-{ $syntax "HEX: NNN" "HEX: NNN.NNNpEEE" }
-{ $values { "N" "hexadecimal digit (0-9, a-f, A-F)" } { "pEEE" "decimal exponent value" } }
-{ $description "Adds an integer or floating-point value read from a hexadecimal literal to the parse tree." }
-{ $examples
-    { $example "USE: prettyprint" "0xff ." "255" }
-    { $example "USE: prettyprint" "0x1.8p5 ." "48.0" }
-} ;
-
-HELP: OCT:
-{ $syntax "OCT: integer" }
-{ $values { "integer" "octal digits (0-7)" } }
-{ $description "Adds an integer read from an octal literal to the parse tree." }
-{ $examples { $example "USE: prettyprint" "0o31337 ." "13023" } } ;
-
-HELP: BIN:
-{ $syntax "BIN: integer" }
-{ $values { "integer" "binary digits (0 and 1)" } }
-{ $description "Adds an integer read from an binary literal to the parse tree." }
-{ $examples { $example "USE: prettyprint" "0b100 ." "4" } } ;
-
 HELP: NAN:
 { $syntax "NAN: payload" }
 { $values { "payload" "64-bit hexadecimal integer" } }
index 199185c93de08e900bbc96d61187740b16b39061..d71e5a8f35939c82c57b9f4b43aaadde24c33cd7 100644 (file)
                        <key>name</key>
                        <string>constant.character.factor</string>
                </dict>
-               <dict>
-                       <key>match</key>
-                       <string>(^|(?&lt;=\s))((BIN:|OCT:)\s+)?-?\d+(\s|$)</string>
-                       <key>name</key>
-                       <string>constant.numeric.integer.factor</string>
-               </dict>
-               <dict>
-                       <key>match</key>
-                       <string>(^|(?&lt;=\s))HEX:\s+-?[\dA-Fa-f]+(\s|$)</string>
-                       <key>name</key>
-                       <string>constant.numeric.hexadecimal.integer.factor</string>
-               </dict>
                <dict>
                        <key>match</key>
                        <string>(^|(?&lt;=\s))-?+\d+\.\d+(E(\+|-)\d+)?(\s|$)</string>
index e2db30db3d0b1a5487d2477deb9e679541054643..e7d4f0ef17a699db47933d28d35113ad3a32f0af 100644 (file)
 (defconst fuel-syntax--parsing-words\r
   '(":" "::" ";" "&:" "<<" "<PRIVATE" ">>"\r
     "ABOUT:" "AFTER:" "ALIAS:" "ALIEN:" "ARTICLE:"\r
-    "B" "BEFORE:" "BIN:"\r
+    "B" "BEFORE:"\r
     "C:" "CALLBACK:" "C-GLOBAL:" "C-TYPE:" "CHAR:" "COM-INTERFACE:" "CONSTANT:" "CONSULT:" "call-next-method"\r
     "DEFER:" "DESTRUCTOR:"\r
     "EBNF:" ";EBNF" "ENUM:" "ERROR:" "EXCLUDE:"\r
     "f" "FORGET:" "FROM:" "FUNCTION:" "FUNCTION-ALIAS:"\r
     "GAME:" "GENERIC#" "GENERIC:"\r
     "GLSL-SHADER:" "GLSL-PROGRAM:"\r
-    "HELP:" "HEX:" "HOOK:"\r
+    "HELP:" "HOOK:"\r
     "IN:" "initial:" "INSTANCE:" "INTERSECTION:"\r
     "LIBRARY:"\r
     "M:" "M::" "MACRO:" "MACRO::" "MAIN:" "MATH:"\r
     "MEMO:" "MEMO:" "METHOD:" "MIXIN:"\r
     "NAN:"\r
-    "OCT:"\r
     "POSTPONE:" "PREDICATE:" "PRIMITIVE:" "PRIVATE>" "PROTOCOL:" "PROVIDE:"\r
     "QUALIFIED-WITH:" "QUALIFIED:"\r
     "read-only" "RENAME:" "REQUIRE:"  "REQUIRES:"\r
    '("IN:" "USE:" "FROM:" "EXCLUDE:" "QUALIFIED:" "QUALIFIED-WITH:")))\r
 \r
 (defconst fuel-syntax--int-constant-def-regex\r
-  (fuel-syntax--second-word-regex '("ALIEN:" "CHAR:" "BIN:" "HEX:" "NAN:" "OCT:")))\r
+  (fuel-syntax--second-word-regex '("ALIEN:" "CHAR:" "NAN:")))\r
 \r
 (defconst fuel-syntax--type-definition-regex\r
   (fuel-syntax--second-word-regex\r
                 "DEFER:" "DESTRUCTOR:"\r
                 "FORGET:"\r
                 "GAME:" "GENERIC:" "GENERIC#" "GLSL-PROGRAM:"\r
-                "HEX:" "HOOK:"\r
+                "HOOK:"\r
                 "IN:" "INSTANCE:"\r
                 "LIBRARY:"\r
                 "MAIN:" "MATH:" "MIXIN:"\r
                 "NAN:"\r
-                "OCT:"\r
                 "POSTPONE:" "PRIVATE>" "<PRIVATE"\r
                 "QUALIFIED-WITH:" "QUALIFIED:"\r
                 "RENAME:"\r
index fc7ac1b45818b785902f2f81098e787019dce7ee..c607472272f719143198a6b96adf49789d1be87b 100644 (file)
@@ -73,12 +73,12 @@ syn match   factorFloat         /\<-\=[0-9]\([0-9,]*[0-9]\)\?\.[0-9,]*[0-9]\+\([
 syn match   factorPosRatio      /\<+\=[0-9]\([0-9,]*[0-9]\)\?\(+[0-9]\([0-9,]*[0-9]\+\)\?\)\?\/-\=[0-9]\([0-9,]*[0-9]\+\)\?\.\?\>/
 syn match   factorNegRatio      /\<\-[0-9]\([0-9,]*[0-9]\)\?\(\-[0-9]\([0-9,]*[0-9]\+\)\?\)\?\/-\=[0-9]\([0-9,]*[0-9]\+\)\?\.\?\>/
 syn region  factorComplex       start=/\<C{\>/ end=/\<}\>/ contains=@factorReal
-syn match   factorBinErr        /\<BIN:\s\+-\=[01,]*[^01 ]\S*\>/
-syn match   factorBinary        /\<BIN:\s\+-\=[01,]\+\>/
-syn match   factorHexErr        /\<HEX:\s\+-\=\(,\S*\|\S*,\|[-0-9a-fA-Fp,]*[^-0-9a-fA-Fp, ]\S*\)\>/
-syn match   factorHex           /\<HEX:\s\+-\=[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\(\.[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\)\?\(p-\=[0-9]\([0-9,]*[0-9]\)\?\)\?\>/
-syn match   factorOctErr        /\<OCT:\s\+-\=\(,\S*\|\S*,\|[0-7,]*[^0-7, ]\S*\)\>/
-syn match   factorOctal         /\<OCT:\s\+-\=[0-7,]\+\>/
+syn match   factorBinErr        /\<-\=0b[01,]*[^01 ]\S*\>/
+syn match   factorBinary        /\<-\=0b[01,]\+\>/
+syn match   factorHexErr        /\<-\=0x\(,\S*\|\S*,\|[-0-9a-fA-Fp,]*[^-0-9a-fA-Fp, ]\S*\)\>/
+syn match   factorHex           /\<-\=0x[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\(\.[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\)\?\(p-\=[0-9]\([0-9,]*[0-9]\)\?\)\?\>/
+syn match   factorOctErr        /\<-\=0o\(,\S*\|\S*,\|[0-7,]*[^0-7, ]\S*\)\>/
+syn match   factorOctal         /\<\+-\=0o[0-7,]\+\>/
 syn match   factorNan           /\<NAN:\s\+[0-9a-fA-F]\([0-9a-fA-F,]*[0-9a-fA-F]\)\?\>/
 
 syn match   factorIn            /\<IN:\s\+\S\+\>/