aboutsummaryrefslogtreecommitdiff
path: root/compiler/standardClient.ey
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/standardClient.ey')
-rw-r--r--compiler/standardClient.ey80
1 files changed, 42 insertions, 38 deletions
diff --git a/compiler/standardClient.ey b/compiler/standardClient.ey
index b865856..c7781d9 100644
--- a/compiler/standardClient.ey
+++ b/compiler/standardClient.ey
@@ -1279,47 +1279,51 @@
> -- /dump deffd
# no long-term stack use here as the executed program uses it as well
-{ scope
- { ==currentScope ==input
- 0 "0" * ==:zero
- { 0 ==result
- { zero sub result 10 mul add =result } each
- result
- } /base10decode deffd
-
- [ 0 11 range {
- sys .asm .intToFloat
- } each ] =*:FLOAT
-
- { .value currentScope sys .executeIdentifierScoped =currentScope } /TOKID defvst
- { .value base10decode } /TOKINT defvd
- { .value "^(\\d+)(\\.(\\d*))?([eE](-)?(\\d+))?$" regex
- not { "Not in fact a float" die } rep
- ==m1 -- ==m2 -- ==eS ==e
-
- 0 FLOAT ==m1f
- m1 { zero sub m1f 10 FLOAT mul add =m1f } each
- 0 FLOAT ==m2f
- [ m2 { } each ] reverse { zero sub m2f add 10 FLOAT div =m2f } each
-
- m1f m2f add ==result
-
- 0 ==ei
- e { zero sub ei 10 mul add =ei } each
- eS "" eq {
- ei { result 10 FLOAT mul =result } rep
- } {
- ei { result 10 FLOAT div =result } rep
- } ? *
+{ ==currentScope
+ 0 "0" * ==:zero
+ { 0 ==result
+ { zero sub result 10 mul add =result } each
+ result
+ } /base10decode deffd
+
+ [ 0 11 range {
+ sys .asm .intToFloat
+ } each ] =*:FLOAT
- result
- } /TOKFLOAT defvd
+ { .value currentScope sys .executeIdentifierScoped =currentScope } /TOKID defvst
+ { .value base10decode } /TOKINT defvd
+ { .value "^(\\d+)(\\.(\\d*))?([eE](-)?(\\d+))?$" regex
+ not { "Not in fact a float" die } rep
+ ==m1 -- ==m2 -- ==eS ==e
- { .value } /TOKSTR defvd
+ 0 FLOAT ==m1f
+ m1 { zero sub m1f 10 FLOAT mul add =m1f } each
+ 0 FLOAT ==m2f
+ [ m2 { } each ] reverse { zero sub m2f add 10 FLOAT div =m2f } each
- {
- TOKFLOAT TOKINT TOKSTR TOKID elymas .tokenize { _ .handle } each
- } input .eachLine
+ m1f m2f add ==result
+
+ 0 ==ei
+ e { zero sub ei 10 mul add =ei } each
+ eS "" eq {
+ ei { result 10 FLOAT mul =result } rep
+ } {
+ ei { result 10 FLOAT div =result } rep
+ } ? *
+
+ result
+ } /TOKFLOAT defvd
+
+ { .value } /TOKSTR defvd
+
+ { TOKFLOAT TOKINT TOKSTR TOKID elymas .tokenize { _ .handle } each }
+} /enincludeLine deffd
+
+{ scope enincludeLine * }" /includeLine deffd
+
+{ scope
+ { enincludeLine ==includeLine ==input
+ includeLine input .eachLine
} *
}" /includeFile deffd