Gidsss / UwUIDE

A compiler made to be cute uwu >~<
6 stars 0 forks source link

Feat/syntax highlighting #312

Closed chaaals closed 3 months ago

chaaals commented 3 months ago

Description

This PR implements syntax highlighting in our UwU++ compiler. This implementation allows us to put more themes in our compiler, our initial theme is tokyo

Implementation Details

Theme folder structure

theme
├── __init__.py
├── config.py
└── sample.py

__init__.py - This is the entry point of the theme folder. We can access all themes here in a dictionary format. image

config.py - This file can be modified in the future, but so far, it covers all tokens in lexer + built-in methods. image

sample.py - This file contains a sample of how we can create a theme for our compiler. image

Usage

Editor theme can be set on code_view.py file image

Preview

https://github.com/Gidsss/UwUIDE/assets/70326902/d3c5e2df-e09b-46d0-9690-51355f32572b

Gidsss commented 3 months ago

LGTM!! I'll try it more on my side na lang

Update: May issue dun sa token highlighting (ififix na ni @chaaals hehe ty)