Beispiel #1
0
            except Exception, e:
                if Logs.verbose:
                    debug('preproc: line parsing failed (%s): %s %s', e, line,
                          Utils.ex_stack())


def scan(task):
    global go_absolute
    try:
        incn = task.generator.includes_nodes
    except AttributeError:
        raise Errors.WafError(
            '%r is missing a feature such as "c", "cxx" or "includes": ' %
            task.generator)
    if go_absolute:
        nodepaths = incn + standard_includes
    else:
        nodepaths = [
            x for x in incn
            if x.is_child_of(x.ctx.srcnode) or x.is_child_of(x.ctx.bldnode)
        ]
    tmp = c_parser(nodepaths)
    tmp.start(task.inputs[0], task.env)
    if Logs.verbose:
        debug('deps: deps for %r: %r; unresolved %r' %
              (task.inputs, tmp.nodes, tmp.names))
    return (tmp.nodes, tmp.names)


Utils.run_once(tokenize)
Utils.run_once(define_name)
						self.defs[define_name(line)]=line
					except:
						raise PreprocError("Invalid define line %s"%line)
				elif token=='undef':
					m=re_mac.match(line)
					if m and m.group(0)in self.defs:
						self.defs.__delitem__(m.group(0))
				elif token=='pragma':
					if re_pragma_once.match(line.lower()):
						self.ban_includes.add(self.curfile)
			except Exception ,e:
				if Logs.verbose:
					debug('preproc: line parsing failed (%s): %s %s',e,line,Utils.ex_stack())
def scan(task):
	global go_absolute
	try:
		incn=task.generator.includes_nodes
	except AttributeError:
		raise Errors.WafError('%r is missing a feature such as "c", "cxx" or "includes": '%task.generator)
	if go_absolute:
		nodepaths=incn
	else:
		nodepaths=[x for x in incn if x.is_child_of(x.ctx.srcnode)or x.is_child_of(x.ctx.bldnode)]
	tmp=c_parser(nodepaths)
	tmp.start(task.inputs[0],task.env)
	if Logs.verbose:
		debug('deps: deps for %r: %r; unresolved %r'%(task.inputs,tmp.nodes,tmp.names))
	return(tmp.nodes,tmp.names)

Utils.run_once(tokenize)
Utils.run_once(define_name)