From 1a7b4d7c63435ce1da031c5339de2fa6b4cfaf4f Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Thu, 22 Oct 2009 17:26:22 -0500 Subject: [PATCH] inline the trivial words in math.parser --- core/math/parser/parser.factor | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index a53604ddf9..eaa58ac177 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -111,10 +111,10 @@ SYMBOL: negative? { { 16 [ hex>float ] } [ drop dec>float ] - } case ; + } case ; inline : number-char? ( char -- ? ) - "0123456789ABCDEFabcdef." member? ; + "0123456789ABCDEFabcdef." member? ; inline : numeric-looking? ( str -- ? ) "-" ?head drop @@ -127,7 +127,7 @@ SYMBOL: negative? PRIVATE> : string>float ( str -- n/f ) - 10 base>float ; + 10 base>float ; inline : base> ( str radix -- n/f ) over numeric-looking? [ @@ -138,13 +138,13 @@ PRIVATE> } case ] [ 2drop f ] if ; -: string>number ( str -- n/f ) 10 base> ; -: bin> ( str -- n/f ) 2 base> ; -: oct> ( str -- n/f ) 8 base> ; -: hex> ( str -- n/f ) 16 base> ; +: string>number ( str -- n/f ) 10 base> ; inline +: bin> ( str -- n/f ) 2 base> ; inline +: oct> ( str -- n/f ) 8 base> ; inline +: hex> ( str -- n/f ) 16 base> ; inline : >digit ( n -- ch ) - dup 10 < [ CHAR: 0 + ] [ 10 - CHAR: a + ] if ; + dup 10 < [ CHAR: 0 + ] [ 10 - CHAR: a + ] if ; inline : positive>base ( num radix -- str ) dup 1 <= [ "Invalid radix" throw ] when @@ -234,12 +234,12 @@ M: ratio >base { { 16 [ float>hex ] } [ drop float>decimal ] - } case ; + } case ; inline PRIVATE> : float>string ( n -- str ) - 10 float>base ; + 10 float>base ; inline M: float >base { @@ -251,9 +251,9 @@ M: float >base [ float>base ] } cond ; -: number>string ( n -- str ) 10 >base ; -: >bin ( n -- str ) 2 >base ; -: >oct ( n -- str ) 8 >base ; -: >hex ( n -- str ) 16 >base ; +: number>string ( n -- str ) 10 >base ; inline +: >bin ( n -- str ) 2 >base ; inline +: >oct ( n -- str ) 8 >base ; inline +: >hex ( n -- str ) 16 >base ; inline -: # ( n -- ) number>string % ; +: # ( n -- ) number>string % ; inline