diff options
author | EricFromCanada <eric3knibbe@gmail.com> | 2013-02-07 14:08:15 -0500 |
---|---|---|
committer | EricFromCanada <eric3knibbe@gmail.com> | 2013-02-07 14:08:15 -0500 |
commit | 9e4ab7208e3e189943592f6ef263f23522f893ae (patch) | |
tree | ac18e8f37d7801247b6144cc3f5199f1de7d7678 /external | |
parent | abdaa1c16355df40eebb54835f0bbaaec055487b (diff) | |
download | pygments-9e4ab7208e3e189943592f6ef263f23522f893ae.tar.gz |
generator improvements
Diffstat (limited to 'external')
-rwxr-xr-x | external/lasso-builtins-generator-9.lasso | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/external/lasso-builtins-generator-9.lasso b/external/lasso-builtins-generator-9.lasso index bea8b2ab..fc6d130a 100755 --- a/external/lasso-builtins-generator-9.lasso +++ b/external/lasso-builtins-generator-9.lasso @@ -30,7 +30,7 @@ local(f) = file("lassobuiltins-9.py") #f->writeString('# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, and methods. """ @@ -42,16 +42,16 @@ lcapi_loadModules // Load all of the libraries from builtins and lassoserver // This forces all possible available types and methods to be registered local(srcs = - tie( - dir(sys_masterHomePath + 'LassoLibraries/builtins/')->eachFilePath, - dir(sys_masterHomePath + 'LassoLibraries/lassoserver/')->eachFilePath - ) + tie( + dir(sys_masterHomePath + 'LassoLibraries/builtins/')->eachFilePath, + dir(sys_masterHomePath + 'LassoLibraries/lassoserver/')->eachFilePath + ) ) with topLevelDir in #srcs -where !#topLevelDir->lastComponent->beginsWith('.') +where not #topLevelDir->lastComponent->beginsWith('.') do protect => { - handle_error => { + handle_error => { stdoutnl('Unable to load: ' + #topLevelDir + ' ' + error_msg) } library_thread_loader->loadLibrary(#topLevelDir) @@ -66,34 +66,40 @@ local( // unbound methods with method in sys_listUnboundMethods -where !#method->methodName->asString->endsWith('=') -where #method->methodName->asString->isalpha(1) -where #methodsList !>> #method->methodName->asString -do #methodsList->insert(#method->methodName->asString) +let m_name = #method->methodName->asString +where not #m_name->endsWith('=') // skip setter methods +where #m_name->isAlpha(1) // skip unpublished methods +where #methodsList !>> #m_name +do #methodsList->insert(#m_name) // traits with trait in sys_listTraits -where !#trait->asString->beginsWith('$') -where #traitsList !>> #trait->asString +let name = #trait->asString +where not #name->beginsWith('$') // skip combined traits +where #traitsList !>> #name do { - #traitsList->insert(#trait->asString) - with tmethod in tie(#trait->getType->provides, #trait->getType->requires) - where !#tmethod->methodName->asString->endsWith('=') - where #tmethod->methodName->asString->isalpha(1) - where #methodsList !>> #tmethod->methodName->asString - do #methodsList->insert(#tmethod->methodName->asString) + #traitsList->insert(#name) + with method in tie(#trait->getType->provides, #trait->getType->requires) + let m_name = #method->methodName->asString + where not #m_name->endsWith('=') // skip setter methods + where #m_name->isAlpha(1) // skip unpublished methods + where #methodsList !>> #m_name + do #methodsList->insert(#m_name) } // types with type in sys_listTypes -where #typesList !>> #type->asString +let name = #type->asString +where not #name->endsWith('$') // skip threads +where #typesList !>> #name do { - #typesList->insert(#type->asString) - with tmethod in #type->getType->listMethods - where !#tmethod->methodName->asString->endsWith('=') - where #tmethod->methodName->asString->isalpha(1) - where #methodsList !>> #tmethod->methodName->asString - do #methodsList->insert(#tmethod->methodName->asString) + #typesList->insert(#name) + with method in #type->getType->listMethods + let m_name = #method->methodName->asString + where not #m_name->endsWith('=') // skip setter methods + where #m_name->isAlpha(1) // skip unpublished methods + where #methodsList !>> #m_name + do #methodsList->insert(#m_name) } #f->writeString("BUILTINS = { |