openwrt / openwrt/packages

nano: ucode syntax highlighting breaks when encountering "}}"

Open
#24,325 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @hnyman
Environment: master

Syntax highlighting of ucode stops working when the string }} is encountered in the source code.

#! /usr/bin/env ucode

({a: {}});

// Everyting from here on gets the same color.
print("Hello!\n");
0 + 1 + 2 + 3 + 4 + 5;
return null;
bild

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ucode syntax-highlighting implementation used in the OpenWrt packages project and reproduce the issue with the provided example on master. Trace how the nested object ending in }} is tokenized; done means highlighting continues correctly after that sequence, including the following string and statements.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.