Skip to content

空白を受けつけない部分でブロックコメントが許容される #1030

Description

@takejohn

以下のように、配列の添え字表記や名前空間のパス、ラベルの構文の中にブロックコメントを挿入しても文法エラーにならず、実行できます。
コメントも空白と同じ扱いにしてエラーを出した方が意図通り?

let array = [0, 1, 2]
array/* comment */[0]

// array [0]
//       ^ Syntax: Multiple statements cannot be placed on a single line.


Core/* comment */:type(0)
// Core :type(0)
//      ^ Syntax: Cannot use spaces in a reference.


#label: loop {
	break #/* comment */label

 	// break # label
	//         ^ Syntax: cannot use spaces in a label
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions