Created
March 25, 2010 14:40
-
-
Save jstrachan/343619 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate(fragments: List[PageFragment]):Unit = { | |
| val (imports, others) = fragments.partition(isImportStatement) | |
| imports.foreach{ generate(_) } | |
| others.foreach{ generate(_) } | |
| } | |
| def isImportStatement(fragment: PageFragment) = fragment match { | |
| case s: ScriptletFragment if (s.code.trim.startsWith("import ")) => true | |
| case _ => false | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment