Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from wellington/feature/builtin
Feature/builtin
- Loading branch information
Showing
276 changed files
with
37,187 additions
and
91 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package builtin | ||
|
||
import "github.com/wellington/sass/ast" | ||
|
||
type CallHandler func(args []*ast.BasicLit) (*ast.BasicLit, error) | ||
|
||
var reg func(s string, ch CallHandler) | ||
|
||
var chs = map[string]CallHandler{} | ||
|
||
func BindRegister(fn func(s string, ch CallHandler)) { | ||
reg = fn | ||
for k, v := range chs { | ||
reg(k, v) | ||
delete(chs, k) | ||
} | ||
} | ||
|
||
func Register(s string, ch CallHandler) { | ||
if reg != nil { | ||
reg(s, ch) | ||
} else { | ||
chs[s] = ch | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.