Skip to content

Commit

Permalink
πŸ›[yml] Fix tags icon & golds
Browse files Browse the repository at this point in the history
  • Loading branch information
Coyote-31 committed Dec 16, 2020
1 parent 16e6695 commit 0b3b63a
Show file tree
Hide file tree
Showing 4 changed files with 19,539 additions and 18,135 deletions.
19 changes: 13 additions & 6 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,23 @@ module.exports = grammar({
$.localization_string,
$._localization_formatting,
$._localization_scope,
$._localization_icon,
alias(token.immediate('Β€'), $.localization_gold),
alias(token.immediate(/\\[n\\\"]/), $.localization_color),
alias(token.immediate(/\#/), $.formatting_boundary),
alias(token.immediate(/\#Channel[a-zA-Z\/]+/), $.formatting_boundary),
alias(token.immediate(/Β§[WBGRbglYMO!]*/), $.localization_color),
token.immediate(/[^\[\[\\$Β§"\#\r\n]+/)
alias(token.immediate(/Β§[a-zA-Z!]/), $.localization_color),
token.immediate(/[^\[\[\\$§£€\"\#\r\n]+/)
)),
token.immediate('"'),
)),

_localization_icon: $ => prec.right(seq(
alias(token.immediate('Β£'), $.formatting_boundary),
alias(token.immediate(/[A-Za-z0-9_]+/), $.formatting_icon),
optional(alias(token.immediate('Β£'), $.formatting_boundary))
)),

_localization_scope: $ => seq(
alias(token.immediate(/\[/), $.formatting_boundary),
alias(token.immediate(seq(
Expand All @@ -133,10 +141,9 @@ module.exports = grammar({
_localization_formatting: $ => seq(
alias(token.immediate('$'), $.formatting_boundary),
alias(token.immediate(/[A-Za-z0-9_]+/), $.formatting_variable),
repeat(seq(
optional(seq(
alias(token.immediate('|'), $.formatting_delimiter),
optional($.formatting_rule),
optional(alias(token.immediate(/Β§[WBGRbglYMO!]*/), $.localization_color),)
optional($.formatting_rule)
)),
alias(token.immediate('$'), $.formatting_boundary)
),
Expand All @@ -146,7 +153,7 @@ module.exports = grammar({
'*',
'=',
/[0-9]/,
/[WBGRbgYH]/,
/[a-zA-Z]/,
'+',
'-'
))),
Expand Down
154 changes: 104 additions & 50 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,22 @@
"type": "SYMBOL",
"name": "_localization_scope"
},
{
"type": "SYMBOL",
"name": "_localization_icon"
},
{
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "Β€"
}
},
"named": true,
"value": "localization_gold"
},
{
"type": "ALIAS",
"content": {
Expand Down Expand Up @@ -374,7 +390,7 @@
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "Β§[WBGRbglYMO!]*"
"value": "Β§[a-zA-Z!]"
}
},
"named": true,
Expand All @@ -384,7 +400,7 @@
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "[^\\[\\[\\\\$Β§\"\\#\\r\\n]+"
"value": "[^\\[\\[\\\\$§£€\\\"\\#\\r\\n]+"
}
}
]
Expand All @@ -400,6 +416,59 @@
]
}
},
"_localization_icon": {
"type": "PREC_RIGHT",
"value": 0,
"content": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "Β£"
}
},
"named": true,
"value": "formatting_boundary"
},
{
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "[A-Za-z0-9_]+"
}
},
"named": true,
"value": "formatting_icon"
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "Β£"
}
},
"named": true,
"value": "formatting_boundary"
},
{
"type": "BLANK"
}
]
}
]
}
},
"_localization_scope": {
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -490,56 +559,41 @@
"value": "formatting_variable"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "IMMEDIATE_TOKEN",
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "STRING",
"value": "|"
}
},
"named": true,
"value": "formatting_delimiter"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "formatting_rule"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "ALIAS",
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "Β§[WBGRbglYMO!]*"
}
},
"named": true,
"value": "localization_color"
"type": "STRING",
"value": "|"
}
},
{
"type": "BLANK"
}
]
}
]
}
"named": true,
"value": "formatting_delimiter"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "formatting_rule"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
Expand Down Expand Up @@ -580,7 +634,7 @@
},
{
"type": "PATTERN",
"value": "[WBGRbgYH]"
"value": "[a-zA-Z]"
},
{
"type": "STRING",
Expand Down
16 changes: 16 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
"type": "formatting_delimiter",
"named": true
},
{
"type": "formatting_icon",
"named": true
},
{
"type": "formatting_rule",
"named": true
Expand All @@ -163,6 +167,10 @@
"type": "localization_color",
"named": true
},
{
"type": "localization_gold",
"named": true
},
{
"type": "localization_string",
"named": true
Expand Down Expand Up @@ -355,6 +363,10 @@
"type": "formatting_delimiter",
"named": true
},
{
"type": "formatting_icon",
"named": true
},
{
"type": "formatting_variable",
"named": true
Expand Down Expand Up @@ -383,6 +395,10 @@
"type": "localization_color",
"named": true
},
{
"type": "localization_gold",
"named": true
},
{
"type": "localization_language_name",
"named": true
Expand Down
Loading

1 comment on commit 0b3b63a

@Coyote-31
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix #5

Please sign in to comment.