Support LESS comma separated guard logical operators

オープン
#370 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
css, javascript
領域
tooling

調査の方向性

The bug shows up in processSync from postcss-selector-parser, which splits the LESS guard .mixin(@a) when (@a > 10), (@a < -10) into two selectors where one is expected. Start by running the reproduction from the issue and inspecting the nodes output, then find where the parser decides a comma ends a selector, probably the code that handles parentheses. Done means that input returns a single selector and a regression test for the guard case passes.

索引モデルが issue の本文から書いたものです。

説明

Guard Logical Operators

.mixin(@a) when (@a > 10), (@a < -10) {  }

The selector should be parsed as one selector instead of two

> require('postcss-selector-parser')(selectors => console.log(selectors.nodes)).processSync('.mixin(@a) when (@a > 10), (@a < -10)')
<ref *1> [
  Selector {
    source: { start: [Object], end: [Object] },
    sourceIndex: 0,
    spaces: { before: '', after: '' },
    nodes: [ [ClassName], [Combinator], [Tag], [Combinator] ],
    type: 'selector',
    parent: Root {
      source: [Object],
      spaces: [Object],
      nodes: [Circular *1],
      type: 'root',
      _error: [Function (anonymous)]
    }
  },
  Selector {
    source: { start: [Object], end: [Object] },
    sourceIndex: 26,
    spaces: { before: '', after: '' },
    nodes: [ [String] ],
    type: 'selector',
    parent: Root {
      source: [Object],
      spaces: [Object],
      nodes: [Circular *1],
      type: 'root',
      _error: [Function (anonymous)]
    }
  }
]
主要言語
JavaScript
スター
217
フォーク
89
平均マージ
2日 1時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

postcss/postcss-selector-parser のほかの issue

postcss/postcss-selector-parser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。