Commit Graph

144 Commits

Author SHA1 Message Date
Jeremiah Leary 1c1dc3ccd0 Adding generic clause objects. 2020-08-02 11:19:42 -05:00
Jeremiah Leary f32d4e1a1b Adding component objects.
Refactoring objects into a token library instead of a parser file.
2020-08-02 08:48:18 -05:00
Jeremiah Leary b993b2a746 Adding attribute objects. 2020-08-01 18:57:21 -05:00
Jeremiah Leary edc846b549 Added file objects.
Cleaned up some issues with classifiers not checking lower case for keywords.
2020-08-01 18:36:57 -05:00
Jeremiah Leary 16e8c1cb27 Adding variable declaration objects. 2020-08-01 16:48:03 -05:00
Jeremiah Leary ed26959607 Adding assert objects. 2020-08-01 15:24:07 -05:00
Jeremiah Leary 4013b5a783 Adding objects for constants. 2020-07-31 21:27:32 -05:00
Jeremiah Leary 0543b7c198 Added parsing of signals into objects. 2020-07-31 21:01:42 -05:00
Jeremiah Leary d4d9a1460e Adding objects for package bodies. 2020-07-31 15:57:10 -05:00
Jeremiah Leary 585fedfc7a Adding parsing of entity into objects. 2020-07-31 12:33:08 -05:00
Jeremiah Leary 7b61836e8b Adding parsing of architecture elements into objects using the parser. 2020-07-31 10:58:59 -05:00
Jeremiah Leary ffaa52ce6d Merge branch 'master' into issue-393 2020-07-30 20:45:48 -05:00
Jeremiah Leary 33c1136171 Updates for issue #441:
Addressing issue where commented out generic map was being treated as code.

  1)  Updated test to show issue
  2)  Updated code to address issue
2020-07-28 08:18:20 -05:00
Jeremiah Leary abe3cb3418 Updates for issue #393:
Refactoring of library and base rules:

  1)  Most library rules refactored to use new base item rules
  2)  Base item rules refactored to use the region method on vhdlFile
  3)  Tests updated
  4)  Documentation updated
2020-07-26 12:54:43 -05:00
Jeremiah Leary 69fc6fdef6 Updates for issue #393:
Adding rules for context references.

  1)  Added context reference rules 001 through 005
  2)  Refactored base rules to allow it to pull code from rule defined regions
  3)  Refactored context rules to match base rule changes
  4)  Added tests
  5)  Updated documentation
  6)  Updated context classifier
  7)  Added set_indent_levels method to vhdlFile class
2020-07-25 20:48:28 -05:00
Jeremiah Leary 711507a2f4 Updates for issue #393:
Add ability to parse context references:

  1)  Added parser classes
  2)  Added test
  3)  Modified context classifier to handle context references
2020-07-25 15:06:01 -05:00
Jeremiah Leary 4468defa09 Updates for issue #393:
1)  Refactored new base rules:
      a)  Including debug message
      b)  Fixed reporting of solutions

  2)  Updated tests
2020-07-23 20:51:27 -05:00
Jeremiah Leary e42d0a3002 Updates for issue #393:
Adding more context rules:

  1)  Added base rule indent_item_rule
  2)  Added indent rules
  3)  Updated classifiers to handle context indents
2020-07-22 18:48:33 -05:00
Jeremiah Leary 0e226ec6de Updates for issue #393:
Additional context rules added:

  1)  New rules added
      a)  context_007
      b)  context_021
      c)  context_022

  2)  New base rules added
      a)  insert_item_after_item_rule
      b)  copy_item_value_and_insert_new_item_after_item_rule
      c)  move_items_after_item_to_next_line_rule

  3)  Updated classifiers to use objects
      a)  library
      b)  use

  4)  Added tests
2020-07-21 07:45:20 -05:00
Jeremiah Leary d1ae9928c3 Updates for issue #393:
Adding new rules for context declarations:

  1)  Added context rule documentation
  2)  Added parsing of context declarations
      a)  Experimenting with using objects
  3)  Adding rules 002, 003, 004 and 005.

NOTE:  These new rules need to be refactored before they are merged back to master.
2020-07-19 16:01:29 -05:00
Jeremiah Leary 7a3fcf9883 Updates for issue #434:
Adding rules to align declaration identifiers:

  1)  Updated documentation
  2)  Removed the following rules
      file_003, constant_003, attribute_003, signal_003, subtype_003, type_003 and variable_003
  3)  Added new rules:
      architecture_029, function_015, package_019, procedure_010 and process_037
  4)  Added tests for new rules
  5)  Updated classifiers to support new rules
2020-06-30 11:36:01 -05:00
Jeremiah Leary 02b3835381 Updates for issue #432:
Adding rule architecture_029 to align idenifiers in signal, constant, variable, file, type and subtype declarations.

  1)  Updated documentation
  2)  Added tests
  3)  line class updates
      a)  Added new architecture attribute
      b)  Added new method to update the line attributes from tokens
  4)  Added rule architecture_029
2020-06-25 09:58:49 -05:00
Jeremiah Leary 16126b045d Updates for issue #398:
Generics starting with "port" were classified as the port keyword:

  1)  Updated tests to expose issue
  2)  Updated code to make tests pass
2020-05-18 22:12:21 -05:00
Jeremiah Leary 3fb73a1e43 Updates for issue #392:
Adding support for case generate statements:

  1)  Updated case classifications to differentiate between generate and case statements
  2)  Updated documentation
  3)  Added tests for generate case statements
  4)  Added rule generate_016 to enforce indention on when statements
2020-05-09 21:59:17 -05:00
Jeremiah Leary 16968a115e Updates for issue #391:
VSG was mistaking case-generates for an instantiation.

  1)  Updated tests to include case generate example
  2)  Updated code to recognize a case generate statement
2020-05-09 15:45:22 -05:00
Jeremiah Leary de942890b3 Updates for issue #385:
The rule process_031 was attempting to align variables defined in function and procedures with variables outside functions and procedures in the process declarative region.

  1)  Updated tests to expose issue
  2)  Fixed to make tests pass

Additional issue found with handling indents on processes with just 'process is' when updating tests.

  1)  Fixed code to make tests pass
2020-05-09 09:12:19 -05:00
Jeremiah Leary 09b7a9666b Updates for issue #384:
Fixing issue where VSG was classifying <= in an assert statement.

  1)  Added tests to show the issue
  2)  Updated code to address the issue
2020-05-07 21:38:11 -05:00
Jeremiah Leary a3a3c68721 Updates for issue #383:
VSG was considering an 'end if' in a procedure to be the 'end procedure'.

  1)  Updated tests to reveal issue
  2)  Updated code to make tests pass
2020-05-05 20:41:31 -05:00
Jeremiah Leary 3ea1035b03 Updates for issue #383:
VSG could not handle nested for loops if it was inside a procedure.
The second 'end loop' would also be classified as the 'end procedure'.

  1)  Updated tests to expose issue
  2)  Updated code to make tests pass
2020-05-04 20:06:12 -05:00
Jeremiah Leary 6056c9df9d Updates for issue #382:
VSG was classifying the when keyword in a sequential assignment as a case when keyword.

  1)  Updated tests to detect the issue
  2)  Updated code to make test pass
2020-05-01 18:36:23 -05:00
Jeremiah Leary 88ee68bf72 Updates for issue #380:
The 'end loop' was being misclassified as the end of a procedure.
This would result in a cascade of issues in the fixed code.

  1)  Updated tests to include a for loop within a procedure within an architecture declarative region to replicate the issue
  2)  Updated code to not classify the 'end loop' as the end of a procedure.
2020-04-30 10:30:07 -05:00
Jeremiah Leary cafe651a15 Updates for issue #379:
Rule process_019 was not honoring records.

  1)  Updated tests
  2)  Updated clock detection
  3)  Update rule process_019
2020-04-27 20:20:51 -05:00
Jeremiah C Leary 7d940306ec Updates for issue #314 and issue #333:
Issue #314:

Updated all label rules to use utils.extract_label or utils.extract_end_label:

  1) Added utils.extract_end_label
  2) Added more end label attributes to line.py
  3) Updated classifiers to set the new end label attributes
  4) Updated tests
  5) Updated rules to use utils.extract_label or utils.extract_end_label

Issue #333:

Fixed bug where nested generate labels were not updated correctly:

  1)  Added test case
  2)  Updated code
2020-02-23 10:51:44 -06:00
Jeremiah Leary 322050acc1
Merge pull request #329 from willkamp/quickfixes
Fixes required to handle double hyphens in quoted strings so they are not considered a comment marker.
2020-01-24 11:34:59 -06:00
Will Kamp 36b1ba9065 Update comment detection regex. 2020-01-08 17:47:01 +13:00
Will Kamp cf4265cfe4 Fix inline comment detection so that it ignores double hyphens in double quoted strings.
for example, "--" : a two bit std_logic_vector literal of don't cares.
2020-01-08 10:09:17 +13:00
Will Kamp dbcebf026b Fix type keyword regex that miss-matches on record fields that start with "type".
type t_ip_header is record
    -- ...
    type_of_service : std_logic_vector(7 downto 0);
    -- ...
end record;
2020-01-08 10:09:17 +13:00
Jeremiah C Leary f684b4b0a7 Updates for issue #319:
Added ability to configure either 'event or _edge for clock definitions:

  1)  Updated documentation
  2)  Added isClockDefinition to line object
  3)  Updated process classification to set isClockDefinition
  4)  Updated tests
  5)  Updated rule process_029
2020-01-06 22:18:07 -06:00
Jeremiah C Leary 86c708a986 Minor formatting updates for Codacy issues. 2020-01-02 11:58:48 -06:00
Jeremiah C Leary b70f6aa77b Minor formatting updates for Codacy issues. 2020-01-02 11:40:27 -06:00
Jeremiah C Leary 5e824dd37a Updates to improve code coverage of rule entity_012:
1)  Updated tests to cover the _get_solution method.
  2)  Added docstring for entity classifier.
2020-01-02 10:19:52 -06:00
Jeremiah C Leary 7ab8f9f6fb Updating rule component_012 to improve code coverage:
1)  Removed unused elif code because it could never be executed.
  2)  Updated documentation for component classifier.
  3)  Updated tests for rule component_012 to cover the _get_solution method.
2020-01-02 10:10:38 -06:00
Jeremiah C Leary f0c474c695 Updates for issue #280:
The rule process_012 would add the *is* keyword to the end of the process sensitivity list without removing an *is* keyword if it existed on a different line.

  1)  Updated documentation
  2)  Updated tests
  3)  Updated process classifier
  4)  Added isProcessIs line attribute
  5)  Updated rule process_012 to remove the *is* keyword if is exists on a seperate line.
2019-12-05 09:52:59 -06:00
Jeremiah C Leary 5cb0a35cc9 Updates for issue #287:
Fixed two issues:

  1)  VSG was misclassifying function parameters as variables.
  2)  VSG was not setting an indent level for the end of a function.
2019-11-27 07:13:29 -06:00
Jeremiah C Leary 5696c3a678 Updates for issue #282:
Adding rule signal_015 to handle a signal declared over multiple lines:

  1)  Added documentation
  2)  Added test
  3)  Added rule signal_015

NOTE:  Only the detection portion has been added.  The fix will be added next.
2019-11-03 20:06:38 -06:00
Jeremiah C Leary 0e2d48fa47 Updates for issue #282:
Adding new line attributes to cover signal assignments spanning multiple lines.
2019-11-03 07:00:41 -06:00
Jeremiah C Leary 791021b799 Updates for issue #284:
The indent level of the begin keyword was incorrect in cases of processes without sensitivity lists.

  1)  Changed indent level to match that of the process keyword in all cases.
  2)  Updated tests
2019-10-20 07:20:49 -05:00
Jeremiah C Leary cb608ff9a3 Updates for issue #275
The constant classifier was classifying signals in concurrent assignments as constants if a signal started with "constant".

  1)  Updated tests
  2)  Updated constant classifier
2019-10-15 18:19:03 -05:00
Jeremiah C Leary a6d82e7bbe Updates for issue #248:
Updated the process classifier to update the insideResetProcess line attribute.
2019-09-08 06:40:01 -05:00
Jeremiah C Leary 41653e3cba Updates for issue #251:
Fixed issue where ports in an instantiation which started with "end" were classified as the end of the architecture.
Fixed issue where concurrent assignments which started with "end" were classified as the end of the architecture.

  1)  Added tests
  2)  Updated architecture classifier
2019-09-07 07:57:01 -05:00