Skip to content

Add ucode language#8043

Open
janeblower wants to merge 1 commit into
github-linguist:mainfrom
janeblower:add-ucode-language
Open

Add ucode language#8043
janeblower wants to merge 1 commit into
github-linguist:mainfrom
janeblower:add-ucode-language

Conversation

@janeblower

@janeblower janeblower commented Jul 1, 2026

Copy link
Copy Markdown

Description

This adds detection and syntax highlighting for ucode, the JavaScript-like scripting language created for OpenWrt (interpreter by Jo-Philipp Wich). It is widely used across the OpenWrt ecosystem — openwrt/openwrt, openwrt/luci, and a large number of luci-app-* and related package repositories — for rpcd backends, LuCI controllers/dispatchers, and CLI utilities.

ucode's primary extension .uc is already registered to UnrealScript, so this is a shared-extension addition:

  • both languages keep the .uc extension;
  • UnrealScript already ships two .uc samples, and this PR adds three ucode samples;
  • a content heuristic is added to heuristics.yml to disambiguate the two. ucode is matched on markers that never appear in UnrealScript (the #!/usr/bin/ucode shebang, 'use strict', ES import/export, require(/include(, let bindings, printf/sprintf), and UnrealScript on its own markers (class X extends Y, defaultproperties, var(...), #exec, simulated/exec/native function modifiers). let is used rather than const because UnrealScript also has const.
  • a test (test_uc_by_heuristics) asserts both directions classify correctly.

Checklist:

@janeblower janeblower marked this pull request as ready for review July 1, 2026 04:54
@janeblower janeblower requested a review from a team as a code owner July 1, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant