当前位置:网站首页>spicy (two) unit hooks
spicy (two) unit hooks
2022-07-30 03:43:00 【a tobey】
unit hooks, the hook.Used to control parsing, track status and retrieve results.is the block of code that triggers execution during parsing and has access to the current unit instance.
Hooks are similar to functions: they are bodies that execute when triggered. These bodies can receive a set of input parameters, but unlike functions, a hook can have multiple bodies.If multiple body implementations are provided for the same hook, they will be executed in sequence.
The 7 most commonly used hooks:
# Start execution before unit parsingon %init() { ... }# Execute after unit parsing is completeon %done { ... }# Executed when a parsing error is encountered, just before the parser aborts processingon %error { ... }# Executed after cell parsing is done in any way.This hook is most useful for modifying global state that needs to be updated, regardless of whether the parsing process was successful or not.This hook is also guaranteed to execute eventually once %init fires.It will run after %done or %error respectively.(If a new error occurs during the execution of %finally, the unit's %error hook will not be triggered.)on %finally { ... }#on %print { ... }# Executed immediately after parsing the given unit field.The parsed value can be accessed via $$, possibly with any relevant type conversions applied (see Dynamic type conversions using &convert).The same content has also been assigned to this field.on { ... } (field hook)# Assuming the specified field is a container (eg, a vector), this is executed each time a new container element is parsed, and just before it is added to the container.The parsed element can be accessed via the $$ identifier and can be modified before being stored.Hook implementations can also use the stop statement to abort container resolution without adding the current element.on foreach { 边栏推荐
- 【科研工具的使用】A
- Awesome, Tencent technical experts handed Redis technical notes, and the download volume has exceeded 30W
- flutter 记录学习不一样的动画(二)
- 小程序毕设作品之微信二手交易小程序毕业设计成品(1)开发概要
- 如何有效进行回顾会议(上)?
- phpoffice 编辑excel文档
- Nacos集群分区
- Nacos achieves high availability
- Nacos cluster partition
- Overview of Federated Learning (2) - Classification, Framework and Future Research Directions of Federated Learning
猜你喜欢

小程序毕设作品之微信二手交易小程序毕业设计成品(7)中期检查报告
![[C Supplement] Conversion of Integer to String](/img/61/4261ea9bf3001dfa8deed424fce145.jpg)
[C Supplement] Conversion of Integer to String

sqlmap使用教程大全命令大全(图文)

Transformation of traditional projects

JUC (six): synchronized

分类之决策树分类

联邦学习综述(二)——联邦学习的分类、框架及未来研究方向

Awesome, Tencent technical experts handed Redis technical notes, and the download volume has exceeded 30W

小程序毕设作品之微信二手交易小程序毕业设计成品(2)小程序功能

Is the snowflake the same question?
随机推荐
Gateway routing gateway
传输层详解
JUC (four): five/six states of shorthand thread
sql中 exists的用法
Summary of Rpc and gRpc Introduction
One book 1922 - table tennis
Sentinel 流量防卫兵
微服务CAP原则
LoadBalancer load balancing
写给技术人的管理入门知识1:什么是管理
对均匀采样信号进行重采样
小程序毕设作品之微信二手交易小程序毕业设计成品(1)开发概要
智能答题功能,CRMEB知识付费系统必须有!
进程优先级 nice
TCP congestion control technology and acceleration principle of BBR
测试人员,除了测试还得会点什么
计划处理链的很多种情况
联邦学习综述(二)——联邦学习的分类、框架及未来研究方向
EasyCVR启动时报错“no such file or directory”,该如何解决?
小程序毕设作品之微信积分商城小程序毕业设计成品(6)开题答辩PPT