private NativeImport createPostImport(Import importSource) { StringBuilder postSource = new StringBuilder(); // $jsass-void: jsass_import_stack_pop() !global; postSource.append("$jsass-void: jsass_import_stack_pop() !global;\n"); try { return new NativeImport( new Import( new URI(importSource.getAbsoluteUri() + "/JSASS_POST_IMPORT.scss"), new URI(importSource.getAbsoluteUri() + "/JSASS_POST_IMPORT.scss"), postSource.toString())); } catch (URISyntaxException e) { throw new RuntimeException(e); } }
private NativeImport createPreImport(Import importSource) { int id = importStack.register(importSource); StringBuilder preSource = new StringBuilder(); // $jsass-void: jsass_import_stack_push(<id>) !global; preSource.append(String.format("$jsass-void: jsass_import_stack_push(%d) !global;\n", id)); try { return new NativeImport( new Import( new URI(importSource.getAbsoluteUri() + "/JSASS_PRE_IMPORT.scss"), new URI(importSource.getAbsoluteUri() + "/JSASS_PRE_IMPORT.scss"), preSource.toString())); } catch (URISyntaxException e) { throw new RuntimeException(e); } }