Commit Graph

228 Commits

Author SHA1 Message Date
Cheer Xiao
7d0133b27d parse: Remove unused (and broken) code 2013-10-06 17:56:19 +08:00
Cheer Xiao
511448237e parse: Lex and parse dollar $ 2013-10-06 15:01:13 +08:00
Cheer Xiao
c925871ef4 parse: Always use *ListNode for Term's 2013-10-06 14:55:28 +08:00
Cheer Xiao
585e047ca5 parse: Introduce FactorNode to represent Factor 2013-10-06 14:27:00 +08:00
Cheer Xiao
84cdc6c50f parse: Remove outdated TODO 2013-10-06 13:07:45 +08:00
Cheer Xiao
e4db8e7d0d parse: Lex comments as ItemSpace (until we need fancier comment handling) 2013-10-06 10:45:16 +08:00
Cheer Xiao
7b20e5f45b parse: Fix unquoting of ItemSingleQuoted and termination of bareword
ItemSingleQuoted is now quoted with ` now.
2013-10-05 09:53:58 +08:00
Cheer Xiao
4a78397c7f parse: Lex (but not yet parse) ItemComment
Comments can only start at start of line or after spaces. Thus `echo a#`
doesn't have a comment.
2013-10-05 09:40:26 +08:00
Cheer Xiao
a4301d195f Parse and evaluate factor of term list
Note: the evaluation is currently a stub.
2013-10-05 00:19:40 +08:00
Cheer Xiao
b5319c9528 parse: Introduce ItemList node; allow empty pipeline 2013-10-05 00:11:28 +08:00
Cheer Xiao
755ff1a26e parse: Backquote is now used for single-quoting 2013-10-04 23:59:57 +08:00
Cheer Xiao
a24ad63573 parse: Terminate barewords at " ' too 2013-10-04 23:59:08 +08:00
Cheer Xiao
c9b29f6447 Implement parsing & evaluation of terms
What used to be terms are now just factors.
2013-10-04 23:57:49 +08:00
Cheer Xiao
9ea3d77043 parse: Document the grammar 2013-10-04 23:49:00 +08:00
Cheer Xiao
77342c2bd4 parse: Parse single-rune tokens more compactly 2013-10-04 23:25:30 +08:00
Cheer Xiao
1e0cebf749 parse: More compact use of switch/case 2013-10-04 23:21:14 +08:00
Cheer Xiao
257bb658e8 parse: Add tokens LParen and RParen 2013-10-04 23:18:52 +08:00
Cheer Xiao
a69cc93bec parse: Stricter rule for bareword termination 2013-10-04 23:15:17 +08:00
Cheer Xiao
e6f0375f64 Use uintptr for fd in IO redirections.
IO redirections use os module now, which uses uintptr for fd.
2013-09-19 18:11:01 +08:00
Cheer Xiao
f2d35b8c39 Evaluate pipeline. Pipes are not yet connected. 2013-09-19 13:20:55 +08:00
Cheer Xiao
9ba448c92d parse: Update comment 2013-09-18 19:47:38 +08:00
Cheer Xiao
8ec1a90f33 parse: Parse a pipeline
das only executes the first command now.
2013-09-18 19:46:34 +08:00
Cheer Xiao
fbb4e376b0 parse: Include name of item type in Item.String 2013-09-18 19:38:15 +08:00
Cheer Xiao
7c69e3b5b1 parse: Lex the pipe (not parsing it yet) 2013-09-18 19:34:03 +08:00
Cheer Xiao
21837bc0a3 parse: Remove unneeded NodeType 2013-09-18 19:20:22 +08:00
Cheer Xiao
18d1e9bf40 parse: Cleanup, docs 2013-09-18 19:14:13 +08:00
Cheer Xiao
7fb91a572a parse: Expose the chan inside Lexer; close chan after lexing ends 2013-09-18 18:03:17 +08:00
Cheer Xiao
4f931c52cb Simplify source tree 2013-09-18 16:40:47 +08:00