projectwallace / projectwallace/css-parser

Finding Layer in tree should not have to search for LAYER_NAME

Open
#195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

annoyance
Dominant language
TypeScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This messes with my brain too much:

const ast = parse_atrule_prelude('import', params)

for (const node of ast) {
	if (node.type === LAYER_NAME && !node.name) {
		// LAYER_NAME???? 
	}
}

given layer(test) I expect: node.type === LAYER or node.type === FUNCTION and node.first_child.type === LAYER_NAME

Contributor guide

No contributing guide indexed for this repository

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 at parse_atrule_prelude('import', params) and inspect the AST node type definitions used by the loop. Verify the representation produced for layer(test); done means callers can identify the layer without searching for LAYER_NAME, using either a LAYER node or a FUNCTION node whose first child is LAYER_NAME.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.