No special handling for math operator tokens.

This commit is contained in:
Sage Vaillancourt 2022-04-07 14:29:06 -04:00 committed by Sage Vaillancourt
parent 7a0433aa68
commit 6f82567e41
2 changed files with 5 additions and 6 deletions

View File

@ -99,7 +99,7 @@ check "BinaryReturn" "0b011010011010011" "13523"
title "Arithmetic" title "Arithmetic"
check "Addition" "(+ 1093 102852)" "103945" check "Addition" "(+ 1093 102852)" "103945"
check "Multiply" "(*1000 10000)" "10000000" check "Multiply" "(* 1000 10000)" "10000000"
check "Division" "(/ 6418425 65)" "98745" check "Division" "(/ 6418425 65)" "98745"
check "ChainAdd" "(+ 3917 17304 1293844 400 100000)" "1415465" check "ChainAdd" "(+ 3917 17304 1293844 400 100000)" "1415465"
check "ChainMul" "(* 8263 23 123)" "23376027" check "ChainMul" "(* 8263 23 123)" "23376027"
@ -154,9 +154,8 @@ for _ in {0..25}; do deep_nesting="( $deep_nesting )"; done
check "DeepNesting" "$deep_nesting" "$deep_nesting" # Above 25 it starts to stack-smash check "DeepNesting" "$deep_nesting" "$deep_nesting" # Above 25 it starts to stack-smash
title "Spacing" title "Spacing"
check "DenseSpc" "(+1093 102852)" "103945" check "Wide Spacing" "( + 1093 102852 )" "103945"
check "WideSpac" "( + 1093 102852 )" "103945" check "Very Wide Spacing" " ( + 1093 102852 ) " "103945"
check "VWidwSpc" " ( + 1093 102852 ) " "103945"
title "DemoFunctions" title "DemoFunctions"
check "Squaring" "(sq 9876)" "97535376" check "Squaring" "(sq 9876)" "97535376"
@ -188,7 +187,7 @@ check "Factorial" "\
)));\ )));\
(fac 11)" "39916800" (fac 11)" "39916800"
check "LambdaClone" "(def y (fn (a) (* 10 a))) (def b y) (def y 12345) ((b 5) y)" "( 50 12345 )" check "LambdaClone" "(def y (fn (a) (* 10 a))) (def b y) (def y 12345) ((b 5) y)" "( 50 12345 )"
check "Duplicate" "(def dupe (fn (a) (() (a a a))));(dupe (*10 10))" "( 100 100 100 )" check "Duplicate" "(def dupe (fn (a) (() (a a a))));(dupe (* 10 10))" "( 100 100 100 )"
title "Cat" title "Cat"
check "ExplicitCat" '(cat "Big" " Kitty")' "Big Kitty" check "ExplicitCat" '(cat "Big" " Kitty")' "Big Kitty"

View File

@ -14,7 +14,7 @@
*/ */
// Is the char a standalone token? // Is the char a standalone token?
static const char singleTokens[] = "()+-*/='?."; static const char singleTokens[] = "()'?.";
int isSingle(const char c) int isSingle(const char c)
{ {