Skip to content

Commit

Permalink
Fuly integrated upstream changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
thom committed Mar 20, 2018
1 parent 0f07ccb commit 15ea5dc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 96 deletions.
33 changes: 3 additions & 30 deletions extensions/es_decorators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,9 @@ contexts: !merge
statements: !prepend
- include: decorator

class-body:
- match: '\{'
scope: punctuation.section.block.js
set:
- meta_scope: meta.block.js

- include: decorator

- match: '\}'
scope: punctuation.section.block.js
pop: true

- match: \;
scope: punctuation.terminator.statement.js

- match: \bconstructor\b
scope: entity.name.function.constructor.js
push:
- function-declaration-expect-body
- function-declaration-meta
- function-declaration-expect-parameters

- match: \bstatic\b
scope: storage.modifier.js
push: class-field

- match: (?={{class_element_name}})
push: class-field

- include: else-pop
class-body-contents: !prepend
- meta_scope: meta.block.js
- include: decorator

decorator:
- match: '@'
Expand Down
22 changes: 11 additions & 11 deletions extensions/flow_types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ contexts: !merge
- include: flow-type-alias-declaration

flow-type-declare:
- match: \bdeclare\b(?=\s*(?:type|class|opaque|export)\b)
- match: declare{{identifier_break}}(?=\s*(?:type|class|opaque|export){{identifier_break}})
scope: storage.type.js
set:
- match: \bopaque\b
- match: opaque{{identifier_break}}
scope: storage.modifier.js
pop: true
- include: else-pop
Expand Down Expand Up @@ -104,7 +104,7 @@ contexts: !merge
- include: else-pop

class-extends:
- match: \bextends\b
- match: extends{{identifier_break}}
scope: storage.modifier.extends.js
set:
- - include: flow-type-generic-arguments
Expand Down Expand Up @@ -223,15 +223,15 @@ contexts: !merge
push: flow-type

flow-type-literal:
- match: \btrue\b
- match: true{{identifier_break}}
scope: constant.language.boolean.true.js
pop: true
- match: \bfalse\b
- match: false{{identifier_break}}
scope: constant.language.boolean.false.js
pop: true
- match: (?=\d)
set:
- - match: \w+
- - match: '{{identifier_part}}+'
scope: invalid.illegal.js
- include: immediately-pop
- literal-number
Expand All @@ -241,14 +241,14 @@ contexts: !merge
flow-type-special: !foreach
in: [ any, mixed ]
value:
match: !argument value
match: !format '{value}{{{{identifier_break}}}}'
scope: !format 'support.type.{value}.js'
pop: true

flow-type-primitive: !foreach
in: [ boolean, number, string, 'null', void ]
value:
match: !argument value
match: !format '{value}{{{{identifier_break}}}}'
scope: !format 'support.type.primitive.{value}.js'
pop: true

Expand Down Expand Up @@ -278,7 +278,7 @@ contexts: !merge
- include: flow-type-list

flow-type-typeof:
- match: \btypeof\b
- match: typeof{{identifier_break}}
scope: keyword.operator.js
set: expression

Expand Down Expand Up @@ -388,11 +388,11 @@ contexts: !merge
- include: else-pop

flow-type-alias-declaration:
- match: (?=\btype\b)
- match: (?=type{{identifier_break}})
push: flow-type-alias

flow-type-alias:
- match: \btype\b
- match: type{{identifier_break}}
scope: storage.type.js
set:
- !meta meta.declaration.type.js
Expand Down
4 changes: 3 additions & 1 deletion extensions/jsx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
---
!merge
variables: !merge
jsx_identifier: '[_$[:alpha:]][-_$[:alnum:]]*'
jsx_identifier_part: (?:{{identifier_part}}|-)
jsx_identifier_break: (?!{{jsx_identifier_part}})
jsx_identifier: '{{identifier_start}}{{jsx_identifier_part}}*{{jsx_identifier_break}}'

contexts: !merge
expression-begin: !prepend
Expand Down
62 changes: 10 additions & 52 deletions extensions/string_object_keys.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,14 @@
%YAML 1.2
%TAG ! tag:yaml-macros:yamlmacros.lib.extend,yamlmacros.lib.arguments:
%TAG ! tag:yaml-macros:yamlmacros.lib.extend:
---
!merge
contexts: !merge
object-literal:
- match: '\{'
scope: punctuation.section.block.js
set:
- meta_scope: meta.object-literal.js
- match: '\}'
scope: punctuation.section.block.js
pop: true

- match: \.\.\.
scope: keyword.operator.spread.js
push: expression-no-comma

- match: >-
(?x)(?=
{{property_name}}\s*:
(?: {{either_func_lookahead}} )
)
push:
- either-function-declaration
- function-declaration-meta
- object-literal-expect-colon
- object-literal-meta-key
- method-name
- match: '{{method_lookahead}}'
push: method-declaration

- match: '{{identifier}}(?=\s*(?:[},]|$|//|/\*))'
scope: variable.other.readwrite.js
- match: (?=\[)
push: computed-property-name
- match: "(?=\"|')"
push:
- object-literal-meta-key
- literal-string
- match: '{{dollar_identifier}}'
scope: string.unquoted.js meta.object-literal.key.dollar.js
captures:
1: punctuation.dollar.js
- match: '{{identifier}}'
scope: string.unquoted.js meta.object-literal.key.js
- match: (?=[-+]?(?:\.[0-9]|0[bxo]|\d))
push:
- meta_scope: meta.object-literal.key.js
- include: literal-number

- include: comma-separator
- match: ':'
scope: punctuation.separator.key-value.js
push: expression-no-comma
bare-property-name:
- match: '{{dollar_only_identifier}}'
scope: string.unquoted.js meta.object-literal.key.dollar.only.js punctuation.dollar.js
- match: '{{dollar_identifier}}'
scope: string.unquoted.js meta.object-literal.key.dollar.js
captures:
1: punctuation.dollar.js
- match: '{{identifier}}'
scope: string.unquoted.js meta.object-literal.key.js
4 changes: 2 additions & 2 deletions extensions/styled_components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!merge
contexts: !merge
expression-begin: !prepend
- match: (?=(?:styled|injectGlobal|keyframes)\b)
- match: (?=(?:styled|injectGlobal|keyframes){{identifier_break}})
set:
- styled-component-end
- styled-component-begin
Expand Down Expand Up @@ -61,4 +61,4 @@ contexts: !merge
scope: variable.other.readwrite.js
pop: true

- include: else-pop
- include: else-pop

0 comments on commit 15ea5dc

Please sign in to comment.