On Tue, Feb 11, 2014 at 15:54:40 -0500, Brad King wrote:
> Why does each level in the openstack need to hold its "lookup"
> member?  Can't everything be stored in-place in the work buffer?
> Each openstack level just needs to track the start character in
> the work buffer.  When that level is closed the work buffer
> should contain the exact lookup string from the open position
> to the end.  Then PUSH((x)) can be replaced with just
> "work.append(x)".

The problem is stuff like x${CMAKE_${LANG}_FLAGS}. While parsing, we
need to store "x" in the result, then "CMAKE_" in another place. When
"LANG" is expanded, it goes into the "CMAKE_" buffer which can't be
stored in-place anymore. When the last '}' is reached, we take the
latest buffer, put the last parts to parse into it then lookup that
variable.

Some things that have crossed my mind for further changes is to just
store the result at the bottom of the stack and check that .size() == 1
at the end. This avoids .empty() checks for each hunk and makes the code
smaller. Some logic last/lookup.start when the lookup string is empty
could also possibly be changed, but I've haven't done so yet.

--Ben
-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to