MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / parse_arg

Function parse_arg

js/SCAST.js:308–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306 return r
307 }
308 function parse_arg(){//todo
309 if(is_sp(","))return skip_split(",");
310 if(is_punc('{'))return parse_block();
311 let n=null;
312 let prevv=input.prev()
313 if(is_id()){
314 n=input.next();
315 if(is_punc('(')){
316 return {
317 type:"CallExpression",
318 value:n.value,
319 poi:{line:n.poi.line,start:n.poi.start},
320 body:[parse_arguments()],
321 callee:prevv
322 }
323 }
324 }else if(is_kw("function")){//Anonymous Function
325 n=input.next();
326 if(is_punc('(')){
327 return {
328 type:"CallExpression",
329 value:n.value,
330 poi:{line:n.poi.line,start:n.poi.start},
331 body:[parse_arguments()],
332 callee:prevv
333 }
334 }
335 }else{
336 n=input.next();
337 }
338 return {
339 type:"Arg",
340 value:n.value,
341 node:n,
342 poi:n.poi
343 }
344 }
345 function is_define(ch){
346 var tok = input.peek();
347 var keywords=["public","private","protected","sealed","internal","static","class","interface","namespace"]

Callers 1

parse_argumentsFunction · 0.70

Calls 7

is_spFunction · 0.70
skip_splitFunction · 0.70
is_puncFunction · 0.70
parse_blockFunction · 0.70
is_idFunction · 0.70
parse_argumentsFunction · 0.70
is_kwFunction · 0.70

Tested by

no test coverage detected