From 635db0d0119013c6a6c39188767e9def33f5bd7b Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 09:00:17 -0600 Subject: [PATCH 01/13] Test aminya's commit --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..07b849d6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: ci + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + Skip: + if: contains(github.event.head_commit.message, '[skip ci]') + steps: + - name: Skip CI 🚫 + run: echo skip ci + + Test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + atom_channel: + - stable + - nightly + steps: + - uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: | + 'node_modules' + 'C:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/v140' + key: ${{ runner.os }}-${{ matrix.atom_channel }}-${{ hashFiles('package.json') }} + + - uses: UziTech/action-setup-atom@v1 + with: + channel: ${{ matrix.atom_channel }} + + - name: Install Visual Studio 2015 on Windows + if: ${{ contains(matrix.os, 'windows') }} + run: | + choco install visualcpp-build-tools --version=14.0.25420.1 --ignore-dependencies -y --params "'/IncludeRequired'" + echo ::set-env name=VCTargetsPath::'C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140' + + - name: Install dependencies + run: apm install + + - name: Run tests + run: apm test From 289bec62c070270cd2a90ffaba40b2832f8e5ff6 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 09:01:40 -0600 Subject: [PATCH 02/13] fix error --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07b849d6..417747eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,7 @@ on: jobs: Skip: if: contains(github.event.head_commit.message, '[skip ci]') + runs-on: ubuntu-latest steps: - name: Skip CI 🚫 run: echo skip ci From 26426204d49cdf52a5feabbc3c3457f69c5604f1 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:08:23 -0600 Subject: [PATCH 03/13] test 2 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 417747eb..649189d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,13 +9,13 @@ on: jobs: Skip: if: contains(github.event.head_commit.message, '[skip ci]') - runs-on: ubuntu-latest + runs-on: ${{ runner.os }} steps: - name: Skip CI 🚫 run: echo skip ci Test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: From 43e5c46ece97a58b4baa713f534656a22303b589 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:09:50 -0600 Subject: [PATCH 04/13] test 3 --- .github/workflows/ci.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 649189d8..6a88fff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,9 @@ on: pull_request: branches: [ master ] -jobs: - Skip: - if: contains(github.event.head_commit.message, '[skip ci]') - runs-on: ${{ runner.os }} - steps: - - name: Skip CI 🚫 - run: echo skip ci - +jobs: Test: + if: "!contains(github.event.head_commit.message, '[skip ci]')" runs-on: ${{ matrix.os }} strategy: fail-fast: false From 3ead40e8751b296a3d75cd36076bb2cc95f41bc4 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 10:21:10 -0600 Subject: [PATCH 05/13] Delete .travis.yml --- .travis.yml | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 47ee9a1a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -### Project specific config ### -language: generic - -env: - global: - - APM_TEST_PACKAGES="" - - ATOM_LINT_WITH_BUNDLED_NODE="true" - - matrix: - - ATOM_CHANNEL=stable - - ATOM_CHANNEL=beta - -### Generic setup follows ### -script: - - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh - - chmod u+x build-package.sh - - ./build-package.sh - -notifications: - email: - on_success: never - on_failure: change - -branches: - only: - - master - -git: - depth: 10 - -sudo: false - -dist: trusty - -addons: - apt: - packages: - - build-essential - - fakeroot - - git - - libsecret-1-dev From e8a00a6f113164f29182c097076ca2d574be3192 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 14:09:08 -0600 Subject: [PATCH 06/13] ?? check and ?. checks remove redundant // check --- spec/javascript-spec.coffee | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index 7b58213a..1c9467d9 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -435,7 +435,7 @@ describe "JavaScript grammar", -> expect(tokens[1]).toEqual value: '--', scopes: ['source.js', 'keyword.operator.decrement.js'] describe "logical", -> - operators = ["&&", "||", "!"] + operators = ["&&", "||", "!", "??"] it "tokenizes them", -> for operator in operators @@ -1488,6 +1488,10 @@ describe "JavaScript grammar", -> expect(tokens[1]).toEqual value: '...', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'keyword.operator.spread.js'] expect(tokens[2]).toEqual value: 'args', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'variable.parameter.rest.function.js'] + {tokens} = grammar.tokenizeLine('(c, ...val) => c + val') + expect(tokens[4]).toEqual value: '...', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'keyword.operator.spread.js'] + expect(tokens[4]).toEqual value: 'val', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'variable.parameter.rest.function.js'] + it "tokenizes illegal parameters", -> {tokens} = grammar.tokenizeLine('0abc => {}') expect(tokens[0]).toEqual value: '0abc', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'invalid.illegal.identifier.js'] @@ -1770,6 +1774,28 @@ describe "JavaScript grammar", -> expect(tokens[1]).toEqual value: '.', scopes: ['source.js', 'meta.delimiter.property.js'] expect(tokens[2]).toEqual value: 'C', scopes: ['source.js', 'constant.other.property.js'] + it "supports the optional chaining operator", -> + {tokens} = grammar.tokenizeLine('obj?.prop') + expect(tokens[0]).toEqual value: 'obj', scopes: ['source.js', 'variable.other.object.js'] + expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[2]).toEqual value: 'prop', scopes: ['source.js', 'variable.other.property.js'] + + {tokens} = grammar.tokenizeLine('obj?.$_') + expect(tokens[0]).toEqual value: 'obj', scopes: ['source.js', 'variable.other.object.js'] + expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[2]).toEqual value: '$_', scopes: ['source.js', 'variable.other.object.property.js'] + + {tokens} = grammar.tokenizeLine('a()?.b()') + expect(tokens[2]).toEqual value: ')', scopes: ['source.js', 'meta.function-call.js', 'meta.arguments.js', 'punctuation.definition.arguments.end.bracket.round.js'] + expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[4]).toEqual value: 'b', scopes: ['source.js', 'variable.other.property.js'] + + {tokens} = grammar.tokenizeLine('a()?.MY_CONSTANT') + expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'variable.other.object.js'] + expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[2]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] + + describe "strings and functions", -> it "doesn't confuse them", -> {tokens} = grammar.tokenizeLine("'a'.b(':c(d)')") @@ -1832,11 +1858,6 @@ describe "JavaScript grammar", -> expect(tokens[1]).toEqual value: ' foo ', scopes: ['source.js', 'comment.block.documentation.js'] expect(tokens[2]).toEqual value: '*/', scopes: ['source.js', 'comment.block.documentation.js', 'punctuation.definition.comment.end.js'] - it "tokenizes // comments", -> - {tokens} = grammar.tokenizeLine('// comment') - expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js'] - expect(tokens[1]).toEqual value: ' comment', scopes: ['source.js', 'comment.line.double-slash.js'] - it "tokenizes comments inside constant definitions", -> {tokens} = grammar.tokenizeLine('const a, // comment') expect(tokens[0]).toEqual value: 'const', scopes: ['source.js', 'storage.type.const.js'] From 1e4badda70c85adf1bb17e4019b45b7c3c561080 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 20:19:36 -0600 Subject: [PATCH 07/13] Some issues are not valid, most are --- spec/javascript-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index 1c9467d9..25cbad94 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -1490,7 +1490,7 @@ describe "JavaScript grammar", -> {tokens} = grammar.tokenizeLine('(c, ...val) => c + val') expect(tokens[4]).toEqual value: '...', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'keyword.operator.spread.js'] - expect(tokens[4]).toEqual value: 'val', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'variable.parameter.rest.function.js'] + expect(tokens[5]).toEqual value: 'val', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'variable.parameter.rest.function.js'] it "tokenizes illegal parameters", -> {tokens} = grammar.tokenizeLine('0abc => {}') @@ -1792,8 +1792,8 @@ describe "JavaScript grammar", -> {tokens} = grammar.tokenizeLine('a()?.MY_CONSTANT') expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'variable.other.object.js'] - expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] - expect(tokens[2]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] + expect(tokens[4]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[5]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] describe "strings and functions", -> From c668d66d90ef0133c747e51e31a313f2fc6c5b07 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 20:44:31 -0600 Subject: [PATCH 08/13] Prevent ternary when it's ?? or ?. Rearranged match for ?. to (?. or .) instead of (. or ?.) --- grammars/javascript.cson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/javascript.cson b/grammars/javascript.cson index de6c9df6..58f7b2a0 100644 --- a/grammars/javascript.cson +++ b/grammars/javascript.cson @@ -1142,7 +1142,7 @@ ] } { - 'begin': '\\?' + 'begin': '(? Date: Thu, 12 Nov 2020 20:52:33 -0600 Subject: [PATCH 09/13] IT WORKSSSSS!!!!!!! Yas! --- spec/javascript-spec.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index 25cbad94..fff1e03a 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -1782,18 +1782,18 @@ describe "JavaScript grammar", -> {tokens} = grammar.tokenizeLine('obj?.$_') expect(tokens[0]).toEqual value: 'obj', scopes: ['source.js', 'variable.other.object.js'] - expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] - expect(tokens[2]).toEqual value: '$_', scopes: ['source.js', 'variable.other.object.property.js'] + expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.method-call.js', 'meta.delimiter.property.js'] + expect(tokens[2]).toEqual value: '$_', scopes: ['source.js', 'variable.other.property.js'] {tokens} = grammar.tokenizeLine('a()?.b()') expect(tokens[2]).toEqual value: ')', scopes: ['source.js', 'meta.function-call.js', 'meta.arguments.js', 'punctuation.definition.arguments.end.bracket.round.js'] - expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.method-call.js', 'meta.delimiter.method.js'] expect(tokens[4]).toEqual value: 'b', scopes: ['source.js', 'variable.other.property.js'] {tokens} = grammar.tokenizeLine('a()?.MY_CONSTANT') - expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'variable.other.object.js'] - expect(tokens[4]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] - expect(tokens[5]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] + expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'meta.function-call.js', 'enitity.name.function.js'] + expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] + expect(tokens[4]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] describe "strings and functions", -> From f6dbca42e68f9f5968076ea0a560cfc1a1bbe389 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 20:57:18 -0600 Subject: [PATCH 10/13] missed some stuff --- spec/javascript-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index fff1e03a..ed564c4d 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -1782,16 +1782,16 @@ describe "JavaScript grammar", -> {tokens} = grammar.tokenizeLine('obj?.$_') expect(tokens[0]).toEqual value: 'obj', scopes: ['source.js', 'variable.other.object.js'] - expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.method-call.js', 'meta.delimiter.property.js'] + expect(tokens[1]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] expect(tokens[2]).toEqual value: '$_', scopes: ['source.js', 'variable.other.property.js'] {tokens} = grammar.tokenizeLine('a()?.b()') expect(tokens[2]).toEqual value: ')', scopes: ['source.js', 'meta.function-call.js', 'meta.arguments.js', 'punctuation.definition.arguments.end.bracket.round.js'] expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.method-call.js', 'meta.delimiter.method.js'] - expect(tokens[4]).toEqual value: 'b', scopes: ['source.js', 'variable.other.property.js'] + expect(tokens[4]).toEqual value: 'b', scopes: ['source.js', 'meta.method-call.js', 'entity.name.function.js'] {tokens} = grammar.tokenizeLine('a()?.MY_CONSTANT') - expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'meta.function-call.js', 'enitity.name.function.js'] + expect(tokens[0]).toEqual value: 'a', scopes: ['source.js', 'meta.function-call.js', 'entity.name.function.js'] expect(tokens[3]).toEqual value: '?.', scopes: ['source.js', 'meta.delimiter.property.js'] expect(tokens[4]).toEqual value: 'MY_CONSTANT', scopes: ['source.js', 'constant.other.property.js'] From ad41b1d02f783de955a158b425cd4a7208bb80bf Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Thu, 12 Nov 2020 21:31:10 -0600 Subject: [PATCH 11/13] globalThis more consistent comment --- grammars/javascript.cson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/javascript.cson b/grammars/javascript.cson index 58f7b2a0..07d9b7f8 100644 --- a/grammars/javascript.cson +++ b/grammars/javascript.cson @@ -287,7 +287,7 @@ ] } { - # [.|?.]foo = function... + # [?].foo = function... 'begin': '(?=(\\.|\\?\\.)?[a-zA-Z_$][\\w$]*\\s*=\\s*(\\basync\\b\\s*)?\\bfunction\\b)' 'end': '(?<=})' 'patterns': [ @@ -1001,7 +1001,7 @@ } { 'match': '''(?x) (? Date: Fri, 13 Nov 2020 07:09:31 -0600 Subject: [PATCH 12/13] Don't need to do this but it's for consistency --- appveyor.yml | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7d07d05d..8ab396a6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,29 +1,6 @@ -version: "{build}" - -image: Visual Studio 2015 - -platform: x64 +build: off branches: - only: - - master - -clone_depth: 10 - -skip_tags: true - -environment: - APM_TEST_PACKAGES: - - matrix: - - ATOM_CHANNEL: stable - - ATOM_CHANNEL: beta - -install: - - ps: Install-Product node 4 - -build_script: - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1')) - -test: off -deploy: off + only: + - non-existing + From c0fb61c91571a0631835d55d103e1010eca80f11 Mon Sep 17 00:00:00 2001 From: steven nguyen <58114641+icecream17@users.noreply.github.com> Date: Fri, 13 Nov 2020 07:14:05 -0600 Subject: [PATCH 13/13] Useless consistency --- grammars/javascript.cson | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/grammars/javascript.cson b/grammars/javascript.cson index 07d9b7f8..248c1e2c 100644 --- a/grammars/javascript.cson +++ b/grammars/javascript.cson @@ -288,7 +288,7 @@ } { # [?].foo = function... - 'begin': '(?=(\\.|\\?\\.)?[a-zA-Z_$][\\w$]*\\s*=\\s*(\\basync\\b\\s*)?\\bfunction\\b)' + 'begin': '(?=(\\?\\.|\\.)?[a-zA-Z_$][\\w$]*\\s*=\\s*(\\basync\\b\\s*)?\\bfunction\\b)' 'end': '(?<=})' 'patterns': [ { @@ -303,7 +303,7 @@ 'name': 'meta.function.js' 'patterns': [ { - 'match': '(\\.|\\?\\.)?([a-zA-Z_$][\\w$]*)\\s*(=)\\s*' + 'match': '(\\?\\.|\\.)?([a-zA-Z_$][\\w$]*)\\s*(=)\\s*' 'captures': '1': 'name': 'meta.delimiter.method.js' @@ -539,7 +539,7 @@ # [.|?.]foo = ... => ... 'begin': '''(?x) (?= - (\\.|\\?\\.)?[a-zA-Z_$][\\w$]* + (\\?\\.|\\.)?[a-zA-Z_$][\\w$]* \\s*(=)\\s* ((\\(([^\\(\\)]*)?\\))|[\\w$]+) \\s*=> @@ -549,8 +549,8 @@ (?<=})| ((?! \\s*{| - \\G(\\.|\\?\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*\\(| - \\G(\\.|\\?\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*[\\w$]+| + \\G(\\?\\.|\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*\\(| + \\G(\\?\\.|\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*[\\w$]+| \\s*/\\*|\\s*// )(?=\\s*\\S)) ''' @@ -567,7 +567,7 @@ 'name': 'meta.function.arrow.js' 'patterns': [ { - 'match': '\\G(\\.|\\?\\.)?([a-zA-Z_$][\\w$]*)\\s*(=)' + 'match': '\\G(\\?\\.|\\.)?([a-zA-Z_$][\\w$]*)\\s*(=)' 'captures': '1': 'name': 'meta.delimiter.method.js' @@ -732,7 +732,7 @@ 'name': 'entity.name.type.instance.js' 'patterns': [ { - 'match': '\\.|\\?\\.' + 'match': '\\?\\.|\\.' 'name': 'meta.delimiter.property.js' } ] @@ -746,7 +746,7 @@ 'name': 'entity.name.type.object.console.js' 'end': '''(?x) (?<=\\)) | (?= - (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\.|\\?\\.)\\s* + (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\?\\.|\\.)\\s* (assert|clear|debug|error|info|log|profile|profileEnd|time|timeEnd|warn) \\s*\\( )) \\s*\\S @@ -757,7 +757,7 @@ 'include': '#comments' } { - 'begin': '\\s*(\\.|\\?\\.)\\s*(\\w+)\\s*(?=\\()' + 'begin': '\\s*(\\?\\.|\\.)\\s*(\\w+)\\s*(?=\\()' 'beginCaptures': '1': 'name': 'meta.delimiter.method.js' @@ -782,7 +782,7 @@ 'end': '''(?x) (?<=E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2|\\) ) | (?= - (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\.|\\?\\.)\\s* ( + (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\?\\.|\\.)\\s* ( ((abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp| expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random| round|sign|sin|sinh|sqrt|tan|tanh|trunc)\\s*\\( @@ -796,7 +796,7 @@ } { # Math.random() - 'begin': '\\s*(\\.|\\?\\.)\\s*(\\w+)\\s*(?=\\()' + 'begin': '\\s*(\\?\\.|\\.)\\s*(\\w+)\\s*(?=\\()' 'beginCaptures': '1': 'name': 'meta.delimiter.method.js' @@ -812,7 +812,7 @@ } { # Math.PI - 'match': '\\s*(\\.|\\?\\.)\\s*(\\w+)\\b' + 'match': '\\s*(\\?\\.|\\.)\\s*(\\w+)\\b' 'captures': '1': 'name': 'meta.delimiter.property.js' @@ -829,7 +829,7 @@ 'name': 'support.class.promise.js' 'end': '''(?x) (?<=\\)) | (?= - (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\.|\\?\\.)\\s*(all|race|reject|resolve)\\s*\\() )\\s*\\S + (?! (\\s*//)|(\\s*/\\*)|(\\s*(\\?\\.|\\.)\\s*(all|race|reject|resolve)\\s*\\() )\\s*\\S ) ''' 'patterns': [ @@ -838,7 +838,7 @@ } { # Promise.all() - 'begin': '\\s*(\\.|\\?\\.)\\s*(\\w+)\\s*(?=\\()' + 'begin': '\\s*(\\?\\.|\\.)\\s*(\\w+)\\s*(?=\\()' 'beginCaptures': '1': 'name': 'meta.delimiter.method.js' @@ -986,7 +986,7 @@ 'name': 'support.class.js' } { - 'match': '''(?x) (\\.|\\?\\.) \\s* (?: + 'match': '''(?x) (\\?\\.|\\.) \\s* (?: (constructor|length|prototype) | (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY) )\\b @@ -1071,7 +1071,7 @@ 'name': 'support.class.dom.js' } { - 'match': '''(?x) (\\.|\\?\\.) \\s* + 'match': '''(?x) (\\?\\.|\\.) \\s* (?: (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR @@ -1645,7 +1645,7 @@ 'patterns': [ { # [?].methodCall(arg1, "arg2", [...]) - 'begin': '(\\.|\\?\\.)\\s*([\\w$]+)\\s*(?=\\()' + 'begin': '(\\?\\.|\\.)\\s*([\\w$]+)\\s*(?=\\()' 'beginCaptures': '1': 'name': 'meta.delimiter.method.js' @@ -1791,12 +1791,12 @@ 'patterns': [ { # OBJ in OBJ.prop, OBJ.methodCall() - 'match': '[A-Z][A-Z0-9_$]*(?=\\s*(\\.|\\?\\.)\\s*[a-zA-Z_$]\\w*)' + 'match': '[A-Z][A-Z0-9_$]*(?=\\s*(\\?\\.|\\.)\\s*[a-zA-Z_$]\\w*)' 'name': 'constant.other.object.js' } { # obj in obj.prop, obj.methodCall() - 'match': '[a-zA-Z_$][\\w$]*(?=\\s*(\\.|\\?\\.)\\s*[a-zA-Z_$]\\w*)' + 'match': '[a-zA-Z_$][\\w$]*(?=\\s*(\\?\\.|\\.)\\s*[a-zA-Z_$]\\w*)' 'name': 'variable.other.object.js' } ] @@ -1805,7 +1805,7 @@ # object.prop means (object.prop OR object?.prop) in this square bracket { # PROP1 in obj.PROP1.prop2, func().PROP1.prop2 - 'match': '(\\.|\\?\\.)\\s*([A-Z][A-Z0-9_$]*\\b\\$*)(?=\\s*(\\.|\\?\\.)\\s*[a-zA-Z_$]\\w*)' + 'match': '(\\?\\.|\\.)\\s*([A-Z][A-Z0-9_$]*\\b\\$*)(?=\\s*(\\?\\.|\\.)\\s*[a-zA-Z_$]\\w*)' 'captures': '1': 'name': 'meta.delimiter.property.js' @@ -1814,7 +1814,7 @@ } { # prop1 in obj.prop1.prop2, func().prop1.prop2 - 'match': '(\\.|\\?\\.)\\s*(\\$*[a-zA-Z_$][\\w$]*)(?=\\s*(\\.|\\?\\.)\\s*[a-zA-Z_$]\\w*)' + 'match': '(\\?\\.|\\.)\\s*(\\$*[a-zA-Z_$][\\w$]*)(?=\\s*(\\?\\.|\\.)\\s*[a-zA-Z_$]\\w*)' 'captures': '1': 'name': 'meta.delimiter.property.js' @@ -1823,7 +1823,7 @@ } { # PROP in obj.PROP, func().PROP - 'match': '(\\.|\\?\\.)\\s*([A-Z][A-Z0-9_$]*\\b\\$*)' + 'match': '(\\?\\.|\\.)\\s*([A-Z][A-Z0-9_$]*\\b\\$*)' 'captures': '1': 'name': 'meta.delimiter.property.js' @@ -1832,7 +1832,7 @@ } { # prop in obj.prop, func().prop - 'match': '(\\.|\\?\\.)\\s*(\\$*[a-zA-Z_$][\\w$]*)' + 'match': '(\\?\\.|\\.)\\s*(\\$*[a-zA-Z_$][\\w$]*)' 'captures': '1': 'name': 'meta.delimiter.property.js' @@ -1841,7 +1841,7 @@ } { # 123illegal in obj.123illegal, func().123illegal - 'match': '(\\.|\\?\\.)\\s*([0-9][\\w$]*)' + 'match': '(\\?\\.|\\.)\\s*([0-9][\\w$]*)' 'captures': '1': 'name': 'meta.delimiter.property.js'