diff --git a/src/syntax_providers.cpp b/src/syntax_providers.cpp index 85feae8a..a2fb5cee 100644 --- a/src/syntax_providers.cpp +++ b/src/syntax_providers.cpp @@ -139,6 +139,14 @@ static std::unordered_set scenegraph_keywords = { "pass", "post_2d", "geometry", "camera", "position", "look_at", "field_of_view", "near_far", "build_as", "vs", "gs", "fs", "model", "scale", "path", "surface", "size", "format", "targets", "clear", "ray_group_triangles", "ray_group_general", "ray_group_procedural", "ray_gen", "closest_hit", "miss", "any_hit", "callable", "intersection" }; +static std::unordered_set py_keywords = { + "for", "in", "fn", "def", "range", "import", "from", "int", "float", "vec2", "vec4", "vec3" +}; + +static std::unordered_set py_identifiers = { + "math", "sin", "cos", "circle", "bezier", "line", "text" +}; + static std::unordered_set scenegraph_identifiers = { ":", "=", "default", "default_color", "default_depth", "screen_rect" }; @@ -198,6 +206,12 @@ void RegisterSyntaxProviders(ZepEditor& editor) SyntaxProvider{ "markdown", tSyntaxFactory([](ZepBuffer* pBuffer) { return std::make_shared(*pBuffer, markdown_keywords, markdown_identifiers, ZepSyntaxFlags::CaseInsensitive); }) }); + + editor.RegisterSyntaxFactory( + { ".py", ".python" }, + SyntaxProvider{ "python", tSyntaxFactory([](ZepBuffer* pBuffer) { + return std::make_shared(*pBuffer, py_keywords, py_identifiers, ZepSyntaxFlags::CaseInsensitive); + }) }); } } // namespace Zep