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

Regenerate token patterns + update style properties #434

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions grammars/renpy.grammar.ebnf
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ IMAGE_NAME_COMPONENT = WORD_CHAR+;
IMAGE_NAME = WHITESPACE.IMAGE_NAME_COMPONENT+;

STYLE_PROPERTY_PREFIX = ["selected_"], [("hover_" | "idle_" | "insensitive_" | "activate_")];
STYLE_PROPERTY = "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";
STYLE_PROPERTY = "activate_sound" | "adjust_spacing" | "aft_bar" | "aft_gutter" | "alt" | "altruby_style" | "antialias" | "axis" | "background" | "bar_invert"
| "bar_resizing" | "unscrollable" | "bar_vertical" | "black_color" | "bold" | "bottom_margin" | "bottom_padding" | "box_layout" | "box_reverse" | "box_wrap"
| "box_wrap_spacing" | "caret" | "child" | "clipping" | "color" | "debug" | "drop_shadow" | "drop_shadow_color" | "emoji_font" | "extra_alt" | "first_indent"
| "first_spacing" | "fit_first" | "focus_mask" | "focus_rect" | "font" | "fore_bar" | "fore_gutter" | "foreground" | "group_alt" | "hinting" | "hover_sound"
| "hyperlink_functions" | "italic" | "instance" | "justify" | "kerning" | "key_events" | "keyboard_focus" | "language" | "layout" | "line_leading" | "left_margin"
| "line_overlap_split" | "left_padding" | "line_spacing" | "mouse" | "modal" | "min_width" | "mipmap" | "newline_indent" | "order_reverse" | "outlines"
| "outline_scaling" | "prefer_emoji" | "rest_indent" | "right_margin" | "right_padding" | "ruby_line_leading" | "ruby_style" | "shaper" | "size" | "size_group"
| "slow_abortable" | "slow_cps" | "slow_cps_multiplier" | "spacing" | "strikethrough" | "subtitle_width" | "subpixel" | "text_y_fudge" | "text_align" | "thumb"
| "thumb_offset" | "thumb_shadow" | "time_policy" | "top_margin" | "top_padding" | "underline" | "vertical" | "xanchor" | "xfill" | "xfit" | "xmaximum"
| "xminimum" | "xoffset" | "xpos" | "xspacing" | "yanchor" | "yfill" | "yfit" | "ymaximum" | "yminimum" | "yoffset" | "ypos" | "yspacing" | "margin"
| "xmargin" | "ymargin" | "xalign" | "yalign" | "padding" | "xpadding" | "ypadding" | "minwidth" | "textalign" | "slow_speed" | "enable_hover" | "left_gutter"
| "right_gutter" | "top_gutter" | "bottom_gutter" | "left_bar" | "right_bar" | "top_bar" | "bottom_bar" | "base_bar" | "box_spacing" | "box_first_spacing"
| "pos" | "anchor" | "offset" | "align" | "maximum" | "minimum" | "xsize" | "ysize" | "xysize" | "area" | "xcenter" | "ycenter" | "xycenter";
STYLE_PROPERTY_NAME = "properties" | (STYLE_PROPERTY_PREFIX?, STYLE_PROPERTY);

PYTHON_EXPRESSION = ? any valid Python expression ?;
Expand Down
40 changes: 20 additions & 20 deletions src/tokenizer/atl-token-patterns.g.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// THIS FILE HAS BEEN GENERATED BY THE `syntax-to-token-pattern.py` GENERATOR
// DO NOT EDIT THIS FILE DIRECTLY! INSTEAD RUN THE PYTHON SCRIPT.
// ANY MANUAL EDITS MADE TO THIS FILE WILL BE OVERWRITTEN. YOU HAVE BEEN WARNED.
// Last generated: 14/07/2024 12:28:58 (UTC+0)
// Last generated: 07/08/2024 16:42:09 (UTC+0)

import { KeywordTokenType, EntityTokenType, MetaTokenType, CharacterTokenType } from "./renpy-tokens";
import { TokenPattern } from "./token-pattern-types";
Expand Down Expand Up @@ -35,91 +35,91 @@ export const atlBuildInProperties: TokenPattern = {
debugName: "atlBuildInProperties.patterns![1]",

// position props (int, absolute, or a float)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:xpos|ypos|xanchor|yanchor|xcenter|ycenter|radius)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![2]",

// position pair props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:pos|anchor|xycenter|around|alignaround|matrixanchor)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![3]",

// float props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:xalign|yalign|zoom|xzoom|yzoom|alpha|additive|angle|delay|events|zpos)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![4]",

// float pair props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:align|knot)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![5]",

// int props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:xoffset|yoffset|xtile|ytile)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![6]",

// int pair props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:offset)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![7]",

// boolean props
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:rotate_pad|transform_anchor|nearest|crop_relative|subpixel|zzoom)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![8]",

// ('#float' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:rotate|xpan|ypan|blur)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![9]",

// ('#position' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:xsize|ysize)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![10]",

// ('\(int, int, int, int\)' | '\(float, float, float, float\)' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:crop)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![11]",

// ('\(int, int\)' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:corner1|corner2)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![12]",

// ('\(position, position\)' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:xysize)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![13]",

// ('#string' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:fit)\b/g,
},
{
Expand All @@ -133,21 +133,21 @@ export const atlBuildInProperties: TokenPattern = {
debugName: "atlBuildInProperties.patterns![15]",

// ('#Matrix' | '#MatrixColor' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:matrixcolor)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![16]",

// ('#Matrix' | '#TransformMatrix' | None)
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:matrixtransform)\b/g,
},
{
debugName: "atlBuildInProperties.patterns![17]",

// ('#bool' | '#float' | '\(float, float, float\)')
token: EntityTokenType.TagName, /*support.type.property-name.transform.renpy entity.name.tag.css.transform.renpy*/
token: EntityTokenType.TagName, /*entity.other.attribute-name.atl.renpy support.type.property-name.atl.renpy entity.name.tag.css.atl.renpy*/
match: /\b(?<!\.)(?:perspective)\b/g,
},
]
Expand Down Expand Up @@ -295,7 +295,7 @@ export const atlOn: TokenPattern = {
contentToken: MetaTokenType.ATLOnParameters, /*meta.atl.on.parameters.renpy*/
begin: /(?<=^[ \t]*)(on)\b[ \t]*/dgm,
beginCaptures: {
1: { token: KeywordTokenType.On, /*keyword.on.renpy*/ },
1: { token: KeywordTokenType.On, /*keyword.control.flow.on.renpy*/ },
},
end: /(?=#|:)|$/gm,
patterns: [
Expand Down Expand Up @@ -450,7 +450,7 @@ export const transform: TokenPattern = {

token: MetaTokenType.TransformStatement, /*meta.transform.statement.renpy*/
contentToken: MetaTokenType.TransformParameters, /*meta.transform.parameters.renpy*/
begin: /(?<=^[ \t]*)(transform)\b[ \t]*/dgm,
begin: /(?<=^[ \t]*)(transform)\b/dgm,
beginCaptures: {
1: { token: KeywordTokenType.Transform, /*keyword.transform.renpy*/ },
},
Expand All @@ -459,7 +459,7 @@ export const transform: TokenPattern = {
{
debugName: "transform.patterns![0]",

token: EntityTokenType.Identifier, /*variable.name.transform.renpy*/
token: EntityTokenType.TransformName, /*entity.name.type.transform.renpy*/
match: /\b([a-zA-Z_]\w*)\b/g,
},
]
Expand Down
Loading
Loading