srcML / srcML

srcML Toolkit
srcml.org
GNU General Public License v3.0
105 stars 26 forks source link

srcQL Transformations Always Assume C++ Source Code #1985

Open Joshua2000B opened 6 months ago

Joshua2000B commented 6 months ago

When using the --srcql option to apply a srcQL pattern query, srcML always treats the pattern as C++ code instead of checking against whatever unit the code is being run against.

The issue lies on the call to srcql_convert_query_to_xpath in xpathTransformation.cpp https://github.com/srcML/srcML/blob/a9f9ce909e45609c36159ced698178f410692714/src/libsrcml/xpathTransformation.cpp#L212C5-L217C6