Commit Graph

44 Commits

Author SHA1 Message Date
Kelvin Sherlock 6199944350 script parameters, move shift to the environment 2022-11-23 21:22:00 -05:00
Kelvin Sherlock f799eb6d81 allow break within loop ... end 2022-11-23 18:26:30 -05:00
Kelvin Sherlock ce1a36eba5 add regular expression support for evaluate, if, etc.
eg:

evaluate abc =~ /(abc)®4/ # sets the '@4' environment variable.
evaluate abc !~ /[aA]bc/

MPW regular expressions are converted to c++11 std::regex regular expressions and evaluated.
Sadly, the // regular expression syntax interferes with unix-paths (if the / count is odd).  quoting or ∂-escaping the /s is therefore necessary.

file globbing is not yet implemented.
2022-11-22 17:22:49 -05:00
Kelvin Sherlock a90ca3c849 use classic macos file type to identify scripts. 2022-11-13 22:47:23 -05:00
Kelvin Sherlock 6f2b59c4d6 script support. scripts run with an independent copy of the environment and aliases. local variables are not imported.
Currently, it for a ".text" extension to check if it's a script; this is a placeholder.
2022-11-02 21:42:25 -04:00
Kelvin Sherlock ed96470e18 builtin_help 2016-10-08 09:54:06 -04:00
Kelvin Sherlock f125b533f7 Squashed commit of the following:
commit f0944a89f27e44b1764988806e655f09764e80df
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:24:08 2016 -0400

    exit throws execution of input error w/ possible 0 value.  catch it.

commit 9e7f9c1ae049aa26513413f4767268b47ee22e98
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:23:21 2016 -0400

    builtins - more consistent argument handling.

commit be4c1c902f5a3a3f01e92ae52c7d6cc5d8731b65
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:23:01 2016 -0400

    .

commit 68d0c29fec112c6e7bc3a672b41eb7eb758a8941
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:22:51 2016 -0400

    exit command.

commit 25b0a7f7da9220b03026123bb5072c2da1d73fde
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Tue Aug 30 12:21:16 2016 -0400

    builtin quit command.
2016-08-30 12:25:43 -04:00
Kelvin Sherlock 33dd3228f8 update the parser/lexer to make it more reusable. For example, subshells are now handled. 2016-08-16 16:47:20 -04:00
Kelvin Sherlock bdba86249e prevent pipe command from running commands multiple times. 2016-08-11 12:30:01 -04:00
Kelvin Sherlock 47b734a5fa headers. 2016-08-05 22:32:00 -04:00
Kelvin Sherlock f8c596668f lunix/gcc updates. 2016-08-05 22:00:48 -04:00
Kelvin Sherlock 469f0a23c1 fix for false || true 2016-08-05 11:56:38 -04:00
Kelvin Sherlock edcb832c13 fix up execution a little more 2016-07-28 13:58:13 -04:00
Kelvin Sherlock c2c41f3a52 rewrite command execution to be more consistent with real mpw. 2016-07-28 13:44:00 -04:00
Kelvin Sherlock 05f48c6a3c implement pipe. 2016-07-26 16:07:44 -04:00
Kelvin Sherlock 0524d10590 parse | pipe lines. 2016-07-26 14:20:11 -04:00
Kelvin Sherlock 9b577bdbb1 builtin catenate (builtin so cr/lf conversion blocked) 2016-07-23 23:50:28 -04:00
Kelvin Sherlock 31f33096cb ERROR terminal for parser. 2016-07-23 11:40:40 -04:00
Kelvin Sherlock adbf776d31 --shell support in MPW 2016-07-19 12:37:02 -04:00
Kelvin Sherlock 84b24e6379 more child signal stuff. 2016-06-24 14:37:33 -04:00
Kelvin Sherlock e51e757556 re-set child signal handlers to default. 2016-06-24 14:30:27 -04:00
Kelvin Sherlock bc2381a360 fix whitespace 2016-06-24 10:31:34 -04:00
Kelvin Sherlock 45eade7af5 builtin_alias / builtin_unalias. 2016-06-22 13:48:05 -04:00
Kelvin Sherlock 8a2b9ec3cd shift builtin. 2016-06-16 16:48:04 -04:00
Kelvin Sherlock 92ddf18766 FOR var IN ... ; END support. 2016-06-16 00:04:29 -04:00
Kelvin Sherlock 701786277b . 2016-06-15 23:19:34 -04:00
Kelvin Sherlock 322a32af65 support for Loop ... End, Break, and Continue. 2016-06-15 23:01:03 -04:00
Kelvin Sherlock edd80fc3c5 version builtin 2016-06-15 13:25:41 -04:00
Kelvin Sherlock 7724ca0d7c add Exists builtin. 2016-06-15 11:25:25 -04:00
Kelvin Sherlock 6ff7b50a7d use atomic variable for the control-c flag. 2016-02-22 12:03:58 -05:00
Kelvin Sherlock 0d0367ca08 builtin about box, bump version number. 2016-02-11 21:50:25 -05:00
Kelvin Sherlock 034321830f command updates 2016-02-11 15:51:56 -05:00
Kelvin Sherlock beb3e3813a builtin_which 2016-02-11 15:51:39 -05:00
Kelvin Sherlock 50f171d5c8 which command 2016-02-11 15:48:46 -05:00
Kelvin Sherlock 1339c0891f adjust indents 2016-02-10 21:58:00 -05:00
Kelvin Sherlock d98247bd12 mpw-make support 2016-02-05 23:00:42 -05:00
Kelvin Sherlock 0dfecbd520 control-c support 2016-02-05 13:19:20 -05:00
Kelvin Sherlock 449595c56b simplify grammar a little bit. 2016-02-04 21:45:04 -05:00
Kelvin Sherlock e3ed9dec46 transfer environment to child process 2016-02-03 15:06:48 -05:00
Kelvin Sherlock 54e1491e6f fix if evaluation. 2016-02-02 21:57:42 -05:00
Kelvin Sherlock 6d9e5dc78c throw error for {exit} 2016-02-02 16:19:13 -05:00
Kelvin Sherlock 5723656988 lots of updates! 2016-02-01 20:38:29 -05:00
Kelvin Sherlock e4a124f514 Echo support (for testing) 2016-01-31 00:41:16 -05:00
Kelvin Sherlock c0cf403516 command stubs 2016-01-30 12:45:19 -05:00