-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ccce57
commit 97fbb3c
Showing
4 changed files
with
84 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System.Text.RegularExpressions; | ||
|
||
namespace OneWare.Vhdl.Folding; | ||
|
||
public class FoldingRegexVhdl | ||
{ | ||
private const string FoldingStartPattern = @"(?x) | ||
# From the start of the line make sure we are not going into a comment ... | ||
^( | ||
([^-]-?(?!-))*? | ||
( | ||
# Check for keyword ... is | ||
(\b(?i:architecture|case|entity|function|package|procedure)\b(.+?)(?i:\bis)\b) | ||
# Check for if statements | ||
|(\b(?i:if)\b(.+?)(?i:generate|then)\b) | ||
# Check for and while statements | ||
|(\b(?i:for|while)(.+?)(?i:loop|generate)\b) | ||
# Check for keywords that do not require an is after it | ||
|(\b(?i:component|process|record)\b[^;]*?$) | ||
# From the beginning of the line, check for instantiation maps | ||
|(^\s*\b(?i:port|generic)\b(?i:\s+map\b)?\s*\() | ||
) | ||
) | ||
"; | ||
|
||
private const string FoldingEndPattern = @"(?x) | ||
# From the start of the line ... | ||
^( | ||
( | ||
( | ||
# Make sure we are not going into a comment ... | ||
([^-]-?(?!-))*? | ||
( | ||
# The word end to the end of the line | ||
(?i:\bend\b).*$\n? | ||
) | ||
) | ||
) | ||
# ... a close paren followed by an optional semicolon as the only thing on the line | ||
|(\s*?\)\s*?;?\s*?$\n? | ||
) | ||
) | ||
"; | ||
|
||
public static Regex FoldingStart = new(FoldingStartPattern, RegexOptions.Multiline); | ||
|
||
public static Regex FoldingEnd = new(FoldingEndPattern, RegexOptions.Multiline); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters