Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JavaScript] Meta Numbers #2463

Merged
merged 7 commits into from
Sep 16, 2020
Merged

Conversation

deathaxe
Copy link
Collaborator

This PR is a proposal created from the latest discussion at #2460

It is to illustrate what it means to add meta.number scopes. It means to add one or up to 1 (2) additional capture groups per match pattern to assign meta.numbers.[base|value|suffix]. The complexity is the same for applying meta.numbers on top of below constant.numeric.

Note: It also contains the older more complex solutions for comparison.

DeathAxe and others added 4 commits August 25, 2020 18:07
This commit replaces the `punctuation.definition.numeric` and `storage.type.numeric` by `meta.number.[base|type]` scope.
Instead of using `mantissa` for integers, the more general `value` is
used. The scope scheme was updated to:

meta
  number
    sign
    base
    value
      mantissa
      exponent
    type
    unit
This commit moves the capture group of the `dec_exponent` from the
variable definition to the match rule in order to give PackageDev a
chance to highlight all capture groups of the match correctly.
1. Removes `mantissa` and `exponent` sub scopes.
2. Renames `type` to `suffix`
Applies `meta.number.<type> constant.numeric.[base|value|suffix]`
@wbond
Copy link
Member

wbond commented Sep 16, 2020

Looks like there are some test failures also

@deathaxe
Copy link
Collaborator Author

I somehow need a way to run all test cases locally on my windows machine. It's not the first time I miss to update some test files.

@wbond
Copy link
Member

wbond commented Sep 16, 2020

You don't use the build variant to run all tests?

@wbond wbond merged commit 558e49b into sublimehq:master Sep 16, 2020
@deathaxe
Copy link
Collaborator Author

It does just freeze ST but nothing else. I therefore even removed it from command palette, because I got sick of killing ST when hitting it by accident.

It is meant to run all syntax test files it finds? My impression was it just tries to run all syntaxes against the single file or something like that.

@deathaxe deathaxe deleted the pr/javascript/meta-numbers branch September 16, 2020 18:42
mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
* [JavaScript] Add meta.number

This commit replaces the `punctuation.definition.numeric` and `storage.type.numeric` by `meta.number.[base|type]` scope.

* [JavaScript] Add meta.number.value

Instead of using `mantissa` for integers, the more general `value` is
used. The scope scheme was updated to:

meta
  number
    sign
    base
    value
      mantissa
      exponent
    type
    unit

* [JavaScript] Move float exponent capture groups

This commit moves the capture group of the `dec_exponent` from the
variable definition to the match rule in order to give PackageDev a
chance to highlight all capture groups of the match correctly.

* [JavaScript] Simplify meta.number scopes

1. Removes `mantissa` and `exponent` sub scopes.
2. Renames `type` to `suffix`

* [JavaScript] Update meta.number scopes

Applies `meta.number.<type> constant.numeric.[base|value|suffix]`

* [JavaScript] Move meta.number to common scope directive

* [JavaScript] Update test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants