aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-09-06 14:26:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-09-06 14:26:05 -0700
commit921a5d81d1c8a6edb35a0614049161901ef6ec74 (patch)
treeb0fc52bc8878b0120c1468dcbba577f23c4ec09d /src/analyzer.js
parentd52f7f8a7b05c5b46fc99526cd8a6b2bf270bc85 (diff)
handle anonymous packed struct types
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 6bee2da5..bcab0fad 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -129,12 +129,14 @@ function analyzer(data) {
}
// anonymous structure definition, for example |{ i32, i8*, void ()*, i32 }|
- if (type[0] == '{') {
+ if (type[0] == '{' || type[0] == '<') {
+ var packed = type[0] == '<';
Types.types[type] = {
name_: type,
- fields: splitTokenList(tokenize(type.substr(2, type.length-4)).tokens).map(function(segment) {
+ fields: splitTokenList(tokenize(type.substr(2 + packed, type.length - 4 - 2*packed)).tokens).map(function(segment) {
return segment[0].text;
}),
+ packed: packed,
lineNum: '?'
};
return;