Lasso Soft Inc. > Home

[tags_findcustom]

Linktags_findcustom
AuthorJason Huck
CategoryTags
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted28 May 2006
Updated28 May 2006
More by this author...

Description

Parses the supplied raw Lasso code and returns a set containing all the custom tags used in it. Requires [tags_native].

Sample Usage

// the tag [image_scalewithin] uses [math_proportion]

var('data') = include_raw('/path/to/image_scalewithin.inc');	
tags_findcustom(#data);


-> set: math_proportion

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'findcustom',
	-namespace='tags_',
	-req='code',
	-priority='replace',
	-description='Parses the supplied raw Lasso code and returns a set containing all the custom tags used in it.'
);
	local('tokens') = lasso_parser(
		#code,
		-delimiters,
		-plaintext
	);
	
	local(
		'tags' = set,
		'lastToken' = ''
	);
		
	while(#tokens->hasmore);
		local('name' = #tokens->next);
		
		if(
			#tokens->tokentype == 'KEYWORD' 
			&& !#name->beginswith('/') 
			&& (: '#', '$', '->') !>> #lastToken 
			&& tags_native !>> #name
		);
			#tags->insert(#name);
		/if;
		
		#lastToken = #name;
	/while;
	
	return(#tags);
/define_tag;

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft