-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from MattDMo/unicode
Unicode back to master!
- Loading branch information
Showing
11 changed files
with
50,149 additions
and
287 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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,117 @@ | ||
# [PackageDev] target_format: plist, ext: tmLanguage | ||
comment: Matches Python's regular expression syntax. | ||
name: Regular Expressions (PythonImproved) | ||
scopeName: source.regexp.python.improved | ||
fileTypes: [re] | ||
uuid: DD867ABF-1EC6-415D-B047-687F550A1D51 | ||
|
||
patterns: | ||
- name: keyword.control.anchor.regexp | ||
match: \\[bBAZzG]|\^|\$ | ||
|
||
- name: keyword.other.back-reference.regexp | ||
match: \\[1-9][0-9]? | ||
|
||
- name: keyword.operator.quantifier.regexp | ||
match: '[?+*][?+]?|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??' | ||
|
||
- name: keyword.operator.or.regexp | ||
match: \| | ||
|
||
- name: comment.block.regexp | ||
begin: \(\?\# | ||
end: \) | ||
|
||
- comment: We are restrictive in what we allow to go after the comment character to | ||
avoid false positives, since the availability of comments depend on regexp flags. | ||
name: comment.line.number-sign.regexp | ||
match: (?<=^|\s)#\s[[a-zA-Z0-9,. \t?!-:][^\x{00}-\x{7F}]]*$ | ||
|
||
- name: keyword.other.option-toggle.regexp | ||
match: \(\?[iLmsux]+\) | ||
|
||
- name: keyword.other.back-reference.named.regexp | ||
match: (\()(\?P=([a-zA-Z_][a-zA-Z_0-9]*\w*))(\)) | ||
|
||
- name: meta.group.assertion.regexp | ||
begin: (\()((\?=)|(\?!)|(\?<=)|(\?<!)) | ||
beginCaptures: | ||
'1': {name: punctuation.definition.group.regexp} | ||
'2': {name: punctuation.definition.group.assertion.regexp} | ||
'3': {name: meta.assertion.look-ahead.regexp} | ||
'4': {name: meta.assertion.negative-look-ahead.regexp} | ||
'5': {name: meta.assertion.look-behind.regexp} | ||
'6': {name: meta.assertion.negative-look-behind.regexp} | ||
end: (\)) | ||
endCaptures: | ||
'1': {name: punctuation.definition.group.regexp} | ||
patterns: | ||
- include: $self | ||
|
||
- comment: we can make this more sophisticated to match the | character that separates | ||
yes-pattern from no-pattern, but it's not really necessary. | ||
name: meta.group.assertion.conditional.regexp | ||
begin: (\()(\?\(([1-9][0-9]?|[a-zA-Z_][a-zA-Z_0-9]*)\)) | ||
beginCaptures: | ||
'1': {name: punctuation.definition.group.regexp} | ||
'2': {name: punctuation.definition.group.assertion.conditional.regexp} | ||
'3': {name: entity.name.section.back-reference.regexp} | ||
end: (\)) | ||
patterns: | ||
- include: $self | ||
|
||
- name: meta.group.regexp | ||
begin: (\()((\?P<)([A-Za-z]\w*)(>)|(\?:))? | ||
beginCaptures: | ||
'1': {name: punctuation.definition.group.regexp} | ||
'3': {name: punctuation.definition.group.capture.regexp} | ||
'4': {name: entity.name.section.group.regexp} | ||
'5': {name: punctuation.definition.group.capture.regexp} | ||
'6': {name: punctuation.definition.group.no-capture.regexp} | ||
end: (\)) | ||
endCaptures: | ||
'1': {name: punctuation.definition.group.regexp} | ||
patterns: | ||
- include: $self | ||
|
||
- include: '#character-class' | ||
|
||
repository: | ||
character-class: | ||
patterns: | ||
- match: |- | ||
(?x)\\ | ||
( | ||
(w) | | ||
(W) | | ||
(s) | | ||
(S) | | ||
(d) | | ||
(D) | ||
) | ||
captures: | ||
'2': {name: constant.character.character-class.word.regexp} | ||
'3': {name: constant.character.character-class.non-word.regexp} | ||
'4': {name: constant.character.character-class.whitespace.regexp} | ||
'5': {name: constant.character.character-class.non-whitespace.regexp} | ||
'6': {name: constant.character.character-class.digit.regexp} | ||
'7': {name: constant.character.character-class.non-digit.regexp} | ||
- name: constant.character.escape.backslash.regexp | ||
match: \\. | ||
- name: constant.other.character-class.set.regexp | ||
begin: (\[)(\^)? | ||
beginCaptures: | ||
'1': {name: punctuation.definition.character-class.regexp} | ||
'2': {name: keyword.operator.negation.regexp} | ||
end: (\]) | ||
endCaptures: | ||
'1': {name: punctuation.definition.character-class.regexp} | ||
patterns: | ||
- include: '#character-class' | ||
- name: constant.other.character-class.range.regexp | ||
match: ((\\.)|.)\-((\\.)|[^\]]) | ||
captures: | ||
'2': {name: constant.character.escape.backslash.regexp} | ||
'4': {name: constant.character.escape.backslash.regexp} | ||
foldingStartMarker: (/\*|\{|\() | ||
foldingStopMarker: (\*/|\}|\)) |
Oops, something went wrong.