From f2db9f12682476437fe60c4a63c6d4e93e8f2258 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 13 Jul 2018 13:08:52 -0400 Subject: [PATCH 1/3] linker: Remove classifier vs. calculation distinction This is something that I thought would be useful back in the day when TAME was in its infancy, but it is not important. Rather than having the linker spend time trying to figure out what symbols belong in the classifier---and rather than keeping that complexity around---this simplifies things by making the existing `classify' method simply perform _all_ calculations, and then yield only the classification portion of the result. This isn't a problem in practice because, if we only desire the use of a classifier, then we create a "supplier" that only uses classifications and has no other dependencies. The end result is, as far as we care, the same. * src/current/compiler/js.xsl (compiler:entry-rater)[lv:package]: Initialize `classes' rather than invoking classifier (compiler:entry-classifier)[lv:package]: Invoke all calculations and return only classes to provide equivalent behavior. (compiler:exit-classifier): Post-process classifications from calculation results, iterating through classmap. (compiler:classifier-yields-map)[lv:package]: Output all classifications that are not generated. This differs slightly from the original implementation in that it includes all non-generated classes rather than just classes that have a non-generated `@yields'; this distinction is important since `compiler:exit-classifier' is now using it to produce a classification result set that doesn't contain all the generated stuff (since it didn't before, and shouldn't now). * src/current/compiler/linker.xsl: Update copyright year. (l:resolv-deps)[preproc:sym[@l:mark-inclass]]: Remove template. (l:resolv-deps)[preproc:sym...@l:mark-inclass...]: Remove template. (l:depgen-sym): Set type of result to `element(preproc:sym)', since `l:mark-inclass' is no longer produced. [inclass, needs-class-mark]: Remove variables and all instances where they are used. (l:dep-aug)[inclass]: Remove param. Stop producing `@inclass' attribute. (l:link-classifier)[lv:package]: Do not process any dependencies. This can be removed entirely in the future since it now only produces static code, which we can perhaps combine with a different block. (l:link-rater)[lv:package]: Remove mention of `inclass' for dependencies; all dependencies will now be compiled into this block. --- src/current/compiler/js.xsl | 32 +++------ src/current/compiler/linker.xsl | 113 +++----------------------------- 2 files changed, 18 insertions(+), 127 deletions(-) diff --git a/src/current/compiler/js.xsl b/src/current/compiler/js.xsl index cfc5ccfa..f975f375 100644 --- a/src/current/compiler/js.xsl +++ b/src/current/compiler/js.xsl @@ -99,9 +99,8 @@ init_defaults( args, params ); - - var classes = rater.classify( args, _canterm ); + var classes = {}; var genclasses = {}; @@ -110,34 +109,23 @@ rater.classify = function( args, _canterm ) { - _canterm = ( _canterm == undefined ) ? true : !!_canterm; - - - consts['__DATE_YEAR__'] = ( new Date() ).getFullYear(); - - - var classes = {}, genclasses = {}; - - - var req_params = {}; + return rater( args, _canterm ).classes; + }; diff --git a/src/current/compiler/linker.xsl b/src/current/compiler/linker.xsl index 0f22cc2a..cb7b4e25 100644 --- a/src/current/compiler/linker.xsl +++ b/src/current/compiler/linker.xsl @@ -2,7 +2,7 @@ - - - - - - - - -