Commit Graph

240 Commits

Author SHA1 Message Date
Jeremiah Leary ead8c07780
#890 (#891) : Fixing parsing error for constants and signals with default assignments in subprogram parameters. 2022-11-29 07:25:56 -06:00
Jeremiah Leary e810689292
Issue 852 (#856)
* Updates for issue #852

Adding support the attributes in subtype indications.

  1)  Updated classifier subtype_indication to call type_mark
  2)  Updated get_sequence_of_tokens_matching

* Removing comments.
2022-11-04 09:01:33 -05:00
Jeremiah Leary 9f65068692
Updates for issue #559: (#798)
* Updates for issue #559:

Adding documentation for configuring indent rules.

* Adding documentation:

  1)  Updated whitespace_002
  2)  Added whitespace_014
  3)  Added configuring tabs vs spaces

* Adding example documentation.
Fixing table.

* Updated documentation:

  1)  Removed whitespace_014
  2)  Updated whitespace_002 to only work on middle tabs
  3)  Removed configuring_tabs_vs_spaces document
  4)  Removed tabs as an option for indenting

* Updating token indent rules.

* Adding smart_tabs test for rule assert_statement_001

* Updating rule assert_400 to allow smart tabs.

* Refactoring assert_400 to improve readability.

* Refactoring to reduce complexity.

* Updates for rule case_011 and assert_400:

  1) Replaced align_consecutive_lines_after_line_starting_with_token_and_stopping_with_token with assert_400
  2) Updated rule assert_400 to inherit align rule
  3) Changed rule case_011 to use align rule

* Removing rule case_021.

The function of the rule is now covered by comment_010.

* Deprecating rule case_generate_alternative_300.

* Refactoring analyze to _analyze.

* Splitting configuration of rule assert_400 into its own page.

* Updating multiline_alignment_between_tokens to handle smart tabs.

* Deprecating rules if_032 and if_033.  They are covered by comment_010.

* Updated report_statement_400 to use align_consecutive_lines_after_line_starting_with_token_and_stopping_with_token.

* Updating rule process_028 to handle smart-tabs

 1) Updated tests
 2) Updated base rule align_left_token_with_right_token_if_right_token_starts_a_line

* Updating rule library_009 to handle smart-tabs

  1)  Updated tests
  2)  Updated base rule align_consecutive_lines_starting_with_a_comment_above_line_starting_with_token

* Minor formatting updates.

* Adding methods to support multiline alignment base class.

* Refactored rule constant_012 to split indent and alignment whitespace.

* Adding smart-tab support to rule constant_012.

* Removing old classify code.

* Removing debug print statement.

* Updating documentation for assert and report_statement rules.

* Updating rule concurrent_009 to support smart-tabs.

  1)  Added tests
  2)  Updated rule to support smart-tabs

* Updating documentation to match current implementation.

* Taking a different approach for multiline_alignment_between_tokens.

  1)  Reverted smart_tabs changes
  2)  Updated base rule to method employed on concurrent_009
  3)  Commented out smart_tab tests

* Updated missing meta data to Toi in rule constant_014

Fixed error in align_left_no_align_paren_no analyzer.

* Adding smart-tab support to base rule multiline_alignment_between_tokens.

* Updating alignment rules to support smart tabs.

  1)  Updated base rules
      a) vsg/rules/align_tokens_in_region_between_tokens.py
      b) vsg/rules/align_tokens_in_region_between_tokens_skipping_lines_starting_with_tokens.py
      c) vsg/rules/align_tokens_in_region_between_tokens_unless_between_tokens.py
  2)  Updated rule concurrent_008
  3)  Added tests

* Fixing issue with rule port_map_009 misfiring if the following token sequence occured:  comma, whitespace, carraige return.

* Updating solution for indent rules to give required tabs and spaces.
Fixing several bugs in indent implementation:
  1)  checking for smart-tabs instead of smart_tabs

* Updates for Codacy issues.

* Additional Codacy updates.

* Fixing style issues identified by CodeClimate.

* Additional style fixes identified by CodeClimate.

* Refactoring alignment rules:

  1)  Created utils file specifically for alignment rules
  2)  Refactored rules to move identical code into utils file

* Moving update_column_width into alignment_utils file.

* Moving functions into alignment_utils:
  1)  get_first_line_info
  2)  starts_with_paren

* Using functions in alignment_utils.

* Collapsing branches to improve readability.

* Refactoring to improve readability.
2022-10-07 08:01:03 -05:00
Jeremiah Leary 24dce78940
Updates for issue #833 (#834)
Pragma comments were being update by rule comment_100 when they should not have been

  1)  Added tests
  2)  Updated classification of pragmas to the pragma itself
2022-10-05 06:14:01 -05:00
Jeremiah Leary 76a0201f26
Updates for issue #819 (#822)
Constraints with parenthesis would not properly classify.

  1)  Updated test to expose issue
  2)  Updated constraint classifer to properly handle parenthesis
2022-09-22 08:23:29 -05:00
Jeremiah Leary 03a657ebe0
Updates for issue #817: (#818)
Fixed issue with range_constraint classification not stopping when encountering an unmatched closing parenthesis.

  1)  Updated test
  2)  Updated range_constraint classification
2022-09-14 08:05:35 -05:00
Jeremiah Leary 4da9b34583
Updates for issue #813 (#814)
* Updates for issue #813

Adding ability to classify configurations:

  1) Added additional tokens
  2) Added classifiers
  3) Updated test

* Adding unspecified token in between end for and semicolon.
This token is not in the LRM spec, but apparently some compilers allow it.

* Refactoring to improve readability.
2022-08-13 08:14:30 -05:00
Jeremiah Leary fb5c650899
Issue 806 (#808)
* Updates for issue #806

Adding support for delimited comments:

  1)  Added tokens for delimited comments
  2)  Updated classification to handle delimited comments
  3)  Added test

* Refactoring to improve readability.

* Refactoring to classify function to improve readability.

* Minor updates for codeclimate.

* Fixing indenting.
2022-07-27 06:26:33 -05:00
Jeremiah Leary 7225df8b9d
Updates for issue #539 (#751)
* Updates for issue #539

Adding multiline structural rule for rule signal_016.

  1)  Added test cases
  2)  Update rule signal_016
  3)  Updated documentation

* Adding test for arrays.

* Adding functions to combine slices into a single object

* Adding array_first_paren_new_line option.

* Removing unused code.

* Adding tests for the following parameter options:

  1)  array_first_paren_new_line (yes/no)
  2)  first_paren_new_line (yes/no)

* Adding documentation for configuring multiline constraint rules.

* Minor grammar updates.

* Updating per feedback:

  1)  Made symbols in table with a transparent background
  2)  Minor grammar updates
  3)  Fixed indenting in code examples

* Adding correct red penta star png file.

* Upated third example to correctly show behavior.

* Updated figure with correct indenting.
Fixed indenting in example 2.

* Adjusting indent on example 3 and example 4.

* Initial rewrite to classify constraints.

* Converting variable_declaration to call subtype_indication.classify.

* Changing constant_declaration to use subtype_indication.classify

* Changing unbounded_array_definition to use subtype_indication.classify

* Changing subtype_declaration to use subtype_indication.classify

* Changed interface_variable_declaration to call subtype_indication.classify

* Changing the following to use subtype_indication.classify:

  interface_constant_declaration
  interface_file_declaration
  interface_signal_declaration
  interface_unkown_declaration

* Changing the following to use subtype_indication.classify:

  constrained_array_definition

* Changing the following to use subtype_indication.classify

  element_subtype_definition

* Changing the following to use subtype_indication.classify:

  alias_declaration

* removing commented out line.

* Changing the following to use subtype_indication.classify:

  file_declaration

* Changing the following to use subtype_indication.classify

  access_type_definition

* Removing subtype_indication.classify_until

* Initial commit of rule signal_017

  * Implemented record_constraint_open_paren = add_new_line

* Minor refactoring.

* Extracted the following functions:

  _check_add_new_line
  _token_at_beginning_of_line

* Adding the following options to rule signal_017

  *  record_constraint_open_paren :: remove_new_line

* Adding the following options:

  record_constraint_close_paren :: add_new_line
  record_constraint_close_paren :: remove_new_line

* Adding the following options:

  record_constraint_comma :: remove_new_line

* Adding the following option:

  record_constraint_element :: add_new_line
  record_constraint_element :: remove_new_line

* Adding the following option:

  * array_constraint :: all_in_one_line

* Fixing issue with array_constraint::all_in_one_line not detecting multiline array_constraints.

* Adding the following options:

  array_constraint :: one_line_per_dimension

* Adding rule signal_400 to handle indenting of multiline signal constraints.

* Fixing issues for Codacy.

* Refactoring to reduce complexity and improve readability.

* Adding links to new rules.

* Refactoring to improve readability.

* Refactoring to improve readability.

* Fixing style issues.

* Updating for style issues.

* Updating formatting issues.

* Removing unused file.

* Removing commented out debug statements.

* Minor formatting updates.

* Adding metadata attribute and methods.

* Refactoring _check_array_contraint_one_line_per_dimension function to improve readability.

* Refactoring _check_array_constraint_all_in_one_line function to improve readability.

* Refactoring _create_violation to just take oToi as a parameter.

* Adding exception logic.

* Refactoring to improve readability.

* Refactored analyze_exception_one to improve readability.

* Refactoring the following functions:

  * _check_array_constraint_all_in_one_line
  * _check_array_constraint_one_line_per_dimension

* Refactoring the following functions:

  *  add_index_constraint_open_parenthesis
  *  add_index_constraint_close_parenthesis
  *  add_record_constraint_open_parenthesis
  *  add_record_constraint_close_parenthesis

* Refactoring to improve readability.

* Minor formatting updates.

* Adjusting signal_400 to remove extra level of indent.

* Updates for rule signal_400:

  1)  Modified base rule multiline_alignment_between_tokens to support signal_400
  2)  Added tests for the four variants of options.

* Fixing style issues.

* Simplifying _check_new_line_after_comma function.

* Deprecating rule signal_016.

* Removing unused base rule multiline_declaration_structure.

* Style and minor refactorings.

* Moving filtering of toi's from _analyze to _get_tokens_of_interest.

* Extracted update_open_paren_counter from _classify_assignment

* Extracted update_close_paren_counter form _classify_assignment

* Refactoring _fix_violation to reduce complexity

* Refactored _create_violation:

  1)  Placed violation information into oToi object

* Refactoring to reduce complexity.

* Adding rule constant_017

* Adding rule variable_017

* Updating links to rules.

* Adding rule variable_400.

* Minor cleanup of documentation.

* Adding default values for options.

* Minor updates for formatting:
2022-07-08 08:26:29 -05:00
Jeremiah Leary 267b17e72a
Updates for issue #730 (#741)
* Updates for issue #730

Adding rules to handle case for use_clause selected names.

  1)  Added new tokens to use_clause
  2)  selected names now parsed with new tokens
  3)  Added rules:
      a)  use_clause_500
      b)  use_clause_501
      c)  use_clause_502
      d)  use_clause_503
  4)  Added tests

Resolves #730

* Refactoring to reduce duplication.
Removing trailing whitespace.

* Changing exceptions to case_exceptions.

1)  case::name rules allow case_exceptions by default
2)  Updated instantiated_unit to split entity_name with a library name
3)  Rule instantiation_028 simplified
4)  Removed unused test file

* Refactoring to reduce complexity.

* Refactoring to improve readability.

* Fixed isue with procedure_506 crashing VSG due to missing variable.

* Fixing missing call to lowercase list.

* Adding the following rules:

  context_ref_500
  context_ref_501

Deprecated the following rules:

  context_ref_004

* Placing common code into a single file.

* Removing trailing whitespace.

* Refactoring to reduce the number of parameters.
2022-04-19 19:21:20 -05:00
Jeremiah Leary 0bdaf811d6
Updates to resolve #643 (#733)
* Updates for issue #643

Adding rule port_600.

* Adding rule port_601.

* Adding rule port_602.

* Refactoring to improve readability.

* Removing unused test file.

* Adding rule port_605.

* Fixing mis named function.

* Adding rule port_606.

* Adding rule port_607.

* Fixing misclassification of buffer mode type.

* Fixing misclassification of linkage port types.

* Adding rule port_603.

* Adding rules port_608 and port_609.

* Refactoring to reduce duplication.
2022-02-20 07:51:00 -06:00
Jeremiah Leary c2014549a7
Updates for issue #729 (#731)
* Updates for issue #729

Added rule ieee_500 to handle case of ieee keywords.

* Minor formatting updates.
Moved similar token classifications from name, subtype_indication and expression to utils.

* Fixing doc string.

* Deprecating rule signal_010.

* Deprecating rule signal_011.

* Deprecated rule constant_011.

* Deprecating rule variable_010.

* Removing trailing whitespace.

* Moving method to utils.

* Refactored method into function and placed it in utils.

* Refactoring to remove duplication.

* Fixing indenting.
2022-02-09 20:16:02 -06:00
Jeremiah Leary a18fe76779
Issue 575 (#703)
* Update for issue #575:

Fixing alignment rules as they were introducing syntax errors:
  align_tokens_in_region_between_tokens
  align_tokens_in_region_between_tokens_skiping_lines_starting_with_tokens

* Refactoring to improve readability.

* Addressing issues from Codacy and Codeclimate

* Refactoring number_of_tokens_in_token_list to improve readability.

* Refactoring utils functions to improve readability.

* Removing unused variable.

* An exit statement with a <= was being classified as a signal assignment.

* Fixed issue with improper classification of character literals.

* Extracting class from tokens.py

* Refactoring tokens.py to improve readability.

* Fixing issue when attempting to detect trailing whitespace.

* Updating tests to reflect changes in tokens.py

* Refactoring combine_characters_into_words to improve readability.

* Refactoring combine_string_literals to improve readability.

* Refactoring find_indexes_of_double_quote_pairs to improve readability.

* Refactoring combine_character_literals to improve readability.

* Refactoring to improve readability.

* Removing unused functions.

* Adding additional tests for tokenizer.

* Moving rule variable_assignment_004 to phase 5 and subphase 2 to ensure it runs correctly.

* Updating documentation for variable_assignment_004 change in phase.

* Rule constant_012 was operating on constant which were not arrays.

* Removing unused function.

* Removing unused function.

* Moving rule generic_001 to entity_200 to properly handle generic_clause in a package declaration.

* Refactoring extract routines to improve readability.

* Refactoring base rule to improve readability.

* Fixing Minor formatting issues.

* Removing unused function.

* Removing unused functions.

* Improving code coverage.

* Improving code coverage:

  1)  Removed unused functions
  2)  Removed unreachable code

* Refactoring constant_012 to improve readability.

* Refactoring analyze to _analyze:

  1)  Updated _get_tokens_of_interest to add more info into the token object

* Refactoring to improve readability.

* Refactoring generate_paren_dicts function to improve readability.

* Refactoring check_indents to improve readability.

* Refactoring to improve readability.

* Updates for rule constant_012:

  1)  Arguments align_left False and align_paren True working

* Refactored analyze_align_left_true_align_paren_false function in rule constant_012

* Refactored _analyze_align_paren_true_align_left_true function for rule constant_012.

* Removed unused functions and methods for rule constant_012.

* Updated rule constant_012 to use the indent step

* Refactoring to functions into methods.

* Removing unused file.

* Refactoring rule constant_012 to improve readability.

* Additional refactoring to improve readability.

* Refactoring check_left_aligned_line function to use less parameters.

* Removing unused variables.

* Attempting to get JSON extract test to pass on CI server.

* Removing unused functions.

* Updates for rule comment_100:

  Rule was error out if a comment was only 3 characters and the third was not a letter or number.

    1) Updated test
    2) Added check for length of comment

* Updates for parsing procedure_calls_statements:

Procedure call with <= was being classified as a simple waveform.

  1)  Updated test to expose issue
  2)  Updated classification code

* Refactoring to reduce cyclomatic complexity.

* Refactoring to reduce cyclomatic complexity.

* Minor formatting updates.

* Adding parsing of physical_type_definitions:

  1)  Added tokens
      a)  physical_type_definition
      b)  primary_unit_declaration
      c)  secondary_unit_declaration
  2)  Added classifiers
      a)  physical_type_definition
      b)  primary_unit_declaration
      c)  secondary_unit_declaration
  3)  Added test
      a)  full_type_declaration

* Minor formatting fix.

* Fixed bug with concurrent_simple_signal_assignment.

  A <= in a generic map was causing the generic map to be classified as a concurrent_simple_signal_assignment.

  1)  Updated test
  2)  Updated concurrent_simple_signal_assignment classifier

* Refactoring to reduce cyclomatic complexity.

* Adding classification of configuration_specification:

  1)  Added tests
  2)  Added classifiers for configuration_specification.

* Minor formatting updates.

* Fixing issue with previous_line rule if there were no lines above.

* Assert_statement was being classified before exiting block_statement.

* A backslash in a string literal was not be classified as a string literal.
2022-01-22 19:01:08 -06:00
Jeremiah Leary e1b19065b5
Updates for issue #691 (#692)
* Updates for issue #691

A conditional variable assignment was being classified as a conditional waveform assignment.

  1)  Added to test to expose the issue
  2)  sequential_statement checks for variable assignments before waveform assignments

* Updates for issue #691

Fixing unrelated test that occasionally fails due to order of file analysis.
2021-12-04 08:24:23 -06:00
Jeremiah Leary 5fa511698f Updates for issue #569
A single space character literal was being classified as a whitespace token.

  1)  Updated test to expose the issue
  2)  Updated classifier to not classify a space character literal as a whitespace token
2021-04-29 19:52:54 -05:00
Jeremiah Leary de5338decb Updates for issue 555
Use clause with double quotes was not making it through the parser.

  1)  Updated tests to find expose the issue
  2)  Updated code to correctly classify use clauses with double quotes
2021-04-24 14:06:40 -05:00
Jeremiah Leary e5be92f503 Adding initial configuration parsing.
NOTE:  Still needs a lot of work.
2021-03-19 19:42:37 -05:00
Jeremiah Leary c237e1c60c Updates for Codacy.
Minor updates.
2021-03-13 08:19:44 -06:00
Jeremiah Leary 52654175c7 Updates for Codacy:
Removed unused imports.
2021-03-13 07:53:42 -06:00
Jeremiah Leary a97d9f092f Updates for Codacy issues:
1)  Removing trailing whitespace
  2)  Removing unused code
2021-03-10 08:23:50 -06:00
Jeremiah Leary 9ba368de9a
Merge pull request #529 from Emilv2/unused_imports
Remove unused imports and unused code
2021-03-10 08:01:49 -06:00
Jeremiah Leary fa3e1d9f1c Updates for issue #532:
Process classifer was not honoring the end of a block statement.

  1)  Updated tests to expose the issue
  2)  Updated process classifier
2021-02-13 09:27:55 -06:00
Emil Vanherp 103d028568
remove unused imports 2021-02-10 23:53:34 +01:00
Jeremiah Leary 42f8f24c5b Updates for issue #515:
Parser would fail on loop statements if preceeded by a simple procedure/function call.

  1)  Updated tests
  2)  Updated interation_scheme parser
2021-01-11 08:56:50 -06:00
Jeremiah Leary ed3b214e40 Updates for issue #513
Adding support for pragmas vhdl_comp_on and vhdl_comp_off.
The VSG parser will ignore anything between those pragmas.

  1)  Added test
  2)  Added pragma token class
  3)  Added pragma parser
2021-01-09 13:36:27 -06:00
Jeremiah Leary 8086380440 Updates for issue #516:
The file_logical_name was not being properly parsed.

  1)  Updated test to expose issue
  2)  Updated parser to handle file_logical_name expressions
2021-01-08 19:25:01 -06:00
Jeremiah Leary f7b4aae56e Updates for issue #514:
Parser did not accept infinite loops.

  1)  Updated test to expose issue
  2)  Updated parser to allow for infinite loops
2021-01-08 17:26:28 -06:00
Jeremiah Leary fa5acc0794 Updates for issue #511
Parsing of parenthesis in expressions and subtype indications were improved.

  1)  Updated tests
  2)  Ensured all calls to classify_until were lists
  3)  Updated expression and subtype_indication classifiers
2021-01-08 08:51:12 -06:00
Jeremiah Leary 9b7ba24e0b Updates for issue #510:
subtype_indication classifier was incorrectly handling the closing parenthesis.

  1)  Updated tests
  2)  Updated subtype_indication classifier
2021-01-05 19:36:40 -06:00
Jeremiah Leary b9ff42e5b1 Updates for issue #508:
Procedure declarations without a formal parameter list would fail to classify.

  1)  Updated test
  2)  Updated procedure and function classifiers
2021-01-04 17:58:21 -06:00
Jeremiah Leary 1a9da639d3 Updates for issue #503:
Preprocessor commands were being replaced with empty strings.
2020-12-21 15:26:30 -06:00
Jeremiah Leary 585208ad61 Updates for issue #503:
Adding ability to parse preprocessor commands embedded in VHDL code.

  1)  Added preprocessor token
  2)  Added preprocessor classifier
2020-12-21 14:15:48 -06:00
Jeremiah Leary 536abbedd7 Updates for issue #401:
Expanding rules for attributes:

  1)  Removed current attribute rules
  2)  Added rules for:
      a) attribute_declaration
      b) attribute_specification
      c) entity_specification
  3)  Added documentation
  4)  Added tests
  5)  Refactored base rules to allow for lists of token types
      a) single_space_after_token
      b) single_space_before_token
2020-12-18 14:13:40 -06:00
Jeremiah Leary e94964d883 Updates for issue #497
Adding support for parsing of protected types.

  1)  Added classification tests
  2)  Added parsing of protected types
  3)  Added protected type tokens
2020-12-17 14:58:48 -06:00
Jeremiah Leary a18ab6414d Updates for issue #495:
Parser could not handle alias with parenthesis in the name.

  1)  Updated test to expose the issue
  2)  Updated parser to handle parenthesis in the name
2020-12-17 13:20:50 -06:00
Jeremiah Leary e80c16da15 Updates for issue #429
Improving error message reporting while parsing generate statements.
2020-12-17 10:51:57 -06:00
Jeremiah Leary 7a25ded9ef Updates for issues #457 and #444:
Adding block rules.

  1)  Added documentation
  2)  Added tests
  3)  Added initial block rules
2020-12-10 13:48:21 -06:00
Jeremiah Leary 1f2917478b Updates for issue #476:
The classifier concurrent_selected_signal_assignment was being too gready.

  1)  Added check for the keyword *end* before classifying.
2020-12-09 19:19:13 -06:00
Jeremiah Leary 089ba52904 Updates for issue #378
Adding rules for package body.

  1)  Added 22 package_body rules
  2)  Added documentation
  3)  Added tests
2020-12-09 16:51:23 -06:00
Jeremiah Leary a7c7dda433 Adding more exceptions for detecting concurrent procedures. 2020-12-05 10:25:25 -06:00
Jeremiah Leary 4721ae0322 Updates for Codacy flagged issues. 2020-12-04 13:27:19 -06:00
Jeremiah Leary 7bdad636b5 Fixing issue where loop_statement was mis-classifying a wait for statement after an else keyword. 2020-11-25 11:50:40 -06:00
Jeremiah Leary f7fe1122b1 More updates for Codacy checks. 2020-11-25 09:33:32 -06:00
Jeremiah Leary 379d5df847 Removing trailing spaces. 2020-11-25 08:26:54 -06:00
Jeremiah Leary 2ed37e75c9 Updates for CodeClimate. 2020-11-25 08:17:51 -06:00
Jeremiah Leary 39dce36ec8 Additional Codacy Updates. 2020-11-24 18:19:42 -06:00
Jeremiah Leary a0a9813d89 Codacy fixes. 2020-11-24 17:14:00 -06:00
Jeremiah Leary 8e7d38f68d Updating discrete_range to handle functions and parenthesis. 2020-11-23 16:08:48 -06:00
Jeremiah Leary d76c673437 Renaming classify_new module to classify. 2020-11-23 09:24:59 -06:00
Jeremiah Leary 1252231d4d Removing old classifiers due to refactoring for new parser. 2020-11-09 21:00:04 -06:00