File tree Expand file tree Collapse file tree 7 files changed +68
-0
lines changed Expand file tree Collapse file tree 7 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,5 @@ Cargo.lock
12
12
13
13
# MSVC Windows builds of rustc generate these, which store debugging information
14
14
* .pdb
15
+
16
+ hidden /
Original file line number Diff line number Diff line change @@ -5,6 +5,18 @@ The powerful script language designed with a stack oriented approach for efficie
5
5
6
6
## Install
7
7
8
+ ### If you don't want to install...
9
+
10
+ ``` bash
11
+ git clone https://github.com/Stack-Programing-Community/Stack-Programing-Language.git
12
+ cd Stack-Programing-Language
13
+ cargo build --release
14
+ chmod +x ./run.stack.sh
15
+ ./run-stack.sh
16
+ ```
17
+
18
+ ### Normal Install
19
+
8
20
Stack programming language's interpreter binary files for Windows are in the [ release] ( https://github.com/Stack-Programing-Community/Stack-Programing-Language/releases ) .
9
21
10
22
the releases are Regularly when new function become stable, that's good way if you prize safety.
Original file line number Diff line number Diff line change
1
+ ((a) var a a () (a) var) (clone) var
Original file line number Diff line number Diff line change
1
+ (
2
+ (mode) var
3
+ (item) var
4
+
5
+ (
6
+
7
+ )
8
+ ()
9
+ mode equals (push)
10
+ item
11
+ ) (queue) var
Original file line number Diff line number Diff line change
1
+ (
2
+
3
+ (Welcome to...) print
4
+
5
+ (Stack) () true if
6
+
7
+ ((str) var [str (ming)] () join) func var
8
+ (Program) func eval
9
+
10
+ [(Lang) (uage) (fake)] l var
11
+ l 0 get
12
+ l 1 get
13
+ (b) var
14
+ (a) var
15
+ [a b] () join
16
+
17
+ (a) var
18
+ (b) var
19
+ (c) var
20
+ [c b a] ( ) join (a) var
21
+ [a (!)] () join print
22
+
23
+ ) (do) var
24
+ do eval
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ cd " $( dirname $0 ) "
4
+ ./target/release/stack $@
Original file line number Diff line number Diff line change @@ -1277,6 +1277,20 @@ impl Executor {
1277
1277
} )
1278
1278
}
1279
1279
1280
+ "index" => {
1281
+ let findhint = self . pop_stack ( ) . get_string ( ) ;
1282
+ let findtarget = self . pop_stack ( ) . get_list ( ) ;
1283
+
1284
+ for index in 0 ..( findtarget. len ( ) ) {
1285
+ if findhint == findtarget[ index] . clone ( ) . get_string ( ) {
1286
+ self . stack . push ( Type :: Number ( index as f64 ) ) ;
1287
+ return ;
1288
+ }
1289
+ }
1290
+ self . log_print ( String :: from ( "Error! item not found in this list" ) . as_str ( ) . to_owned ( ) + "\n " ) ;
1291
+ self . stack . push ( Type :: Error ( String :: from ( "item-not-found" ) ) ) ;
1292
+ }
1293
+
1280
1294
// If it is not recognized as a command, use it as a string.
1281
1295
_ => self . stack . push ( Type :: String ( command) ) ,
1282
1296
}
You can’t perform that action at this time.
0 commit comments