New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement [ #19

Closed
andychu opened this Issue Jul 25, 2017 · 2 comments

Comments

Projects
None yet
1 participant
@andychu
Contributor

andychu commented Jul 25, 2017

Since we have [[, [ should be implemented too. Basically every shell has it.

https://www.reddit.com/r/oilshell/comments/6p2tp0/please_try_the_first_osh_release/dkmmzng/

@andychu andychu referenced this issue Aug 10, 2017

Open

Run Nix setup.sh? #26

13 of 19 tasks complete
@andychu

This comment has been minimized.

Show comment
Hide comment
@andychu

andychu Aug 26, 2017

Contributor

First cut, still a couple things to do:

203a7ba

Contributor

andychu commented Aug 26, 2017

First cut, still a couple things to do:

203a7ba

andychu pushed a commit that referenced this issue Aug 28, 2017

Andy Chu
Fixes to the test / [ builtin.
I learned that the [ language isn't really specified by a grammar, as [[
is.  Instead we handle it like bash does: by splitting it into 6 cases:
expressions of length 0, 1, 2, 3, 4, and more.

The bash source implies that POSIX specifies this.  And it explains why
-a and -o are deprecated.

I'm not supporting -a as a unary operator, since it's an alias for -e.

I also added a couple test cases to dbracket.test.sh, and fixed some
syntax error handling bugs in [[.

NOTE: There's still a bug where [ abc = 'a*' ] should not support
globbing.

Addresses issue #19 and issue #26.

andychu pushed a commit that referenced this issue Aug 28, 2017

Andy Chu
[ a = b ] [ a == b] and [ a != b ] now don't do globbing/fnmatch.
The [[ counterparts do globbing, because they can distinguish between
quoted and unquoted strings.

We now have new IDs like Id.BoolBinary_GlobEqual and
Id.BoolBinary_Equal.  The latter is not integrated with osh/lex.py.

Also: Fix unit tests.

Addresses issue #19.

andychu pushed a commit that referenced this issue Sep 6, 2017

@andychu

This comment has been minimized.

Show comment
Hide comment
@andychu

andychu Sep 12, 2017

Contributor

Fixed as of OSH 0.1

Contributor

andychu commented Sep 12, 2017

Fixed as of OSH 0.1

@andychu andychu closed this Sep 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment