Commit Graph

12 Commits

Author SHA1 Message Date
JHertz5 ce86655850
Issue#1236: Rule for case in hexadecimal constants and base specifier (#1237)
* Issue#1236: Updated parser to recognise bit string literals.

* Issue#1236: Added rules bit_string_literal_500 and bit_string_literal_501.

* Issue#1236: Updated bit string literal tokens to combine quote tokens into bit_value string token.

* Issue#1236: Updated case_utils to add exeption for bit string literals.

* Issue#1236: Updated parser to separate bit_string_literal integer token from bit_string_literal base_specifier token.

* Issue#1236: Added test for bit_string_literal classification.

* Issue#1236: Added test for bit_string_literal_500.

* Issue#1236: Added test for bit_string_literal_501.

* Issue#1236: Updated rules and rule tests.

* Issue#1236: Style updates.

* Issue#1236: Updated classification result.

* Issue#1236: Changed bit_string_literal_501 to default to upper case.

* Issue#1236: Updated tests for bit_string_literal_501 default to upper case change.

* Issue#1236: Formatting changes.

* Issue#1236: Updated fixed versions of code examples.

* Issue#1236: Updated fixed versions of code examples.

* Issue#1236: Code refactoring to reduce duplication.

* Issue#1236: Code refactoring to improve names and remove unused code.

* Issue#1236: Formatting changes.

* Issue#1236: Refactored code to reduce congitive complexity.

* Issue#1236: Refactored code to reduce congitive complexity.

* Issue#1236: Added bit string literal rules to top-level rules documentation.

* Issue#1236: Used compiled regular expressions to improve bit_string_literal parsing.

* Issue#1236: Changed regex strings to raw strings to avoid warnings about invalid escape sequences.

* Issue#1236: Removed unused import.
2024-10-07 20:09:53 -05:00
Jeremiah Leary da84a1be1f
Issue#1170: Adding rules to enforce spaces before generic map and port map assignment operators. (#1173)
* Issue#1170:  Adding rules to enforce spaces before generic map and port map assignment operators.

* Adding ability to parse external names.

  1)  Added parsing of external names
  2)  Added external_signal_name rules

* Adding parsing of external names to productions.

* Fixing rule identifiers.

* Adding external_constant_name rules.

* Adding external_variable_name rules.

* Adding classification of indexes of external names.

* Style issue updates and fixing test.
2024-10-02 21:47:19 -05:00
Jeremiah Leary ce70761895
Issue#1059: Performance improvements: (#1064)
* Issue#1059:  Performance improvements:

  * Added lower value to token and removed .lower() in other files
  * Simplified find_next_token

* Attempt at new algorithm for closest pair.

NOTE:  attempt has been commented out.

* WIP:  Improved token pairs process:

NOTE:  It does not appear to complete all the  matches.

* Revert "WIP:  Improved token pairs process:"

This reverts commit f41254087e84caa42b02058fd9fbb6cfcce673fc.

* Revert "Attempt at new algorithm for closest pair."

This reverts commit 4a972793883b9aa54a6e7ccd15e1cc26b8296fec.

* Updates for black.
2024-04-09 06:52:40 -05:00
Alon Bar-Lev c22a86025f style: apply black
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2024-03-24 21:16:35 +02:00
Alon Bar-Lev 5b4bae04aa style: apply isort
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2024-03-24 21:16:35 +02:00
Alon Bar-Lev b8c49b5946 style: python encoding
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2024-03-24 21:16:35 +02:00
Jeremiah Leary 33a209b9b1
Issue#1061: Updates for pragma use cases (#1063)
* Issue#1061:  Updates for pragma use cases

Pragmas are now treated as comments:

  *  Pragmas are now a subclass of comments
  *  Move rules will not move tokens if it crosses a pragma

* Fixing issue with expression classification causing infinite loop.
2023-12-12 06:41:06 -06: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 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 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 f7fe1122b1 More updates for Codacy checks. 2020-11-25 09:33:32 -06:00
Jeremiah Leary d76c673437 Renaming classify_new module to classify. 2020-11-23 09:24:59 -06:00