-
Notifications
You must be signed in to change notification settings - Fork 2
Exact func externtypes types #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: struct-new-desc-syntax-validation
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,9 @@ | |
| ;; TODO(3, rossberg): add ability to do this inline | ||
| syntax null hint(show NULL) hint(macro "%" "%") = NULL | ||
|
|
||
| syntax exact hint(desc "exactness") = | ||
| | EXACT | INEXACT | ||
|
|
||
| syntax addrtype hint(desc "address type") = | ||
| | I32 | I64 | ||
|
|
||
|
|
@@ -32,6 +35,8 @@ syntax rectype hint(desc "recursive type") ;; forward decl | |
| syntax deftype hint(desc "defined type") = | ||
| | _DEF rectype n hint(show %.%) | ||
|
|
||
| syntax exactdeftype hint(show (exact deftype)) = exact deftype | ||
|
|
||
| syntax typeuse/syn hint(desc "type use") = | ||
| | _IDX typeidx | ... | ||
| syntax typeuse/sem = | ||
|
|
@@ -85,6 +90,12 @@ def $NULLEXNREF = (REF NULL NOEXN) | |
| def $NULLEXTERNREF = (REF NULL NOEXTERN) | ||
|
|
||
|
|
||
| def $exactheaptype(exact, typeuse) : heaptype | ||
|
|
||
| def $exactheaptype(EXACT, typeuse) = EXACT typeuse | ||
| def $exactheaptype(INEXACT, typeuse) = typeuse | ||
|
Comment on lines
+93
to
+96
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having the externtype and context store explicitly Do you have a recommendation for how to simplify this? I'm thinking that maybe we should be using |
||
|
|
||
|
|
||
| ;; Packed types | ||
|
|
||
| syntax packtype hint(desc "packed type") = I8 | I16 | ||
|
|
@@ -141,7 +152,7 @@ syntax datatype hint(desc "data type") = OK hint(macro "%data") | |
| syntax elemtype hint(desc "element type") = reftype | ||
|
|
||
| syntax externtype hint(desc "external type") hint(macro "%" "XT%") = | ||
| | TAG tagtype | GLOBAL globaltype | MEM memtype | TABLE tabletype | FUNC typeuse | ||
| | TAG tagtype | GLOBAL globaltype | MEM memtype | TABLE tabletype | FUNC exact typeuse | ||
|
|
||
| syntax moduletype hint(desc "module type") = | ||
| externtype* -> externtype* hint(macro "toM") | ||
|
|
@@ -156,6 +167,7 @@ var at : addrtype | |
| ;; var bt : blocktype ;; defined below | ||
| var ct : comptype | ||
| var dt : deftype | ||
| var edt : exactdeftype | ||
| var et : elemtype | ||
| var ft : fieldtype | ||
| var gt : globaltype | ||
|
|
@@ -315,7 +327,7 @@ def $tagsxt(externtype*) : tagtype* hint(show $tags(%)) hint(macro "ta | |
| def $globalsxt(externtype*) : globaltype* hint(show $globals(%)) hint(macro "globalsxt") | ||
| def $memsxt(externtype*) : memtype* hint(show $mems(%)) hint(macro "memsxt") | ||
| def $tablesxt(externtype*) : tabletype* hint(show $tables(%)) hint(macro "tablesxt") | ||
| def $funcsxt(externtype*) : deftype* hint(show $funcs(%)) hint(macro "funcsxt") | ||
| def $funcsxt(externtype*) : exactdeftype* hint(show $funcs(%)) hint(macro "funcsxt") | ||
|
|
||
| def $tagsxt(eps) = eps | ||
| def $tagsxt((TAG jt) xt*) = jt $tagsxt(xt*) | ||
|
|
@@ -334,7 +346,7 @@ def $tablesxt((TABLE tt) xt*) = tt $tablesxt(xt*) | |
| def $tablesxt(externtype xt*) = $tablesxt(xt*) -- otherwise | ||
|
|
||
| def $funcsxt(eps) = eps | ||
| def $funcsxt((FUNC dt) xt*) = dt $funcsxt(xt*) | ||
| def $funcsxt((FUNC exact dt) xt*) = (exact dt) $funcsxt(xt*) | ||
| def $funcsxt(externtype xt*) = $funcsxt(xt*) -- otherwise | ||
|
|
||
|
|
||
|
|
@@ -436,7 +448,7 @@ def $subst_externtype((TAG jt), tv*, tu*) = TAG $subst_tagtype(jt, tv*, tu*) | |
| def $subst_externtype((GLOBAL gt), tv*, tu*) = GLOBAL $subst_globaltype(gt, tv*, tu*) | ||
| def $subst_externtype((TABLE tt), tv*, tu*) = TABLE $subst_tabletype(tt, tv*, tu*) | ||
| def $subst_externtype((MEM mt), tv*, tu*) = MEM $subst_memtype(mt, tv*, tu*) | ||
| def $subst_externtype((FUNC dt), tv*, tu*) = FUNC $subst_deftype(dt, tv*, tu*) | ||
| def $subst_externtype((FUNC exact dt), tv*, tu*) = FUNC exact $subst_deftype(dt, tv*, tu*) | ||
|
|
||
| def $subst_moduletype(xt_1* -> xt_2*, tv*, tu*) = $subst_externtype(xt_1, tv*, tu*)* -> $subst_externtype(xt_2, tv*, tu*)* | ||
|
|
||
|
|
@@ -598,7 +610,7 @@ def $free_externtype(TAG tagtype) = $free_tagtype(tagtype) | |
| def $free_externtype(GLOBAL globaltype) = $free_globaltype(globaltype) | ||
| def $free_externtype(MEM memtype) = $free_memtype(memtype) | ||
| def $free_externtype(TABLE tabletype) = $free_tabletype(tabletype) | ||
| def $free_externtype(FUNC typeuse) = $free_typeuse(typeuse) | ||
| def $free_externtype(FUNC exact typeuse) = $free_typeuse(typeuse) | ||
|
|
||
| def $free_moduletype(externtype_1* -> externtype_2*) = | ||
| $free_list($free_externtype(externtype_1)*) ++ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These macros need to be fixed up with proper cross references after some of the questions below are answered.