From ede55b2cef3e5bbeef495d675b3dc33756aa5e2d Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Tue, 5 Oct 2021 21:26:05 +0200 Subject: [PATCH] Renpy: Improved language + added tests (#3125) --- components/prism-renpy.js | 6 +- components/prism-renpy.min.js | 2 +- tests/languages/renpy/boolean_feature.test | 9 + tests/languages/renpy/comment_feature.test | 7 + tests/languages/renpy/function_feature.test | 43 ++ tests/languages/renpy/keyword_feature.test | 239 ++++++++++ tests/languages/renpy/property_feature.test | 469 ++++++++++++++++++++ tests/languages/renpy/string_feature.test | 29 ++ tests/languages/renpy/tag_feature.test | 75 ++++ 9 files changed, 874 insertions(+), 5 deletions(-) create mode 100644 tests/languages/renpy/boolean_feature.test create mode 100644 tests/languages/renpy/comment_feature.test create mode 100644 tests/languages/renpy/function_feature.test create mode 100644 tests/languages/renpy/keyword_feature.test create mode 100644 tests/languages/renpy/property_feature.test create mode 100644 tests/languages/renpy/string_feature.test create mode 100644 tests/languages/renpy/tag_feature.test diff --git a/components/prism-renpy.js b/components/prism-renpy.js index d543681bb2..dc0b02ecc0 100644 --- a/components/prism-renpy.js +++ b/components/prism-renpy.js @@ -1,13 +1,11 @@ Prism.languages.renpy = { - // TODO Write tests. - 'comment': { pattern: /(^|[^\\])#.+/, lookbehind: true }, 'string': { - pattern: /("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m, + pattern: /("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m, greedy: true }, @@ -17,7 +15,7 @@ Prism.languages.renpy = { 'tag': /\b(?:bar|block|button|buttoscreenn|drag|draggroup|fixed|frame|grid|[hv]box|hotbar|hotspot|image|imagebutton|imagemap|input|key|label|menu|mm_menu_frame|mousearea|nvl|parallel|screen|self|side|tag|text|textbutton|timer|vbar|viewport|window)\b|\$/, - 'keyword': /\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|window|yield)\b/, + 'keyword': /\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|yield)\b/, 'boolean': /\b(?:[Ff]alse|[Tt]rue)\b/, diff --git a/components/prism-renpy.min.js b/components/prism-renpy.min.js index 160c29dcc9..06bd925671 100644 --- a/components/prism-renpy.min.js +++ b/components/prism-renpy.min.js @@ -1 +1 @@ -Prism.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m,greedy:!0},function:/\b[a-z_]\w*(?=\()/i,property:/\b(?:Update|UpdateVersion|action|activate_sound|adv_nvl_transition|after_load_transition|align|alpha|alt|anchor|antialias|area|auto|background|bar_invert|bar_resizing|bar_vertical|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_reverse|box_wrap|can_update|caret|child|color|crop|default_afm_enable|default_afm_time|default_fullscreen|default_text_cps|developer|directory_name|drag_handle|drag_joined|drag_name|drag_raise|draggable|dragged|drop_shadow|drop_shadow_color|droppable|dropped|easein|easeout|edgescroll|end_game_transition|end_splash_transition|enter_replay_transition|enter_sound|enter_transition|enter_yesno_transition|executable_name|exit_replay_transition|exit_sound|exit_transition|exit_yesno_transition|fadein|fadeout|first_indent|first_spacing|fit_first|focus|focus_mask|font|foreground|game_main_transition|get_installed_packages|google_play_key|google_play_salt|ground|has_music|has_sound|has_voice|height|help|hinting|hover|hover_background|hover_color|hover_sound|hovered|hyperlink_functions|idle|idle_color|image_style|include_update|insensitive|insensitive_background|insensitive_color|inside|intra_transition|italic|justify|kerning|keyboard_focus|language|layer_clipping|layers|layout|left_bar|left_gutter|left_margin|left_padding|length|line_leading|line_overlap_split|line_spacing|linear|main_game_transition|main_menu_music|maximum|min_width|minimum|minwidth|modal|mouse|mousewheel|name|narrator_menu|newline_indent|nvl_adv_transition|offset|order_reverse|outlines|overlay_functions|pos|position|prefix|radius|range|rest_indent|right_bar|right_gutter|right_margin|right_padding|rotate|rotate_pad|ruby_style|sample_sound|save_directory|say_attribute_transition|screen_height|screen_width|scrollbars|selected_hover|selected_hover_color|selected_idle|selected_idle_color|selected_insensitive|show_side_image|show_two_window|side_spacing|side_xpos|side_ypos|size|size_group|slow_cps|slow_cps_multiplier|spacing|strikethrough|subpixel|text_align|text_style|text_xpos|text_y_fudge|text_ypos|thumb|thumb_offset|thumb_shadow|thumbnail_height|thumbnail_width|time|top_bar|top_gutter|top_margin|top_padding|translations|underline|unscrollable|update|value|version|version_name|version_tuple|vertical|width|window_hide_transition|window_icon|window_left_padding|window_show_transition|window_title|windows_icon|xadjustment|xalign|xanchor|xanchoraround|xaround|xcenter|xfill|xinitial|xmargin|xmaximum|xminimum|xoffset|xofsset|xpadding|xpos|xsize|xzoom|yadjustment|yalign|yanchor|yanchoraround|yaround|ycenter|yfill|yinitial|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|ysizexysize|yzoom|zoom|zorder)\b/,tag:/\b(?:bar|block|button|buttoscreenn|drag|draggroup|fixed|frame|grid|[hv]box|hotbar|hotspot|image|imagebutton|imagemap|input|key|label|menu|mm_menu_frame|mousearea|nvl|parallel|screen|self|side|tag|text|textbutton|timer|vbar|viewport|window)\b|\$/,keyword:/\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|window|yield)\b/,boolean:/\b(?:[Ff]alse|[Tt]rue)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:and|at|not|or|with)\b/,punctuation:/[{}[\];(),.:]/},Prism.languages.rpy=Prism.languages.renpy; \ No newline at end of file +Prism.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m,greedy:!0},function:/\b[a-z_]\w*(?=\()/i,property:/\b(?:Update|UpdateVersion|action|activate_sound|adv_nvl_transition|after_load_transition|align|alpha|alt|anchor|antialias|area|auto|background|bar_invert|bar_resizing|bar_vertical|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_reverse|box_wrap|can_update|caret|child|color|crop|default_afm_enable|default_afm_time|default_fullscreen|default_text_cps|developer|directory_name|drag_handle|drag_joined|drag_name|drag_raise|draggable|dragged|drop_shadow|drop_shadow_color|droppable|dropped|easein|easeout|edgescroll|end_game_transition|end_splash_transition|enter_replay_transition|enter_sound|enter_transition|enter_yesno_transition|executable_name|exit_replay_transition|exit_sound|exit_transition|exit_yesno_transition|fadein|fadeout|first_indent|first_spacing|fit_first|focus|focus_mask|font|foreground|game_main_transition|get_installed_packages|google_play_key|google_play_salt|ground|has_music|has_sound|has_voice|height|help|hinting|hover|hover_background|hover_color|hover_sound|hovered|hyperlink_functions|idle|idle_color|image_style|include_update|insensitive|insensitive_background|insensitive_color|inside|intra_transition|italic|justify|kerning|keyboard_focus|language|layer_clipping|layers|layout|left_bar|left_gutter|left_margin|left_padding|length|line_leading|line_overlap_split|line_spacing|linear|main_game_transition|main_menu_music|maximum|min_width|minimum|minwidth|modal|mouse|mousewheel|name|narrator_menu|newline_indent|nvl_adv_transition|offset|order_reverse|outlines|overlay_functions|pos|position|prefix|radius|range|rest_indent|right_bar|right_gutter|right_margin|right_padding|rotate|rotate_pad|ruby_style|sample_sound|save_directory|say_attribute_transition|screen_height|screen_width|scrollbars|selected_hover|selected_hover_color|selected_idle|selected_idle_color|selected_insensitive|show_side_image|show_two_window|side_spacing|side_xpos|side_ypos|size|size_group|slow_cps|slow_cps_multiplier|spacing|strikethrough|subpixel|text_align|text_style|text_xpos|text_y_fudge|text_ypos|thumb|thumb_offset|thumb_shadow|thumbnail_height|thumbnail_width|time|top_bar|top_gutter|top_margin|top_padding|translations|underline|unscrollable|update|value|version|version_name|version_tuple|vertical|width|window_hide_transition|window_icon|window_left_padding|window_show_transition|window_title|windows_icon|xadjustment|xalign|xanchor|xanchoraround|xaround|xcenter|xfill|xinitial|xmargin|xmaximum|xminimum|xoffset|xofsset|xpadding|xpos|xsize|xzoom|yadjustment|yalign|yanchor|yanchoraround|yaround|ycenter|yfill|yinitial|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|ysizexysize|yzoom|zoom|zorder)\b/,tag:/\b(?:bar|block|button|buttoscreenn|drag|draggroup|fixed|frame|grid|[hv]box|hotbar|hotspot|image|imagebutton|imagemap|input|key|label|menu|mm_menu_frame|mousearea|nvl|parallel|screen|self|side|tag|text|textbutton|timer|vbar|viewport|window)\b|\$/,keyword:/\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|yield)\b/,boolean:/\b(?:[Ff]alse|[Tt]rue)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:and|at|not|or|with)\b/,punctuation:/[{}[\];(),.:]/},Prism.languages.rpy=Prism.languages.renpy; \ No newline at end of file diff --git a/tests/languages/renpy/boolean_feature.test b/tests/languages/renpy/boolean_feature.test new file mode 100644 index 0000000000..30c2be15d9 --- /dev/null +++ b/tests/languages/renpy/boolean_feature.test @@ -0,0 +1,9 @@ +true false +True False + +---------------------------------------------------- + +[ + ["boolean", "true"], ["boolean", "false"], + ["boolean", "True"], ["boolean", "False"] +] diff --git a/tests/languages/renpy/comment_feature.test b/tests/languages/renpy/comment_feature.test new file mode 100644 index 0000000000..7883a734b3 --- /dev/null +++ b/tests/languages/renpy/comment_feature.test @@ -0,0 +1,7 @@ +# comment + +---------------------------------------------------- + +[ + ["comment", "# comment"] +] diff --git a/tests/languages/renpy/function_feature.test b/tests/languages/renpy/function_feature.test new file mode 100644 index 0000000000..3ec94de787 --- /dev/null +++ b/tests/languages/renpy/function_feature.test @@ -0,0 +1,43 @@ +renpy.register_bmfont("bmfont", 22, filename="bmfont.fnt") + +# Resize the background of the text window if it's too small. +init python: + style.window.background = Frame("frame.png", 10, 10) + +---------------------------------------------------- + +[ + ["keyword", "renpy"], + ["punctuation", "."], + ["function", "register_bmfont"], + ["punctuation", "("], + ["string", "\"bmfont\""], + ["punctuation", ","], + ["number", "22"], + ["punctuation", ","], + " filename", + ["operator", "="], + ["string", "\"bmfont.fnt\""], + ["punctuation", ")"], + + ["comment", "# Resize the background of the text window if it's too small."], + + ["keyword", "init"], + ["keyword", "python"], + ["punctuation", ":"], + + ["keyword", "style"], + ["punctuation", "."], + ["tag", "window"], + ["punctuation", "."], + ["property", "background"], + ["operator", "="], + ["function", "Frame"], + ["punctuation", "("], + ["string", "\"frame.png\""], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ","], + ["number", "10"], + ["punctuation", ")"] +] diff --git a/tests/languages/renpy/keyword_feature.test b/tests/languages/renpy/keyword_feature.test new file mode 100644 index 0000000000..410cacf4ca --- /dev/null +++ b/tests/languages/renpy/keyword_feature.test @@ -0,0 +1,239 @@ +; None +; add +; adjustment +; alignaround +; allow +; angle +; animation +; around +; as +; assert +; behind +; box_layout +; break +; build +; cache +; call +; center +; changed +; child_size +; choice +; circles +; class +; clear +; clicked +; clipping +; clockwise +; config +; contains +; continue +; corner1 +; corner2 +; counterclockwise +; def +; default +; define +; del +; delay +; disabled +; disabled_text +; dissolve +; elif +; else +; event +; except +; exclude +; exec +; expression +; fade +; finally +; for +; from +; function +; global +; gm_root +; has +; hide +; id +; if +; import +; in +; init +; is +; jump +; knot +; lambda +; left +; less_rounded +; mm_root +; movie +; music +; null +; on +; onlayer +; pass +; pause +; persistent +; play +; print +; python +; queue +; raise +; random +; renpy +; repeat +; return +; right +; rounded_window +; scene +; scope +; set +; show +; slow +; slow_abortable +; slow_done +; sound +; stop +; store +; style +; style_group +; substitute +; suffix +; theme +; transform +; transform_anchor +; transpose +; try +; ui +; unhovered +; updater +; use +; voice +; while +; widget +; widget_hover +; widget_selected +; widget_text +; yield + +---------------------------------------------------- + +[ + ["punctuation", ";"], ["keyword", "None"], + ["punctuation", ";"], ["keyword", "add"], + ["punctuation", ";"], ["keyword", "adjustment"], + ["punctuation", ";"], ["keyword", "alignaround"], + ["punctuation", ";"], ["keyword", "allow"], + ["punctuation", ";"], ["keyword", "angle"], + ["punctuation", ";"], ["keyword", "animation"], + ["punctuation", ";"], ["keyword", "around"], + ["punctuation", ";"], ["keyword", "as"], + ["punctuation", ";"], ["keyword", "assert"], + ["punctuation", ";"], ["keyword", "behind"], + ["punctuation", ";"], ["keyword", "box_layout"], + ["punctuation", ";"], ["keyword", "break"], + ["punctuation", ";"], ["keyword", "build"], + ["punctuation", ";"], ["keyword", "cache"], + ["punctuation", ";"], ["keyword", "call"], + ["punctuation", ";"], ["keyword", "center"], + ["punctuation", ";"], ["keyword", "changed"], + ["punctuation", ";"], ["keyword", "child_size"], + ["punctuation", ";"], ["keyword", "choice"], + ["punctuation", ";"], ["keyword", "circles"], + ["punctuation", ";"], ["keyword", "class"], + ["punctuation", ";"], ["keyword", "clear"], + ["punctuation", ";"], ["keyword", "clicked"], + ["punctuation", ";"], ["keyword", "clipping"], + ["punctuation", ";"], ["keyword", "clockwise"], + ["punctuation", ";"], ["keyword", "config"], + ["punctuation", ";"], ["keyword", "contains"], + ["punctuation", ";"], ["keyword", "continue"], + ["punctuation", ";"], ["keyword", "corner1"], + ["punctuation", ";"], ["keyword", "corner2"], + ["punctuation", ";"], ["keyword", "counterclockwise"], + ["punctuation", ";"], ["keyword", "def"], + ["punctuation", ";"], ["keyword", "default"], + ["punctuation", ";"], ["keyword", "define"], + ["punctuation", ";"], ["keyword", "del"], + ["punctuation", ";"], ["keyword", "delay"], + ["punctuation", ";"], ["keyword", "disabled"], + ["punctuation", ";"], ["keyword", "disabled_text"], + ["punctuation", ";"], ["keyword", "dissolve"], + ["punctuation", ";"], ["keyword", "elif"], + ["punctuation", ";"], ["keyword", "else"], + ["punctuation", ";"], ["keyword", "event"], + ["punctuation", ";"], ["keyword", "except"], + ["punctuation", ";"], ["keyword", "exclude"], + ["punctuation", ";"], ["keyword", "exec"], + ["punctuation", ";"], ["keyword", "expression"], + ["punctuation", ";"], ["keyword", "fade"], + ["punctuation", ";"], ["keyword", "finally"], + ["punctuation", ";"], ["keyword", "for"], + ["punctuation", ";"], ["keyword", "from"], + ["punctuation", ";"], ["keyword", "function"], + ["punctuation", ";"], ["keyword", "global"], + ["punctuation", ";"], ["keyword", "gm_root"], + ["punctuation", ";"], ["keyword", "has"], + ["punctuation", ";"], ["keyword", "hide"], + ["punctuation", ";"], ["keyword", "id"], + ["punctuation", ";"], ["keyword", "if"], + ["punctuation", ";"], ["keyword", "import"], + ["punctuation", ";"], ["keyword", "in"], + ["punctuation", ";"], ["keyword", "init"], + ["punctuation", ";"], ["keyword", "is"], + ["punctuation", ";"], ["keyword", "jump"], + ["punctuation", ";"], ["keyword", "knot"], + ["punctuation", ";"], ["keyword", "lambda"], + ["punctuation", ";"], ["keyword", "left"], + ["punctuation", ";"], ["keyword", "less_rounded"], + ["punctuation", ";"], ["keyword", "mm_root"], + ["punctuation", ";"], ["keyword", "movie"], + ["punctuation", ";"], ["keyword", "music"], + ["punctuation", ";"], ["keyword", "null"], + ["punctuation", ";"], ["keyword", "on"], + ["punctuation", ";"], ["keyword", "onlayer"], + ["punctuation", ";"], ["keyword", "pass"], + ["punctuation", ";"], ["keyword", "pause"], + ["punctuation", ";"], ["keyword", "persistent"], + ["punctuation", ";"], ["keyword", "play"], + ["punctuation", ";"], ["keyword", "print"], + ["punctuation", ";"], ["keyword", "python"], + ["punctuation", ";"], ["keyword", "queue"], + ["punctuation", ";"], ["keyword", "raise"], + ["punctuation", ";"], ["keyword", "random"], + ["punctuation", ";"], ["keyword", "renpy"], + ["punctuation", ";"], ["keyword", "repeat"], + ["punctuation", ";"], ["keyword", "return"], + ["punctuation", ";"], ["keyword", "right"], + ["punctuation", ";"], ["keyword", "rounded_window"], + ["punctuation", ";"], ["keyword", "scene"], + ["punctuation", ";"], ["keyword", "scope"], + ["punctuation", ";"], ["keyword", "set"], + ["punctuation", ";"], ["keyword", "show"], + ["punctuation", ";"], ["keyword", "slow"], + ["punctuation", ";"], ["keyword", "slow_abortable"], + ["punctuation", ";"], ["keyword", "slow_done"], + ["punctuation", ";"], ["keyword", "sound"], + ["punctuation", ";"], ["keyword", "stop"], + ["punctuation", ";"], ["keyword", "store"], + ["punctuation", ";"], ["keyword", "style"], + ["punctuation", ";"], ["keyword", "style_group"], + ["punctuation", ";"], ["keyword", "substitute"], + ["punctuation", ";"], ["keyword", "suffix"], + ["punctuation", ";"], ["keyword", "theme"], + ["punctuation", ";"], ["keyword", "transform"], + ["punctuation", ";"], ["keyword", "transform_anchor"], + ["punctuation", ";"], ["keyword", "transpose"], + ["punctuation", ";"], ["keyword", "try"], + ["punctuation", ";"], ["keyword", "ui"], + ["punctuation", ";"], ["keyword", "unhovered"], + ["punctuation", ";"], ["keyword", "updater"], + ["punctuation", ";"], ["keyword", "use"], + ["punctuation", ";"], ["keyword", "voice"], + ["punctuation", ";"], ["keyword", "while"], + ["punctuation", ";"], ["keyword", "widget"], + ["punctuation", ";"], ["keyword", "widget_hover"], + ["punctuation", ";"], ["keyword", "widget_selected"], + ["punctuation", ";"], ["keyword", "widget_text"], + ["punctuation", ";"], ["keyword", "yield"] +] diff --git a/tests/languages/renpy/property_feature.test b/tests/languages/renpy/property_feature.test new file mode 100644 index 0000000000..0eab089fbd --- /dev/null +++ b/tests/languages/renpy/property_feature.test @@ -0,0 +1,469 @@ +insensitive +idle +hover +selected_idle +selected_hover +background +position +alt +xpos +ypos +pos +xanchor +yanchor +anchor +xalign +yalign +align +xcenter +ycenter +xofsset +yoffset +ymaximum +maximum +xmaximum +xminimum +yminimum +minimum +xsize +ysizexysize +xfill +yfill +area +antialias +black_color +bold +caret +color +first_indent +font +size +italic +justify +kerning +language +layout +line_leading +line_overlap_split +line_spacing +min_width +newline_indent +outlines +rest_indent +ruby_style +slow_cps +slow_cps_multiplier +strikethrough +text_align +underline +hyperlink_functions +vertical +hinting +foreground +left_margin +xmargin +top_margin +bottom_margin +ymargin +left_padding +right_padding +xpadding +top_padding +bottom_padding +ypadding +size_group +child +hover_sound +activate_sound +mouse +focus_mask +keyboard_focus +bar_vertical +bar_invert +bar_resizing +left_gutter +right_gutter +top_gutter +bottom_gutter +left_bar +right_bar +top_bar +bottom_bar +thumb +thumb_shadow +thumb_offset +unscrollable +spacing +first_spacing +box_reverse +box_wrap +order_reverse +fit_first +ysize +thumbnail_width +thumbnail_height +help +text_ypos +text_xpos +idle_color +hover_color +selected_idle_color +selected_hover_color +insensitive_color +alpha +insensitive_background +hover_background +zorder +value +width +xadjustment +xanchoraround +xaround +xinitial +xoffset +xzoom +yadjustment +yanchoraround +yaround +yinitial +yzoom +zoom +ground +height +text_style +text_y_fudge +selected_insensitive +has_sound +has_music +has_voice +focus +hovered +image_style +length +minwidth +mousewheel +offset +prefix +radius +range +right_margin +rotate +rotate_pad +developer +screen_width +screen_height +window_title +name +version +windows_icon +default_fullscreen +default_text_cps +default_afm_time +main_menu_music +sample_sound +enter_sound +exit_sound +save_directory +enter_transition +exit_transition +intra_transition +main_game_transition +game_main_transition +end_splash_transition +end_game_transition +after_load_transition +window_show_transition +window_hide_transition +adv_nvl_transition +nvl_adv_transition +enter_yesno_transition +exit_yesno_transition +enter_replay_transition +exit_replay_transition +say_attribute_transition +directory_name +executable_name +include_update +window_icon +modal +google_play_key +google_play_salt +drag_name +drag_handle +draggable +dragged +droppable +dropped +narrator_menu +action +default_afm_enable +version_name +version_tuple +inside +fadeout +fadein +layers +layer_clipping +linear +scrollbars +side_xpos +side_ypos +side_spacing +edgescroll +drag_joined +drag_raise +drop_shadow +drop_shadow_color +subpixel +easein +easeout +time +crop +auto +update +get_installed_packages +can_update +UpdateVersion +Update +overlay_functions +translations +window_left_padding +show_side_image +show_two_window + +---------------------------------------------------- + +[ + ["property", "insensitive"], + ["property", "idle"], + ["property", "hover"], + ["property", "selected_idle"], + ["property", "selected_hover"], + ["property", "background"], + ["property", "position"], + ["property", "alt"], + ["property", "xpos"], + ["property", "ypos"], + ["property", "pos"], + ["property", "xanchor"], + ["property", "yanchor"], + ["property", "anchor"], + ["property", "xalign"], + ["property", "yalign"], + ["property", "align"], + ["property", "xcenter"], + ["property", "ycenter"], + ["property", "xofsset"], + ["property", "yoffset"], + ["property", "ymaximum"], + ["property", "maximum"], + ["property", "xmaximum"], + ["property", "xminimum"], + ["property", "yminimum"], + ["property", "minimum"], + ["property", "xsize"], + ["property", "ysizexysize"], + ["property", "xfill"], + ["property", "yfill"], + ["property", "area"], + ["property", "antialias"], + ["property", "black_color"], + ["property", "bold"], + ["property", "caret"], + ["property", "color"], + ["property", "first_indent"], + ["property", "font"], + ["property", "size"], + ["property", "italic"], + ["property", "justify"], + ["property", "kerning"], + ["property", "language"], + ["property", "layout"], + ["property", "line_leading"], + ["property", "line_overlap_split"], + ["property", "line_spacing"], + ["property", "min_width"], + ["property", "newline_indent"], + ["property", "outlines"], + ["property", "rest_indent"], + ["property", "ruby_style"], + ["property", "slow_cps"], + ["property", "slow_cps_multiplier"], + ["property", "strikethrough"], + ["property", "text_align"], + ["property", "underline"], + ["property", "hyperlink_functions"], + ["property", "vertical"], + ["property", "hinting"], + ["property", "foreground"], + ["property", "left_margin"], + ["property", "xmargin"], + ["property", "top_margin"], + ["property", "bottom_margin"], + ["property", "ymargin"], + ["property", "left_padding"], + ["property", "right_padding"], + ["property", "xpadding"], + ["property", "top_padding"], + ["property", "bottom_padding"], + ["property", "ypadding"], + ["property", "size_group"], + ["property", "child"], + ["property", "hover_sound"], + ["property", "activate_sound"], + ["property", "mouse"], + ["property", "focus_mask"], + ["property", "keyboard_focus"], + ["property", "bar_vertical"], + ["property", "bar_invert"], + ["property", "bar_resizing"], + ["property", "left_gutter"], + ["property", "right_gutter"], + ["property", "top_gutter"], + ["property", "bottom_gutter"], + ["property", "left_bar"], + ["property", "right_bar"], + ["property", "top_bar"], + ["property", "bottom_bar"], + ["property", "thumb"], + ["property", "thumb_shadow"], + ["property", "thumb_offset"], + ["property", "unscrollable"], + ["property", "spacing"], + ["property", "first_spacing"], + ["property", "box_reverse"], + ["property", "box_wrap"], + ["property", "order_reverse"], + ["property", "fit_first"], + ["property", "ysize"], + ["property", "thumbnail_width"], + ["property", "thumbnail_height"], + ["property", "help"], + ["property", "text_ypos"], + ["property", "text_xpos"], + ["property", "idle_color"], + ["property", "hover_color"], + ["property", "selected_idle_color"], + ["property", "selected_hover_color"], + ["property", "insensitive_color"], + ["property", "alpha"], + ["property", "insensitive_background"], + ["property", "hover_background"], + ["property", "zorder"], + ["property", "value"], + ["property", "width"], + ["property", "xadjustment"], + ["property", "xanchoraround"], + ["property", "xaround"], + ["property", "xinitial"], + ["property", "xoffset"], + ["property", "xzoom"], + ["property", "yadjustment"], + ["property", "yanchoraround"], + ["property", "yaround"], + ["property", "yinitial"], + ["property", "yzoom"], + ["property", "zoom"], + ["property", "ground"], + ["property", "height"], + ["property", "text_style"], + ["property", "text_y_fudge"], + ["property", "selected_insensitive"], + ["property", "has_sound"], + ["property", "has_music"], + ["property", "has_voice"], + ["property", "focus"], + ["property", "hovered"], + ["property", "image_style"], + ["property", "length"], + ["property", "minwidth"], + ["property", "mousewheel"], + ["property", "offset"], + ["property", "prefix"], + ["property", "radius"], + ["property", "range"], + ["property", "right_margin"], + ["property", "rotate"], + ["property", "rotate_pad"], + ["property", "developer"], + ["property", "screen_width"], + ["property", "screen_height"], + ["property", "window_title"], + ["property", "name"], + ["property", "version"], + ["property", "windows_icon"], + ["property", "default_fullscreen"], + ["property", "default_text_cps"], + ["property", "default_afm_time"], + ["property", "main_menu_music"], + ["property", "sample_sound"], + ["property", "enter_sound"], + ["property", "exit_sound"], + ["property", "save_directory"], + ["property", "enter_transition"], + ["property", "exit_transition"], + ["property", "intra_transition"], + ["property", "main_game_transition"], + ["property", "game_main_transition"], + ["property", "end_splash_transition"], + ["property", "end_game_transition"], + ["property", "after_load_transition"], + ["property", "window_show_transition"], + ["property", "window_hide_transition"], + ["property", "adv_nvl_transition"], + ["property", "nvl_adv_transition"], + ["property", "enter_yesno_transition"], + ["property", "exit_yesno_transition"], + ["property", "enter_replay_transition"], + ["property", "exit_replay_transition"], + ["property", "say_attribute_transition"], + ["property", "directory_name"], + ["property", "executable_name"], + ["property", "include_update"], + ["property", "window_icon"], + ["property", "modal"], + ["property", "google_play_key"], + ["property", "google_play_salt"], + ["property", "drag_name"], + ["property", "drag_handle"], + ["property", "draggable"], + ["property", "dragged"], + ["property", "droppable"], + ["property", "dropped"], + ["property", "narrator_menu"], + ["property", "action"], + ["property", "default_afm_enable"], + ["property", "version_name"], + ["property", "version_tuple"], + ["property", "inside"], + ["property", "fadeout"], + ["property", "fadein"], + ["property", "layers"], + ["property", "layer_clipping"], + ["property", "linear"], + ["property", "scrollbars"], + ["property", "side_xpos"], + ["property", "side_ypos"], + ["property", "side_spacing"], + ["property", "edgescroll"], + ["property", "drag_joined"], + ["property", "drag_raise"], + ["property", "drop_shadow"], + ["property", "drop_shadow_color"], + ["property", "subpixel"], + ["property", "easein"], + ["property", "easeout"], + ["property", "time"], + ["property", "crop"], + ["property", "auto"], + ["property", "update"], + ["property", "get_installed_packages"], + ["property", "can_update"], + ["property", "UpdateVersion"], + ["property", "Update"], + ["property", "overlay_functions"], + ["property", "translations"], + ["property", "window_left_padding"], + ["property", "show_side_image"], + ["property", "show_two_window"] +] diff --git a/tests/languages/renpy/string_feature.test b/tests/languages/renpy/string_feature.test new file mode 100644 index 0000000000..426f944043 --- /dev/null +++ b/tests/languages/renpy/string_feature.test @@ -0,0 +1,29 @@ +"# This isn't a comment, since it's part of a string." + +"Since this line contains a string, it continues + even when the line ends." + +$ a = [ "Because of parenthesis, this line also", + "spans more than one line." ] + +'Strings can\'t contain their delimiter, unless you escape it.' + +---------------------------------------------------- + +[ + ["string", "\"# This isn't a comment, since it's part of a string.\""], + + ["string", "\"Since this line contains a string, it continues\r\n even when the line ends.\""], + + ["tag", "$"], + " a ", + ["operator", "="], + ["punctuation", "["], + ["string", "\"Because of parenthesis, this line also\""], + ["punctuation", ","], + + ["string", "\"spans more than one line.\""], + ["punctuation", "]"], + + ["string", "'Strings can\\'t contain their delimiter, unless you escape it.'"] +] diff --git a/tests/languages/renpy/tag_feature.test b/tests/languages/renpy/tag_feature.test new file mode 100644 index 0000000000..1bc9484d88 --- /dev/null +++ b/tests/languages/renpy/tag_feature.test @@ -0,0 +1,75 @@ +label +image +menu +hbox +vbox +frame +text +imagemap +imagebutton +bar +vbar +screen +textbutton +buttoscreenn +fixed +grid +input +key +mousearea +side +timer +viewport +window +hotspot +hotbar +self +button +drag +draggroup +tag +mm_menu_frame +nvl +block + +$ + +---------------------------------------------------- + +[ + ["tag", "label"], + ["tag", "image"], + ["tag", "menu"], + ["tag", "hbox"], + ["tag", "vbox"], + ["tag", "frame"], + ["tag", "text"], + ["tag", "imagemap"], + ["tag", "imagebutton"], + ["tag", "bar"], + ["tag", "vbar"], + ["tag", "screen"], + ["tag", "textbutton"], + ["tag", "buttoscreenn"], + ["tag", "fixed"], + ["tag", "grid"], + ["tag", "input"], + ["tag", "key"], + ["tag", "mousearea"], + ["tag", "side"], + ["tag", "timer"], + ["tag", "viewport"], + ["tag", "window"], + ["tag", "hotspot"], + ["tag", "hotbar"], + ["tag", "self"], + ["tag", "button"], + ["tag", "drag"], + ["tag", "draggroup"], + ["tag", "tag"], + ["tag", "mm_menu_frame"], + ["tag", "nvl"], + ["tag", "block"], + + ["tag", "$"] +]