Skip to content

静的な式がラベル付きの式を許容する #993

@poppingmoon

Description

@poppingmoon

parseExprisStatictrue のとき、if式などは許容されませんが、ラベルがついていると許容されます。

case TokenKind.Sharp: {
return parseExprWithLabel(s);
}

### meta_name #label: if true {
	<: 1	
}

#[attr_name #label: eval {
	<: 2	
}]
@_() {}

### {
	key: #label: match x {
	  default => {
	    <: 3
	    Core:ai
	  }
  }  
}

:: ns {
  #[attr_name #label: if true {
	  <: 4
  }]
  let _ = 1
}

https://aiscript-dev.github.io/playground.html (AiScript v1.2.0) で実行

出力

2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions