연구 설문조사: Blockly 사용 경험을 알려주세요
설문조사 시작
차단 > CodeGenerator > scrub_
CodeGenerator.scrub_() 메서드
블록에서 코드를 생성하는 일반적인 작업 이는 blockToCode에서 호출되며 최상위 블록뿐만 아니라 모든 블록에서 호출됩니다. 서브클래스가 이를 재정의할 수 있습니다. 예를 들어 를 호출하여 블록 뒤의 문에 대한 코드를 생성하거나 지정된 블록 및 연결된 값 블록에 대한 주석을 처리할 수 있습니다.
서명:
scrub_(_block: Block, code: string, _opt_thisOnly?: boolean): string;
매개변수
매개변수 |
유형 |
설명 |
_block |
차단 |
현재 블록. |
코드 |
문자열 |
이 블록용으로 생성된 코드입니다. |
_opt_thisOnly |
부울 |
(선택사항) 이 문에 대한 코드만 생성하려면 True입니다. |
반환:
문자열
주석과 후속 블록이 추가된 코드
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-08-21(UTC)
[null,null,["최종 업데이트: 2024-08-21(UTC)"],[[["`scrub_()` is a method within the `CodeGenerator` class used for common code generation tasks from Blockly blocks."],["It's called for every block during code generation, allowing subclasses to customize code output for statements, comments, and connected blocks."],["The method takes the current block, generated code, and an optional flag for generating code for only the current statement as input."],["`scrub_()` returns the modified code, which may include comments and code from subsequent blocks."]]],[]]