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
<!doctype> | |
<html> | |
<head> | |
<title>Component Example</title> | |
<link rel="stylesheet" href="bundle.css"> | |
<style> | |
body { | |
padding: 10px; | |
} | |
</style> |
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
<!doctype> | |
<html> | |
<head> | |
<title>Component Example</title> | |
<link rel="stylesheet" href="bundle.css"> | |
<style> | |
body { | |
padding: 10px; | |
} | |
</style> |
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
<!doctype> | |
<html> | |
<head> | |
<title>Component Example</title> | |
<link rel="stylesheet" href="bundle.css"> | |
<style> | |
body { | |
padding: 10px; | |
} | |
</style> |
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
<!doctype> | |
<html> | |
<head> | |
<title>Component Example</title> | |
<link rel="stylesheet" href="bundle.css"> | |
<style> | |
body { | |
padding: 10px; | |
} | |
</style> |
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
#[crate_type = "lib"]; | |
#[allow(ctypes)]; | |
use std::c_str; | |
use std::libc; | |
use std::ptr; | |
use std::vec; | |
struct PyObject; |
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
macro jsx { | |
case { _ $body } => { | |
var transform = require('react-tools').transform; | |
var body = #{ $body }[0].token.value.raw; | |
var transformed = transform('/** @jsx React.DOM */' + body).slice(21); | |
var tokens = parser.read(transformed); | |
tokens.pop(); // EOF | |
return tokens; | |
} | |
} |
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
macro __rejectAwait { | |
case { _ $body ... } => { | |
letstx $await = [makeIdent('await', #{$body ...}[0])]; | |
return #{ | |
macro $await { | |
case { $name:ident $e:expr } => { | |
throwSyntaxError('await', 'cannot use await keyword outside of async function', #{$name}); | |
} | |
} | |
$body ... |
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
macro emitQuery { | |
case { _ $id:ident } => { | |
letstx $name = [makeValue(#{$id}[0].token.value, #{$id})]; | |
letstx $registry = [makeIdent('registry', #{$id})]; | |
return #{ var $id = $registry.query($name) } | |
} | |
} | |
macro inject { | |
case { _ $id:ident (,) ... { $body ...} } => { |
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
macro makeString { | |
case { _ $tok } => { | |
return [makeValue(#{$tok}[0].token.value, #{here})] | |
} | |
} | |
macro qw { | |
rule { ($delimited ...) } => { [$(makeString $delimited) (,) ...] } | |
} | |
qw(space separated words) // ["space", "separated", "words"] |
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
var theme = require('my-theme'); | |
module.exports = style { | |
background-color: {theme.bgColor}; | |
} |