Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1df75f1

Browse files
committedAug 9, 2016
Allow line continuation before "->" return anno; issue #51.
1 parent b2ca47e commit 1df75f1

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed
 

Diff for: ‎grammars/MagicPython.cson

+3
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,9 @@ repository:
11841184
{
11851185
include: "#parameters"
11861186
}
1187+
{
1188+
include: "#line-continuation"
1189+
}
11871190
{
11881191
include: "#return-annotation"
11891192
}

Diff for: ‎grammars/MagicPython.tmLanguage

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
<string>Sconstruct</string>
1919
<string>sconstruct</string>
2020
<string>SConscript</string>
21-
<string>gyp</string>
22-
<string>gypi</string>
2321
</array>
2422
<key>first_line_match</key>
2523
<string>^#!/.*\bpython[\d\.]*\b</string>
@@ -1905,6 +1903,10 @@
19051903
<key>include</key>
19061904
<string>#parameters</string>
19071905
</dict>
1906+
<dict>
1907+
<key>include</key>
1908+
<string>#line-continuation</string>
1909+
</dict>
19081910
<dict>
19091911
<key>include</key>
19101912
<string>#return-annotation</string>

Diff for: ‎grammars/src/MagicPython.syntax.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ repository:
806806
patterns:
807807
- include: '#function-def-name'
808808
- include: '#parameters'
809+
- include: '#line-continuation'
809810
- include: '#return-annotation'
810811

811812
function-def-name:

Diff for: ‎test/functions/decl12.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
def get_streaks(s) \
2+
-> 'spam': pass
3+
4+
5+
6+
def : meta.function.python, source.python, storage.type.function.python
7+
: meta.function.python, source.python
8+
get_streaks : entity.name.function.python, meta.function.python, source.python
9+
( : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.begin.python, source.python
10+
s : meta.function.parameters.python, meta.function.python, source.python, variable.parameter.function.language.python
11+
) : meta.function.parameters.python, meta.function.python, punctuation.definition.parameters.end.python, source.python
12+
: meta.function.python, source.python
13+
\ : meta.function.python, separator.continuation.line.python, source.python
14+
: meta.function.python, source.python
15+
: meta.function.python, source.python
16+
-> : meta.function.python, punctuation.separator.annotation.result.python, source.python
17+
: meta.function.python, source.python
18+
' : meta.function.python, punctuation.definition.string.begin.python, source.python, string.quoted.single.python
19+
spam : meta.function.python, source.python, string.quoted.single.python
20+
' : meta.function.python, punctuation.definition.string.end.python, source.python, string.quoted.single.python
21+
: : meta.function.python, punctuation.section.function.begin.python, source.python
22+
: source.python
23+
pass : keyword.control.flow.python, source.python

0 commit comments

Comments
 (0)
Please sign in to comment.