From 87de8060633801d3793246967f43c6159b0f5351 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 4 Nov 2008 22:55:22 +0000 Subject: astyle --- src/core/token.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'src/core/token.c') diff --git a/src/core/token.c b/src/core/token.c index 16d0eab..6a9d966 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/core/token.c *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ @@ -319,8 +319,8 @@ void token_copy_vals(Token *p_token_to, Token *p_token_from) { p_token_to->c_filename = p_token_from->c_filename; if (NULL != p_token_from->p_array) - // Copy all tokens by reference (pointers) - p_token_to->p_array = array_new_copy(p_token_from->p_array); + // Copy all tokens by reference (pointers) + p_token_to->p_array = array_new_copy(p_token_from->p_array); } void @@ -350,7 +350,7 @@ token_delete(Token *p_token) { if (p_token->c_val) free(p_token->c_val); - if (NULL != p_token->p_array) + if (NULL != p_token->p_array) array_delete_iterate(p_token->p_array, token_delete_cb); free(p_token); @@ -397,6 +397,9 @@ token_print_val(Token *p_token) { case TT_STRING: printf("(%s, %s)", tt_get_name(tt), token_get_val(p_token)); break; + case TT_ARRAY: + printf("(%s, size:%d)", tt_get_name(tt), array_get_size(p_token->p_array)); + break; default: ERROR("Ouups(%s)!", tt_get_name(tt)); } -- cgit v1.2.3