spellIntrinsic()
함수, 백엔드 분류
Spells a call for one target.
import { spellIntrinsic } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
function spellIntrinsic( target: IntrinsicTarget, name: string, args: readonly string[],): string매개변수
targetIntrinsicTargetThe target to spell for,
'wgsl'or'glsl'.namestringThe builtin id or function name.
argsreadonly string[]The argument expressions, already rendered as source text.
반환값
string
The call as source text for target.
설명
When name has an INTRINSICS entry, returns that
entry’s spelling for target applied to args; otherwise returns name(args) with the
arguments joined by , , which covers portable builtins and user-defined function calls
alike.
예제
예제
spellIntrinsic('glsl', 'atan2', ['y', 'x']) // 'atan(y, x)'spellIntrinsic('wgsl', 'dot', ['a', 'b']) // 'dot(a, b)'함께 보기
소스
src/core/intrinsics.ts, 1026행, 커밋 c66579bf 기준