shevek / jcpp

The C Preprocessor as a Java library
http://www.anarres.org/projects/jcpp/
Apache License 2.0
106 stars 36 forks source link

Make getPath() public #11

Closed shevek closed 10 years ago

shevek commented 10 years ago

https://github.com/grzegorz8/jcpp/commit/155b634edbc916a0c3a1a501634e915fd65505e0

shevek commented 10 years ago

https://github.com/ochafik/jcpp/commit/c49e907b1d101ffacb2d6150d4c075e4622cf5ce

ooxi commented 10 years ago

Could you elaborate why you propose this change?

grzegorz8 commented 10 years ago

To be able to retrieve the source file of a token, especially when the header files are included. You can handle handleSourceChange(Source, String) in PreprocessorListener and keep track of source file changes. To do that getPath() method must be public.

shevek commented 10 years ago

The trouble is, getPath() isn't exactly canonical. It was only originally intended to be used for #line markers, and I don't think it's actually well-defined.

So I need to audit it and make sure it's well-defined always before making this change.

shevek commented 10 years ago

OK, I needed this too. I see all your points. Fixed.