-
Notifications
You must be signed in to change notification settings - Fork 5
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
b3a63f6
commit 765ce4c
Showing
18 changed files
with
500 additions
and
88 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
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
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,20 @@ | ||
from codelimit.common.Language import Language | ||
from codelimit.common.gsm.operator.OneOrMore import OneOrMore | ||
from codelimit.common.scope.scope_utils import ( | ||
get_blocks, | ||
get_headers, | ||
) | ||
from codelimit.common.token_matching.predicate.Balanced import Balanced | ||
from codelimit.common.token_matching.predicate.Name import Name | ||
from codelimit.common.token_matching.predicate.Symbol import Symbol | ||
|
||
|
||
class CSharp(Language): | ||
def __init__(self): | ||
super().__init__('C#') | ||
|
||
def extract_headers(self, tokens: list) -> list: | ||
return get_headers(tokens, [Name(), OneOrMore(Balanced('(', ')'))], Symbol('{')) | ||
|
||
def extract_blocks(self, tokens: list, headers: list) -> list: | ||
return get_blocks(tokens, "{", "}") |
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
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
Oops, something went wrong.