Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

query: Unknown characters are silently ignored (.foo!!!, non-ASCII keys)

Open
#104 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
cli, tooling

Research direction

The skipping happens in parser.go around lines 190-196, where the lexer discards characters that form no token; the identifier word-character check is nearby. Start by reading how the lexer handles unknown input, then run the tq examples from the issue (.foo!!!, .foo bar, .名前) to confirm current behavior. Done when unknown characters return a syntax error, Unicode letters work in bare keys, and the error suggests the quoted form. Confirm the breaking-change decision with maintainers first.

Written by the indexing model from the issue text.

Description

bug

Problem

The lexer skips characters that do not form a token "to preserve legacy behavior", so malformed queries succeed and typos go unnoticed:

$ echo '{"foo":1}' | tq '.foo!!!'
1
$ echo '{"foo":1}' | tq '.foo bar'
"bar"

Non-ASCII identifiers are not word characters either, so .名前 is skipped and returns the root.

https://github.com/mojatter/tree/blob/2d4fd3d11f3e28c7c95f51d091b94ef0a6ed18f1/parser.go#L190-L196

Proposed fix

Make unrecognized characters a syntax error (pre-1.0 is the time to drop the legacy behavior), accept Unicode letters in bare identifiers, and add a hint like use ."foo-bar" for keys that need quoting.

Dominant language
Go
Stars
7
Forks
2
Avg merge
11h 12m
Merged PRs (30d)
43

Getting set up

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.

More from mojatter/tree

All issues in mojatter/tree

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.