Skip to content

Commit

Permalink
Much better Rust
Browse files Browse the repository at this point in the history
Huge thanks to @Geobert for contribution
  • Loading branch information
EvgeniyPeshkov committed May 27, 2019
1 parent b1eb4a8 commit fe2c104
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Syntax Highlighter Change Log

## **Version 0.2.3**
#### Much better Rust
Huge thanks to [@Geobert](https://github.com/Geobert) for contribution.


## **Version 0.2.2**
#### New programming languages:
* Rust
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ of Node.js. Refer to [BUILD.md](BUILD.md) for instructions.
## [Contribute](CONTRIBUTE.md)

The best way to contribute is to implement support of new languages. Extension
improvements are also welcome. The first thing on ToDo list is to improve
[distribution and packaging](#distribution) which are complicated by native
modules. Refer to [CONTRIBUTE.md](CONTRIBUTE.md) for details.
improvements are also welcome. Refer to [CONTRIBUTE.md](CONTRIBUTE.md) for details.

## [ToDo](TODO.md)
51 changes: 35 additions & 16 deletions grammars/rust.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"simpleTerms": {

"type_identifier": "type",
"primitive_type": "type",

"attribute_item": "variable",
// "attribute_item": "variable",
"inner_attribute_item": "variable",
"shorthand_field_identifier": "variable",

Expand Down Expand Up @@ -56,7 +55,6 @@

".": "keyword_operator",
"->": "keyword_operator",
"*": "keyword_operator",
"-": "keyword_operator",
"+": "keyword_operator",
"/": "keyword_operator",
Expand Down Expand Up @@ -94,38 +92,47 @@
"as": "keyword_operator",

"use": "keyword_directive",
"#": "keyword_directive",

";": "punctuation",
":": "punctuation",
",": "punctuation",
"[": "punctuation",
"]": "punctuation",
"{": "punctuation",
"}": "punctuation",
"(": "punctuation",
")": "punctuation",
},

"complexTerms": ["identifier", "field_identifier", "self", "super", "crate"],
"complexTerms": [
"identifier", "field_identifier", "type_identifier",
"self", "super", "crate",
"(", ")", "[", "]", "*"],

"complexScopes": {
"use_wildcard > identifier[0]": "type",
"scoped_type_identifier > identifier": "type",
"scoped_type_identifier > scoped_identifier > identifier": "type",
"scoped_identifier > identifier": "type",
"scoped_identifier > scoped_identifier > identifier": "type",
"type_identifier": "type",
"scoped_type_identifier > type_identifier": "type",
"scoped_identifier > identifier[-1]": "type",
"use_declaration > identifier": "type",
"use_declaration > scoped_identifier > identifier": "type",
"use_list > identifier": "type",
"use_list > scoped_identifier > identifier": "type",
"meta_item > identifier": "type",
"use_wildcard > *": "type",
"use_as_clause > identifier": "type",
"tuple_struct_pattern > identifier": "type",
"enum_variant > identifier": "type",

"scoped_identifier > identifier": "namespace",
"scoped_type_identifier > identifier": "namespace",
"scoped_type_identifier > scoped_identifier > identifier": "namespace",
"scoped_identifier > scoped_identifier > identifier": "namespace",
"scoped_use_list > scoped_identifier > identifier": "namespace",
"scoped_use_list > identifier": "namespace",
"use_wildcard > scoped_identifier > identifier": "namespace",
"use_wildcard > identifier": "namespace",
"struct_pattern > scoped_type_identifier > identifier": "namespace",
"struct_expression > scoped_type_identifier > identifier": "namespace",

"identifier": "variable",
"field_identifier": "variable",
"self": "variable",
"super": "variable",
"scoped_identifier > identifier[-1]": "variable",

"call_expression > identifier": "function",
"call_expression > field_expression > field_identifier[-1]": "function",
Expand All @@ -140,6 +147,8 @@

"lifetime > identifier": "storage_modifier",

"meta_item > identifier": "keyword_directive",

"use_list > self": "keyword_operator",
"scoped_use_list > self": "keyword_operator",
"scoped_identifier > self": "keyword_operator",
Expand All @@ -150,6 +159,16 @@
"scoped_use_list > super": "keyword_operator",
"scoped_identifier > super": "keyword_operator",

"*": "keyword_operator",
"(": "punctuation",
")": "punctuation",
"[": "punctuation",
"]": "punctuation",
"unit_expression > (": "keyword_constant",
"unit_expression > )": "keyword_constant",
"attribute_item > [": "keyword_directive",
"attribute_item > ]": "keyword_directive",

},

}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Syntax Highlighter",
"description": "Syntax highlighting based on Tree-sitter",
"homepage": "https://github.com/EvgeniyPeshkov/syntax-highlighter",
"version": "0.2.2",
"version": "0.2.3",
"publisher": "evgeniypeshkov",
"license": "MIT",
"icon": "images/syntax.png",
Expand Down

0 comments on commit fe2c104

Please sign in to comment.