1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Fixed name bug for macro names.

This commit is contained in:
John Camelon 2005-01-26 16:07:13 +00:00
parent f2488626d4
commit 63ffe8d959
2 changed files with 11 additions and 1 deletions

View file

@ -101,9 +101,12 @@ public class DOMLocationTests extends AST2BaseTest {
assertNotNull( macros ); assertNotNull( macros );
assertEquals( macros.length, 1 ); assertEquals( macros.length, 1 );
assertSoleLocation( macros[0], code.indexOf( "#"), code.indexOf( "0x01") + 4 - code.indexOf( "#")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ assertSoleLocation( macros[0], code.indexOf( "#"), code.indexOf( "0x01") + 4 - code.indexOf( "#")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertEquals( macros[0].getName().toString(), "FOOT" ); //$NON-NLS-1$
assertEquals( macros[0].getExpansion(), "0x01"); //$NON-NLS-1$
} }
} }
/** /**
* @param declarator * @param declarator
* @param offset * @param offset

View file

@ -186,6 +186,13 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
public char[] toCharArray() { public char[] toCharArray() {
return name; return name;
} }
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
return new String( name );
}
} }
/** /**
* @author jcamelon * @author jcamelon