node/lib/metasm/metasm/preprocessor.rb
def parse_intfloat(lexer, tok)
			if tok.type == :string and tok.raw == 'defined'
				nil while ntok = lexer.readtok_nopp and ntok.type == :space
				raise tok if not ntok
				if ntok.type == :punct and ntok.raw == '('
					nil while ntok = lexer.readtok_nopp and ntok.type == :space
					nil while rtok = lexer.readtok_nopp and rtok.type == :space
					raise tok if not rtok or rtok.type != :punct or rtok.raw != ')'
				end
				raise tok if not ntok or ntok.type != :string
				tok.value = lexer.definition[ntok.raw] ? 1 : 0
				return
			elsif tok.type == :string and tok.raw == 'L'
				ntok = lexer.readtok_nopp
				if ntok.type == :quoted and ntok.raw[0] == ?'
					tok.raw << ntok.raw
					tok.value = (ntok.value + "\0\0").unpack('v')	# XXX endianness
				else
					lexer.unreadtok ntok
				end
			end

			Expression.parse_num_value(lexer, tok)
		end
# handles floats and "defined" keyword
handles floats and "defined" keyword
handles floats and " defined " keyword
def parse_intfloat(lexer, tok)
			if tok.type == :string and tok.raw == 'defined'
				nil while ntok = lexer.readtok_nopp and ntok.type == :space
				raise tok if not ntok
				if ntok.type == :punct and ntok.raw == '('
					nil while ntok = lexer.readtok_nopp and ntok.type == :space
					nil while rtok = lexer.readtok_nopp and rtok.type == :space
					raise tok if not rtok or rtok.type != :punct or rtok.raw != ')'
				end
				raise tok if not ntok or ntok.type != :string
				tok.value = lexer.definition[ntok.raw] ? 1 : 0
				return
			elsif tok.type == :string and tok.raw == 'L'
				ntok = lexer.readtok_nopp
				if ntok.type == :quoted and ntok.raw[0] == ?'
					tok.raw << ntok.raw
					tok.value = (ntok.value + "\0\0").unpack('v')	
				else
					lexer.unreadtok ntok
				end
			end
			Expression.parse_num_value(lexer, tok)
		end
def parse_intfloat ( lexer , tok ) if tok . type == :string and tok . raw == 'defined' nil while ntok = lexer . readtok_nopp and ntok . type == :space raise tok if not ntok if ntok . type == :punct and ntok . raw == '(' nil while ntok = lexer . readtok_nopp and ntok . type == :space nil while rtok = lexer . readtok_nopp and rtok . type == :space raise tok if not rtok or rtok . type != :punct or rtok . raw != ')' end raise tok if not ntok or ntok . type != :string tok . value = lexer . definition [ ntok . raw ] ? 1 : 0 return elsif tok . type == :string and tok . raw == 'L' ntok = lexer . readtok_nopp if ntok . type == :quoted and ntok . raw [ 0 ] == ?' tok . raw << ntok . raw tok . value = ( ntok . value + "\0\0" ) . unpack ( 'v' ) else lexer . unreadtok ntok end end Expression . parse_num_value ( lexer , tok ) end
handles floats and "defined" keyword
handles floats and " defined " keyword
# XXX endianness
lexer
tok