From 60d985370e63cb3b4c68489fc54276d8ac2b921b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 11 Mar 2010 19:19:33 -0800 Subject: Add startswith/endswith helpers Inspired by the Python equivalents, these new utility functions just make it a little cleaner to match at the beginning or end of a string. --- tapset-mark.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tapset-mark.cxx') diff --git a/tapset-mark.cxx b/tapset-mark.cxx index 5c5fb0ce..c672dc7a 100644 --- a/tapset-mark.cxx +++ b/tapset-mark.cxx @@ -187,7 +187,7 @@ mark_var_expanding_visitor::visit_target_symbol (target_symbol* e) if (e->addressof) throw semantic_error("cannot take address of marker variable", e->tok); - if (e->base_name.substr(0,4) == "$arg") + if (startswith(e->base_name, "$arg")) visit_target_symbol_arg (e); else if (e->base_name == "$format" || e->base_name == "$name" || e->base_name == "$$parms" || e->base_name == "$$vars") -- cgit