diff --git a/autotests/folding/highlight.rpy.fold b/autotests/folding/highlight.rpy.fold
new file mode 100644
--- /dev/null
+++ b/autotests/folding/highlight.rpy.fold
@@ -0,0 +1,62 @@
+# Declare characters used by this game.
+define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"", what_color="#c8ffc8")
+define m = Character(_("Me"), color="#c8c8ff")
+
+define menu = nvl_menu
+default book = False
+
+# The game starts here.
+label start:
+
+ # Start by playing some music.
+ play music "illurock.opus"
+
+ scene bg lecturehall
+ with fade
+
+ window show
+
+ "bla bla\n"
+ "bla {b}bla{/b}"
+
+ window hide
+ nvl clear
+
+ scene bg uni
+ with fade
+ window show
+
+ show sylvie green normal
+ with dissolve
+ window show
+
+ menu:
+ "To ask her later.":
+ jump later
+
+
+label rightaway:
+ nvl clear
+ show sylvie green smile
+ m """bla..."
+ "bla bla bla."""
+
+label start:
+
+python:
+ player_health = max(player_health - damage, 0)
+ f = lambda x: print(x)
+
+label start:
+ $ flag = True
+ $ romance_points += 1
+ $ f = lambda x: print(x)
+
+init 1 python:
+
+ # The bad ending is always unlocked.
+ persistent.endings.add("bad_ending")
+
+ f = lambda x: print(x)
+
+label start:
diff --git a/autotests/html/highlight.rpy.html b/autotests/html/highlight.rpy.html
new file mode 100644
--- /dev/null
+++ b/autotests/html/highlight.rpy.html
@@ -0,0 +1,69 @@
+
+
+
+highlight.rpy
+
+
+# Declare characters used by this game.
+define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"", what_color="#c8ffc8")
+define m = Character(_("Me"), color="#c8c8ff")
+
+define menu = nvl_menu
+default book = False
+
+# The game starts here.
+label start:
+
+ # Start by playing some music.
+ play music "illurock.opus"
+
+ scene bg lecturehall
+ with fade
+
+ window show
+
+ "bla bla\n"
+ "bla {b}bla{/b}"
+
+ window hide
+ nvl clear
+
+ scene bg uni
+ with fade
+ window show
+
+ show sylvie green normal
+ with dissolve
+ window show
+
+ menu:
+ "To ask her later.":
+ jump later
+
+
+label rightaway:
+ nvl clear
+ show sylvie green smile
+ m """bla..."
+ "bla bla bla."""
+
+label start:
+
+python:
+ player_health = max(player_health - damage, 0)
+ f = lambda x: print(x)
+
+label start:
+ $ flag = True
+ $ romance_points += 1
+ $ f = lambda x: print(x)
+
+init 1 python:
+
+ # The bad ending is always unlocked.
+ persistent.endings.add("bad_ending")
+
+ f = lambda x: print(x)
+
+label start:
+
diff --git a/autotests/input/highlight.rpy b/autotests/input/highlight.rpy
new file mode 100644
--- /dev/null
+++ b/autotests/input/highlight.rpy
@@ -0,0 +1,62 @@
+# Declare characters used by this game.
+define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"", what_color="#c8ffc8")
+define m = Character(_("Me"), color="#c8c8ff")
+
+define menu = nvl_menu
+default book = False
+
+# The game starts here.
+label start:
+
+ # Start by playing some music.
+ play music "illurock.opus"
+
+ scene bg lecturehall
+ with fade
+
+ window show
+
+ "bla bla\n"
+ "bla {b}bla{/b}"
+
+ window hide
+ nvl clear
+
+ scene bg uni
+ with fade
+ window show
+
+ show sylvie green normal
+ with dissolve
+ window show
+
+ menu:
+ "To ask her later.":
+ jump later
+
+
+label rightaway:
+ nvl clear
+ show sylvie green smile
+ m """bla..."
+ "bla bla bla."""
+
+label start:
+
+python:
+ player_health = max(player_health - damage, 0)
+ f = lambda x: print(x)
+
+label start:
+ $ flag = True
+ $ romance_points += 1
+ $ f = lambda x: print(x)
+
+init 1 python:
+
+ # The bad ending is always unlocked.
+ persistent.endings.add("bad_ending")
+
+ f = lambda x: print(x)
+
+label start:
diff --git a/autotests/reference/highlight.rpy.ref b/autotests/reference/highlight.rpy.ref
new file mode 100644
--- /dev/null
+++ b/autotests/reference/highlight.rpy.ref
@@ -0,0 +1,62 @@
+# Declare characters used by this game.
+define s = Character(None, kind=nvl, what_prefix="\"", what_suffix="\"", what_color="#c8ffc8")
+define m = Character(_("Me"), color="#c8c8ff")
+
+define menu = nvl_menu
+default book = False
+
+# The game starts here.
+label start:
+
+ # Start by playing some music.
+ play music "illurock.opus"
+
+ scene bg lecturehall
+ with fade
+
+ window show
+
+ "bla bla\n"
+ "bla {b}bla{/b}"
+
+ window hide
+ nvl clear
+
+ scene bg uni
+ with fade
+ window show
+
+ show sylvie green normal
+ with dissolve
+ window show
+
+ menu:
+ "To ask her later.":
+ jump later
+
+
+label rightaway:
+ nvl clear
+ show sylvie green smile
+ m """bla..."
+ "bla bla bla."""
+
+label start:
+
+python:
+ player_health = max(player_health - damage, 0)
+ f = lambda x: print(x)
+
+label start:
+ $ flag = True
+ $ romance_points += 1
+ $ f = lambda x: print(x)
+
+init 1 python:
+
+ # The bad ending is always unlocked.
+ persistent.endings.add("bad_ending")
+
+ f = lambda x: print(x)
+
+label start:
diff --git a/data/syntax/renpy.xml b/data/syntax/renpy.xml
new file mode 100644
--- /dev/null
+++ b/data/syntax/renpy.xml
@@ -0,0 +1,663 @@
+
+
+
+
+
+
+
+ - elif
+ - else
+ - label
+ - jump
+ - repeat
+ - return
+ - while
+
+
+
+ - add
+ - bloc
+ - call
+ - choice
+ - contains
+ - default
+ - define
+ - function
+ - hide
+ - if
+ - image
+ - init
+ - menu
+ - on
+ - parallel
+ - pass
+ - pause
+ - play
+ - python
+ - scene
+ - screen
+ - show
+ - textbutton
+ - time
+ - transform
+ - vbox
+ - voice
+ - window
+ - with
+
+ - at
+ - as
+ - zorder
+ - onlayer
+ - behind
+
+
+
+ - None
+ - True
+ - False
+
+
+
+ - adv
+ - nvl
+ - narrator
+ - name_only
+ - centered
+ - vcentered
+ - extend
+
+
+
+ - set
+ - ADVCharacter
+ - ADVSpeaker
+ - Action
+ - AddToSet
+ - Alpha
+ - AlphaBlend
+ - AlphaDissolve
+ - AlphaMask
+ - AnimatedValue
+ - Animation
+ - At
+ - Attribute
+ - AudioPositionValue
+ - Bar
+ - BarValue
+ - Borders
+ - Button
+ - Call
+ - Character
+ - Color
+ - ComposeTransition
+ - Composite
+ - Condition
+ - ConditionGroup
+ - ConditionSwitch
+ - Confirm
+ - Crop
+ - CropMove
+ - DictEquality
+ - DictInputValue
+ - DictValue
+ - DisableAllInputValues
+ - Dissolve
+ - Drag
+ - DragGroup
+ - DynamicCharacter
+ - DynamicDisplayable
+ - DynamicImage
+ - EndReplay
+ - FactorZoom
+ - Fade
+ - FieldEquality
+ - FieldInputValue
+ - FieldValue
+ - FileAction
+ - FileCurrentPage
+ - FileCurrentScreenshot
+ - FileDelete
+ - FileJson
+ - FileLoad
+ - FileLoadable
+ - FileNewest
+ - FilePage
+ - FilePageName
+ - FilePageNameInputValue
+ - FilePageNext
+ - FilePagePrevious
+ - FileSave
+ - FileSaveName
+ - FileScreenshot
+ - FileSlotName
+ - FileTakeScreenshot
+ - FileTime
+ - FileUsedSlots
+ - Fixed
+ - Flatten
+ - FontGroup
+ - Frame
+ - Function
+ - Gallery
+ - GamepadCalibrate
+ - GamepadExists
+ - GetTooltip
+ - Grid
+ - HBox
+ - Help
+ - Hide
+ - HideInterface
+ - If
+ - Image
+ - ImageButton
+ - ImageDissolve
+ - ImageReference
+ - Input
+ - InputValue
+ - InvertSelected
+ - Jump
+ - Language
+ - LayeredImage
+ - LayeredImageProxy
+ - LiveComposite
+ - LiveCrop
+ - LiveTile
+ - MainMenu
+ - MixerValue
+ - Motion
+ - MouseMove
+ - Move
+ - MoveFactory
+ - MoveIn
+ - MoveOut
+ - MoveTransition
+ - Movie
+ - MultiPersistent
+ - MultipleTransition
+ - MusicRoom
+ - NVLCharacter
+ - NVLSpeaker
+ - NoRollback
+ - Notify
+ - Null
+ - NullAction
+ - OldMoveTransition
+ - OpenURL
+ - Pan
+ - ParameterizedText
+ - Particles
+ - Pause
+ - PauseAudio
+ - Pixellate
+ - Placeholder
+ - Play
+ - PlayCharacterVoice
+ - Position
+ - Preference
+ - PushMove
+ - Queue
+ - QueueEvent
+ - QuickLoad
+ - QuickSave
+ - Quit
+ - RemoveFromSet
+ - Replay
+ - RestartStatement
+ - Return
+ - Revolve
+ - RevolveInOut
+ - RollForward
+ - Rollback
+ - RollbackToIdentifier
+ - RotoZoom
+ - RoundRect
+ - ScreenVariableInputValue
+ - ScreenVariableValue
+ - Screenshot
+ - Scroll
+ - SelectedIf
+ - SensitiveIf
+ - Set
+ - SetCharacterVolume
+ - SetDict
+ - SetField
+ - SetLocalVariable
+ - SetMixer
+ - SetMute
+ - SetScreenVariable
+ - SetVariable
+ - SetVoiceMute
+ - Show
+ - ShowMenu
+ - ShowTransient
+ - ShowingSwitch
+ - SideImage
+ - SizeZoom
+ - Skip
+ - SnowBlossom
+ - Solid
+ - Speaker
+ - SplineMotion
+ - Sprite
+ - SpriteManager
+ - Start
+ - StaticValue
+ - Stop
+ - Style
+ - StylePreference
+ - SubTransition
+ - Text
+ - TextButton
+ - Tile
+ - ToggleDict
+ - ToggleField
+ - ToggleLocalVariable
+ - ToggleMute
+ - ToggleScreen
+ - ToggleScreenVariable
+ - ToggleSetMembership
+ - ToggleVariable
+ - ToggleVoiceMute
+ - Tooltip
+ - Transform
+ - VBox
+ - VariableInputValue
+ - VariableValue
+ - Viewport
+ - VoiceInfo
+ - VoiceReplay
+ - Window
+ - With
+ - XScrollValue
+ - YScrollValue
+ - Zoom
+ - ZoomInOut
+ - absolute
+ - achievement
+ - adv
+ - alt
+ - anim
+ - audio
+ - blinds
+ - build
+ - center
+ - centered
+ - color
+ - config
+ - default
+ - default_transition
+ - define
+ - director
+ - dissolve
+ - ease
+ - easeinbottom
+ - easeinleft
+ - easeinright
+ - easeintop
+ - easeoutbottom
+ - easeoutleft
+ - easeoutright
+ - easeouttop
+ - extend
+ - fade
+ - gui
+ - hpunch
+ - hyperlink_function
+ - hyperlink_sensitive
+ - hyperlink_styler
+ - i
+ - iap
+ - icon
+ - im
+ - irisin
+ - irisout
+ - layeredimage
+ - layout
+ - left
+ - library
+ - main_menu
+ - menu
+ - mouse_visible
+ - move
+ - moveinbottom
+ - moveinleft
+ - moveinright
+ - moveintop
+ - moveoutbottom
+ - moveoutleft
+ - moveoutright
+ - moveouttop
+ - name_only
+ - narrator
+ - nvl
+ - nvl_clear
+ - nvl_clear_next
+ - nvl_erase
+ - nvl_hide
+ - nvl_list
+ - nvl_menu
+ - nvl_narrator
+ - nvl_show
+ - nvl_show_core
+ - nvl_variant
+ - nvl_window
+ - offscreenleft
+ - offscreenright
+ - os
+ - persistent
+ - pixellate
+ - predict_menu
+ - predict_say
+ - preferences
+ - print_function
+ - pushdown
+ - pushleft
+ - pushright
+ - pushup
+ - python_dict
+ - python_list
+ - python_object
+ - python_set
+ - renpy
+ - reset
+ - right
+ - save_name
+ - say
+ - slideawaydown
+ - slideawayleft
+ - slideawayright
+ - slideawayup
+ - slidedown
+ - slideleft
+ - slideright
+ - slideup
+ - squares
+ - store
+ - style
+ - suppress_overlay
+ - sv
+ - sys
+ - theme
+ - toggle_skipping
+ - top
+ - topleft
+ - topright
+ - truecenter
+ - ui
+ - updater
+ - vcentered
+ - voice
+ - voice_can_replay
+ - voice_replay
+ - voice_sustain
+ - vpunch
+ - wipedown
+ - wipeleft
+ - wiperight
+ - wipeup
+ - zoomin
+ - zoominout
+ - zoomout
+
+
+
+ - mad
+ - surprised
+ - smile
+ - normal
+ - happy
+ - vhappy
+ - mad
+ - concerned
+
+
+
+ - music
+ - sound
+ - voice
+
+
+
+ - expression
+
+
+
+ - Character
+ - SetVoiceMute
+ - ToggleVoiceMute
+ - Movie
+ - LiveTile
+ - VBox
+ - Movie
+
+
+
+ - action
+ - xalign
+ - alpha
+ - yalign
+ - alignaround
+ - zoom
+ - linear
+ - rotate
+
+
+
+ - layer
+
+
+
+ - overlay
+ - screens
+ - transient
+ - master
+
+
+
+ - sustain
+
+
+
+ - start
+ - quit
+ - after_load
+ - splashscreen
+ - before_main_menu
+ - main_menu
+ - after_warp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+