Skip to content

Commit

Permalink
扩展编译指令信息
Browse files Browse the repository at this point in the history
  • Loading branch information
chai2010 committed Jan 23, 2024
1 parent 72eda2f commit 920278c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/ast/astutil/comment_info.go
Expand Up @@ -23,6 +23,8 @@ type CommentInfo struct {
RuntimeSetter bool // #wa:runtime_setter
RuntimeSizer bool // #wa:runtime_sizer
WasmModule string // #wa:wasm-module xxx
Generic string // #wa:generic XXX[Type,...]
Operator string // #wa:operator +
}

// 获取节点关联文档
Expand Down Expand Up @@ -93,6 +95,11 @@ func ParseCommentInfo(docList ...*ast.CommentGroup) (info CommentInfo) {
if len(parts) >= 2 {
info.WasmModule = parts[1]
}

case "#wa:generic":
info.Generic = strings.Join(parts[1:], " ")
case "#wa:operator":
info.Operator = strings.Join(parts[1:], " ")
}
}
}
Expand Down

0 comments on commit 920278c

Please sign in to comment.