How igormaj/syntaxcoloring works
Project type and purpose
• This is an open-source Python CLI tool and library (“gen_coloring”) whose job is to generate syntax-coloring artifacts (TextMate grammars, VSCode extensions, etc.) from grammar definitions.
• Key indicators:
– Top-level scripts: generate_vsc_plugin.py and gen_coloring/coloring_entry_point.py (CLI entry points)
– Directories named grammar, templates, static (scaffolding for output)
– Generator modules: plugin_generator.py, textmate_generator.py
File structure
• Top-level files:
– setup.py: packaging and entry-point definition
– generate_vsc_plugin.py: standalone script to scaffold a VSCode plugin
• Main package directory: gen_coloring/
– coloring_entry_point.py: CLI front door, parses args, directs workflow
– input/command_arguments.py: handles CLI args parsing
– obj_preprocessors.py: transforms input models or ASTs before generation
– grammar/: .tx grammar definitions (for textX or custom parser)
– generators/: two main generators:
• plugin_generator.py (builds full VSCode extension from templates + static assets)
• textmate_generator.py (generates TextMate grammar JSON)
– templates/: Jinja2 and JSON templates for statements, modules, etc.
– static/: boilerplate files for VSCode extension (package.json, language-configuration.json, README, etc.)
– utils.py: shared helper routines
README (empty in this case)
• No further text, so we rely entirely on file naming and structure.