Skip to content
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

Enable parse loop in a shell script #706

Closed
ForgetMe17 opened this issue May 28, 2020 · 1 comment
Closed

Enable parse loop in a shell script #706

ForgetMe17 opened this issue May 28, 2020 · 1 comment

Comments

@ForgetMe17
Copy link
Contributor

ForgetMe17 commented May 28, 2020

Description
PR #688 and issue #682 split a shell script into 3 elements which are variable, command and branch. We also need to consider loop in the shell script, here is an example.
Consider 3 types of loop in a shell scipt: for, while, until. They are all ended with keyword done.

To Do

  1. Add keywords for loop.
  2. Parse loop: Extract variable and command in a loop. Also we need to skip keyword break.

Background
Supplement to issue #682

Super Issues
#521

ForgetMe17 added a commit to ForgetMe17/tern that referenced this issue Jun 16, 2020
This commit enables parse_shell_loop_and_branch() to extract
statements for a loop, and use clean_command() to clean tab
and line indentations.

Modificate the statement dictionary, change the dict for command:
{'content':..., 'command':...} to {'conmmand':...}.
Since we will do parse_command() in the futher part of finding the
installed software, we will only record the concatenated command
string here.

Works towards tern-tools#682 and tern-tools#706.

Signed-off-by: WangJL <hazard15020@gmail.com>
ForgetMe17 added a commit to ForgetMe17/tern that referenced this issue Jun 18, 2020
Pipe symbol '|' should not be seperated.
Command 'export' can be treated as variable assignment.

Works towards tern-tools#682 and tern-tools#706.

Signed-off-by: WangJL <hazard15020@gmail.com>
@ForgetMe17
Copy link
Contributor Author

Fixed in PR #717. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant