File: blah.go

package info (click to toggle)
golang-github-wellington-go-libsass 0.9.2%2Bgit20181130.4ef5b9d-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,128 kB
  • sloc: cpp: 28,607; ansic: 839; makefile: 44
file content (38 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"fmt"

	"github.com/wellington/go-libsass/libs"
)

func main() {
	//run("blah.scss")
	run("error.scss")
}

func run(path string) {

	//cheads := libs.SassMakeImporterList(1)

	gofc := libs.SassMakeFileContext(path)
	// goopts := libs.SassFileContextGetOptions(gofc)
	// libs.SassOptionSetCHeaders(goopts, cheads)

	// libs.SassOptionSetOutputStyle(goopts, 2)
	// Set options
	// libs.SassFileContextSetOptions(gofc, goopts)

	goctx := libs.SassFileContextGetContext(gofc)
	gocomp := libs.SassMakeFileCompiler(gofc)
	defer libs.SassDeleteCompiler(gocomp)

	libs.SassCompilerParse(gocomp)
	libs.SassCompilerExecute(gocomp)
	gostr := libs.SassContextGetOutputString(goctx)
	fmt.Println(gostr)
	errStatus := libs.SassContextGetErrorStatus(goctx)
	if errStatus > 0 {
		fmt.Println("error:", libs.SassContextGetErrorJSON(goctx))
	}
}