Skip to content

Function declaration not handled #52

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

Closed
5 tasks done
WaldoFR opened this issue Jul 6, 2017 · 2 comments
Closed
5 tasks done

Function declaration not handled #52

WaldoFR opened this issue Jul 6, 2017 · 2 comments
Assignees

Comments

@WaldoFR
Copy link

WaldoFR commented Jul 6, 2017

Problem

For shell languages, it's possible to declare a new function by several ways. However, some analyzers require the shell function to be declared with the keyword function before the function's name while it's optional.

How to fix

Adding a new transition FUNCT to handle this declaration independantly to the keyword one on function declaration to retrieve function's name.

Also, make FUNCT identifier using FNAME identifier as function's name instead of VAR one.

Fix status

  • COM.DATA.LoopCondition (FUNCT declarations handling)
  • COM.DESIGN.ActiveWait (FUNCT declarations handling)
  • COM.FLOW.Abort (FUNCT declarations handling)
  • COM.FLOW.CaseSwitch (FUNCT declarations handling)
  • All rules : Verify FUNCT identifier to comply with FNAME.
@WaldoFR WaldoFR added this to the Version 3.0 milestone Jul 6, 2017
@WaldoFR WaldoFR self-assigned this Jul 6, 2017
@WaldoFR WaldoFR modified the milestones: Version 3.0.0, Version 3.1 Sep 14, 2017
@WaldoFR WaldoFR removed their assignment Jun 14, 2018
@WaldoFR WaldoFR changed the title [SHELL] Function declaration not handled Function declaration not handled Jun 14, 2018
brigittehuynh added a commit to brigittehuynh/i-CodeCNES that referenced this issue Jun 25, 2018
…ackage

(required for all issues regarding function location)
brigittehuynh added a commit to brigittehuynh/i-CodeCNES that referenced this issue Jun 25, 2018
…unction class to allow local and

global variable handling with regards to the function
brigittehuynh added a commit that referenced this issue Jul 20, 2018
into account. Test files updated accordingly
brigittehuynh added a commit that referenced this issue Jul 22, 2018
An error was corrected on the plugin.xml file on the SH.ERR.String rule.
A localization error was corrected in SH.INST.GetOpts.

The following rules did not need updating:
COM.DATA.Invariant
SH.DESIGN.Bash
SH.INST.Interpreter
SH.INST.Keywords
SH.INST.Variables

The following rules could not be updated with FNAME without errors
appearing in their automatic tests:
COM.FLOW.Recursion
COM.INST.CodeComment
COM.INST.Line
COM.PRES.Indent
SH.MET.PipeLine
SH.FLOW.CheckCodeReturn
They were either partially modified (COM.FLOW.Recursion,
SH.FLOW.CheckCodeReturn), or left as they were.
@brigittehuynh
Copy link
Collaborator

The following rules could not be updated with FNAME without errors appearing in their automatic tests:
COM.FLOW.Recursion
COM.INST.CodeComment
COM.INST.Line
COM.PRES.Indent
SH.MET.PipeLine
SH.FLOW.CheckCodeReturn
They were either partially modified (COM.FLOW.Recursion, SH.FLOW.CheckCodeReturn), or left as they were.

Issue #137 has been created to allow for further investigation of the problem for each of these rules.

brigittehuynh added a commit that referenced this issue Jul 23, 2018
failing after introducing FNAME. The issue was solved by removing \space
from the SPACE token.
@brigittehuynh
Copy link
Collaborator

In all, 47 rules out of 49 now have the FUNCT token. The 2 remaining ones doen't require localization as they check the first line of the file and any violation found can only be in MAIN PROGRAM.
The two rules are SH.INST.Interpreter and SH.DESIGN.Bash.

@WaldoFR WaldoFR mentioned this issue Sep 13, 2018
@WaldoFR WaldoFR closed this as completed Sep 14, 2018
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
…ackage

(required for all issues regarding function location)
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
…unction class to allow local and

global variable handling with regards to the function
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
…ization, took "until"

into account. Test files updated accordingly
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
An error was corrected on the plugin.xml file on the SH.ERR.String rule.
A localization error was corrected in SH.INST.GetOpts.

The following rules did not need updating:
COM.DATA.Invariant
SH.DESIGN.Bash
SH.INST.Interpreter
SH.INST.Keywords
SH.INST.Variables

The following rules could not be updated with FNAME without errors
appearing in their automatic tests:
COM.FLOW.Recursion
COM.INST.CodeComment
COM.INST.Line
COM.PRES.Indent
SH.MET.PipeLine
SH.FLOW.CheckCodeReturn
They were either partially modified (COM.FLOW.Recursion,
SH.FLOW.CheckCodeReturn), or left as they were.
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
…e automatic tests were

failing after introducing FNAME. The issue was solved by removing \space
from the SPACE token.
begarco pushed a commit that referenced this issue Feb 2, 2020
(required for all issues regarding function location)
begarco pushed a commit that referenced this issue Feb 2, 2020
global variable handling with regards to the function
begarco pushed a commit that referenced this issue Feb 2, 2020
begarco pushed a commit that referenced this issue Feb 2, 2020
into account. Test files updated accordingly
begarco pushed a commit that referenced this issue Feb 2, 2020
An error was corrected on the plugin.xml file on the SH.ERR.String rule.
A localization error was corrected in SH.INST.GetOpts.

The following rules did not need updating:
COM.DATA.Invariant
SH.DESIGN.Bash
SH.INST.Interpreter
SH.INST.Keywords
SH.INST.Variables

The following rules could not be updated with FNAME without errors
appearing in their automatic tests:
COM.FLOW.Recursion
COM.INST.CodeComment
COM.INST.Line
COM.PRES.Indent
SH.MET.PipeLine
SH.FLOW.CheckCodeReturn
They were either partially modified (COM.FLOW.Recursion,
SH.FLOW.CheckCodeReturn), or left as they were.
begarco pushed a commit that referenced this issue Feb 2, 2020
failing after introducing FNAME. The issue was solved by removing \space
from the SPACE token.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants