-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update style based on grammar definition Add missing `properties` style property
- Loading branch information
Showing
4 changed files
with
126 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"information_for_contributors": [ "Please remember to regenerate the ts token patterns using the 'syntax-to-token-pattern.py' python script" ], | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "Ren'Py Style", | ||
"scopeName": "source.renpy.style", | ||
"patterns": [ { "include": "#style" } ], | ||
"repository": { | ||
"style-block-tester": { | ||
"patterns": [ | ||
{ | ||
"contentName": "meta.style-block.renpy", | ||
"begin": "(?<=(^[ \\t]*)(?:style)\\b.*?)(:)", | ||
"beginCaptures": { | ||
"2": { "name": "punctuation.section.style.begin.renpy" } | ||
}, | ||
"end": "^(?=(?!\\1)[ \\t]*[^\\s#]|\\1[^\\s#])", | ||
"patterns": [ | ||
{ "include": "#style-clause" }, | ||
{ "include": "source.renpy#fallback-patterns" } | ||
] | ||
} | ||
] | ||
}, | ||
|
||
"style-property": { | ||
"patterns": [ | ||
{ | ||
"comment": "ON EDIT: If you update this list, also update it in style-clause", | ||
"name": "support.constant.property-key.test.renpy entity.name.tag.css.style.renpy", | ||
"match": "\\b(?<!\\.)(?:(?:selected_)?(?:hover_|idle_|insensitive_|activate_)?(?:activate_sound|adjust_spacing|aft_bar|aft_gutter|align|alt|altruby_style|anchor|antialias|area|background|bar_invert|bar_resizing|bar_vertical|base_bar|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_first_spacing|box_layout|box_reverse|box_spacing|box_wrap|box_wrap_spacing|caret|child|clipping|color|debug|drop_shadow|drop_shadow_color|enable_hover|first_indent|first_spacing|fit_first|focus_mask|focus_rect|font|fore_bar|fore_gutter|foreground|hinting|hover_sound|hyperlink_functions|italic|justify|kerning|key_events|keyboard_focus|language|layout|left_bar|left_gutter|left_margin|left_padding|line_leading|line_overlap_split|line_spacing|margin|maximum|min_width|minimum|minwidth|mipmap|modal|mouse|newline_indent|offset|order_reverse|outline_scaling|outlines|padding|pos|rest_indent|right_bar|right_gutter|right_margin|right_padding|ruby_style|size|size_group|slow_abortable|slow_cps|slow_cps_multiplier|slow_speed|sound|spacing|strikethrough|subpixel|subtitle_width|text_align|text_y_fudge|textalign|thumb|thumb_offset|thumb_shadow|time_policy|top_bar|top_gutter|top_margin|top_padding|underline|unscrollable|vertical|xalign|xanchor|xcenter|xfill|xfit|xmargin|xmaximum|xminimum|xoffset|xpadding|xpos|xsize|xspacing|xysize|yalign|yanchor|ycenter|yfill|yfit|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|yspacing))\\b" | ||
}, | ||
{ | ||
"name": "support.constant.property-key.renpy entity.name.tag.css.style.renpy", | ||
"match": "\\b(?<!\\.)(?:properties)\\b" | ||
}, | ||
{ | ||
"comment": "Any other tokens are invalid", | ||
"match": ".+", | ||
"name": "invalid.illegal.style-property.name.renpy" | ||
} | ||
] | ||
}, | ||
|
||
"style-clause": { | ||
"patterns": [ | ||
{ | ||
"match": "\\b(?<!\\.)(is)\\b[ \\t]*(\\w*)", | ||
"captures": { | ||
"1": { "name": "keyword.is.renpy keyword.operator.logical.is.renpy" }, | ||
"2": { "name": "entity.name.type.style.parent.renpy" } | ||
} | ||
}, | ||
{ | ||
"match": "\\b(?<!\\.)clear\\b", | ||
"name": "keyword.clear.renpy" | ||
}, | ||
{ | ||
"match": "\\b(?<!\\.)(take)\\b[ \\t]*(\\w*)", | ||
"captures": { | ||
"1": { "name": "keyword.take.renpy" }, | ||
"2": { "patterns": [ { "include": "source.renpy#name" } ] } | ||
} | ||
}, | ||
{ | ||
"match": "\\b(?<!\\.)(del)\\b[ \\t]*(\\w*)", | ||
"captures": { | ||
"1": { "name": "keyword.del.renpy" }, | ||
"2": { "patterns": [ { "include": "#style-property" } ] } | ||
} | ||
}, | ||
{ | ||
"begin": "\\b(?<!\\.)(variant)\\b", | ||
"end": "(?!\\G)", | ||
"beginCaptures": { | ||
"1": { "name": "keyword.variant.renpy" } | ||
}, | ||
"patterns": [ { "include": "source.renpy#simple-expression" } ] | ||
}, | ||
{ | ||
"comment": "ON EDIT: If you update this list, also update it in style-property", | ||
"begin": "\\b(?<!\\.)(properties|(?:(?:selected_)?(?:hover_|idle_|insensitive_|activate_)?(?:activate_sound|adjust_spacing|aft_bar|aft_gutter|align|alt|altruby_style|anchor|antialias|area|background|bar_invert|bar_resizing|bar_vertical|base_bar|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_first_spacing|box_layout|box_reverse|box_spacing|box_wrap|box_wrap_spacing|caret|child|clipping|color|debug|drop_shadow|drop_shadow_color|enable_hover|first_indent|first_spacing|fit_first|focus_mask|focus_rect|font|fore_bar|fore_gutter|foreground|hinting|hover_sound|hyperlink_functions|italic|justify|kerning|key_events|keyboard_focus|language|layout|left_bar|left_gutter|left_margin|left_padding|line_leading|line_overlap_split|line_spacing|margin|maximum|min_width|minimum|minwidth|mipmap|modal|mouse|newline_indent|offset|order_reverse|outline_scaling|outlines|padding|pos|rest_indent|right_bar|right_gutter|right_margin|right_padding|ruby_style|size|size_group|slow_abortable|slow_cps|slow_cps_multiplier|slow_speed|sound|spacing|strikethrough|subpixel|subtitle_width|text_align|text_y_fudge|textalign|thumb|thumb_offset|thumb_shadow|time_policy|top_bar|top_gutter|top_margin|top_padding|underline|unscrollable|vertical|xalign|xanchor|xcenter|xfill|xfit|xmargin|xmaximum|xminimum|xoffset|xpadding|xpos|xsize|xspacing|xysize|yalign|yanchor|ycenter|yfill|yfit|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|yspacing)))\\b", | ||
"end": "(?!\\G)", | ||
"beginCaptures": { | ||
"1": { "name": "support.constant.property-key.renpy entity.name.tag.css.style.renpy" } | ||
}, | ||
"patterns": [ { "include": "source.renpy#simple-expression" } ] | ||
} | ||
] | ||
}, | ||
|
||
"style": { | ||
"comment": "See https://www.renpy.org/doc/html/styles.html", | ||
"name": "meta.style.statement.renpy", | ||
"contentName": "meta.style.parameters.renpy", | ||
"begin": "(?<=^[ \\t]*)(style)\\b", | ||
"beginCaptures": { | ||
"1": { "name": "storage.type.style.renpy" } | ||
}, | ||
"end": "$|^", | ||
|
||
"patterns": [ | ||
{ "include": "#style-clause" }, | ||
{ | ||
"name": "entity.name.type.style.renpy", | ||
"match": "\\b[\\p{XID_Start}_]\\p{XID_Continue}*\\b" | ||
}, | ||
{ "include": "#style-block-tester" }, | ||
{ "include": "source.renpy#fallback-patterns" } | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters