Skip to content

Commit 833cda2

Browse files
committed
Don't highlight 'from.' when it's a part of a name
Fixes issue #22
1 parent cd69934 commit 833cda2

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

grammars/MagicPython.cson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ repository:
870870
'''
871871
match: '''
872872
(?x)
873-
\\s* (from) (\\s*\\.+\\s*)
873+
\\s* \\b(from)\\b (\\s*\\.+\\s*)
874874
875875
'''
876876
captures:

grammars/MagicPython.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ it's not tokenized as ellipsis.
13931393
</string>
13941394
<key>match</key>
13951395
<string>(?x)
1396-
\s* (from) (\s*\.+\s*)
1396+
\s* \b(from)\b (\s*\.+\s*)
13971397
</string>
13981398
<key>captures</key>
13991399
<dict>

grammars/src/MagicPython.syntax.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ repository:
618618
it's not tokenized as ellipsis.
619619
match: |
620620
(?x)
621-
\s* (from) (\s*\.+\s*)
621+
\s* \b(from)\b (\s*\.+\s*)
622622
captures:
623623
'1': {name: keyword.control.flow.python}
624624

test/expressions/expr15.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
foofrom.something
2+
3+
4+
5+
foofrom : source.python
6+
. : source.python
7+
something : source.python
8+
: source.python

0 commit comments

Comments
 (0)