Skip to content

Commit

Permalink
parse function argument metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Aug 22, 2016
1 parent 84d2a4a commit b4359af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/haxeparser/HaxeParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,10 @@ class HaxeParser extends hxparse.Parser<HaxeTokenSource, Token> implements hxpar
}

function parseFunParam() {
var meta = parseMeta();
return switch stream {
case [{tok:Question}, id = ident(), t = parseTypeOpt(), c = parseFunParamValue()]: { name: id.name, opt: true, type: t, value: c};
case [id = ident(), t = parseTypeOpt(), c = parseFunParamValue()]: { name: id.name, opt: false, type: t, value: c};
case [{tok:Question}, id = ident(), t = parseTypeOpt(), c = parseFunParamValue()]: { name: id.name, opt: true, type: t, value: c, meta: meta };
case [id = ident(), t = parseTypeOpt(), c = parseFunParamValue()]: { name: id.name, opt: false, type: t, value: c, meta: meta };

}
}
Expand Down
3 changes: 2 additions & 1 deletion test/DefinitionConverter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class DefinitionConverter {
name: arg.name,
opt: arg.opt,
type: arg.type,
value: null
value: null,
meta: []
})
});
}
Expand Down

0 comments on commit b4359af

Please sign in to comment.