Hot to compare source code with different multiling formatting?

B

bad.skipper

All,

I am merging two versions of source code.

First version has all lines (commands) are less than 80 letters. If
command was longer, it was split between two lines:

for example:

funtion( parameter1, parameter1, parameter1, parameter1,
parameter5, parameter6 );


Second version was edited without limit of 80 letters per line, so in
secodn version we will see only one line:

funtion( parameter1, parameter1, parameter1, parameter1, parameter5,
parameter6 );

All comparision tools that I have tried, including WinMerge are
showing this as difference! I was trying with RegEx filter in WinMerge
to filter out end of line inside commands but it did not worked).

I am looking for tool to compare C source code independet of multiline
split.

thanks in advance,

Adamovski
 
J

jacob navia

All,

I am merging two versions of source code.

First version has all lines (commands) are less than 80 letters. If
command was longer, it was split between two lines:

for example:

funtion( parameter1, parameter1, parameter1, parameter1,
parameter5, parameter6 );


Second version was edited without limit of 80 letters per line, so in
secodn version we will see only one line:

funtion( parameter1, parameter1, parameter1, parameter1, parameter5,
parameter6 );

All comparision tools that I have tried, including WinMerge are
showing this as difference! I was trying with RegEx filter in WinMerge
to filter out end of line inside commands but it did not worked).

I am looking for tool to compare C source code independet of multiline
split.

thanks in advance,

Adamovski

I developed a tool like that for my IDE lcc-win. The basic algorithm was
to transform all the input into a standard form:
o All text was transformed into a single line
o All redundant spaces were removed
o Lines were then splitted at approximately 80 characters with the
splitting never splitting an identifier of course.

THEN the files were compared. Obviously, you have to keep track of
where a line started in the original file, and where it ended.

All in all it wasn't an easy development. I would say it took me around
2 days of work.
 
G

Guest

All,

I am merging two versions of source code.

First version has all lines (commands) are less than 80 letters. If
command was longer, it was split between two lines:

for example:

funtion( parameter1, parameter1, parameter1, parameter1,
           parameter5, parameter6 );

Second version was edited without limit of 80 letters per line, so in
secodn version we will see only one line:

funtion( parameter1, parameter1, parameter1, parameter1, parameter5,
parameter6 );

All comparision tools that I have tried, including WinMerge are
showing this as difference! I was trying with RegEx filter in WinMerge
to filter out end of line inside commands but it did not worked).

I am looking for tool to compare C source code independet of multiline
split.

could you put them into a connonical form (standard layout)
before you try and do the merge?
 
R

robertwessel2

All,

I am merging two versions of source code.

First version has all lines (commands) are less than 80 letters. If
command was longer, it was split between two lines:

for example:

funtion( parameter1, parameter1, parameter1, parameter1,
           parameter5, parameter6 );

Second version was edited without limit of 80 letters per line, so in
secodn version we will see only one line:

funtion( parameter1, parameter1, parameter1, parameter1, parameter5,
parameter6 );

All comparision tools that I have tried, including WinMerge are
showing this as difference! I was trying with RegEx filter in WinMerge
to filter out end of line inside commands but it did not worked).

I am looking for tool to compare C source code independet of multiline
split.


Run both versions through a pretty-printer, and then compare them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,097
Latest member
RayE496148
Top