Skip to content

Commit

Permalink
[FJSX15] Add pipe operator
Browse files Browse the repository at this point in the history
  • Loading branch information
borela committed Oct 21, 2017
1 parent f7973de commit 3492ef7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions syntaxes/fjsx15/operator.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ scope: ...

contexts:
main:
- include: Packages/Naomi/syntaxes/fjsx15/operator/pipe.sublime-syntax
- include: Packages/Naomi/syntaxes/fjsx15/operator/spread.sublime-syntax
- include: Packages/Naomi/syntaxes/fjsx15/operator/comparison.sublime-syntax
- include: Packages/Naomi/syntaxes/fjsx15/operator/assignment.sublime-syntax
Expand Down
43 changes: 43 additions & 0 deletions syntaxes/fjsx15/operator/pipe.sublime-syntax
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
%YAML1.2
---

# Licensed under the Apache License, Version 2.0 (the “License”); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

hidden: true

scope: ...

variables:
commonIdentifier: |
[$_[:alpha:]]
[$_[:alnum:]]*
contexts:
main:
- match: \s*(\|>)
captures:
1: keyword.operator.other.pipe.js.fjsx15
set: function-or-expression

function-or-expression:
- include: Packages/Naomi/syntaxes/fjsx15/arrow-function.sublime-syntax
# Simple function.
- match: |
(?xi)\s*
({{commonIdentifier}})
captures:
1: entity.name.function.js.fjsx15
pop: true
# Other expressions.
- include: Packages/Naomi/syntaxes/fjsx15/statement-and-expression.sublime-syntax

0 comments on commit 3492ef7

Please sign in to comment.