New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hyperloop-macros

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperloop-macros - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

40

obj-c.js

@@ -7,4 +7,12 @@ macro use {

macro as {
rule infix { $l:lit | $r:objc_type_name } => {
$l.cast($r)
}
rule infix { $l:ident | $r:objc_type_name } => {
($l != null) && $l.cast($r)
}
rule infix { $l:expr | $r:objc_type_name } => {
(($l != null) && $l.cast($r))
(function (v) {
return (v != null) && v.cast($r);
})($l)
}

@@ -138,2 +146,31 @@ }

macroclass objc_message_param_alias {
pattern { rule { $part $[:] $arg:expr } }
}
macro (@) {
case infix {
$receiver:expr | $ctx $method ( $first:expr , $rest:objc_message_param_alias (,) ... )
} => {
var parts = #{ $rest$part ... };
var name = #{ $method }.concat(#{ $rest$part ... }).map(unwrapSyntax).concat('').join(':');
letstx $name = [ makeValue(name, #{ $ctx }) ];
return #{ Hyperloop.method($receiver, $name).call( $first, $($rest$arg) (,) ... ) };
}
case infix {
$receiver:expr | $ctx $method ( $first:expr )
} => {
var name = unwrapSyntax(#{ $method }) + ':';
letstx $name = [ makeValue(name, #{ $ctx }) ];
return #{ Hyperloop.method($receiver, $name).call( $first ) };
}
case infix {
$receiver:expr | $ctx $method ( )
} => {
var name = unwrapSyntax(#{ $method });
letstx $name = [ makeValue(name, #{ $ctx }) ];
return #{ Hyperloop.method($receiver, $name).call( ) };
}
}
// Public

@@ -144,2 +181,3 @@

export class;
export (@);

@@ -146,0 +184,0 @@ // Protected

2

package.json
{
"name": "hyperloop-macros",
"version": "0.1.1",
"version": "0.2.0",
"description": "Macros to accelerate Hyperloop development",

@@ -5,0 +5,0 @@ "scripts": {

@@ -44,2 +44,8 @@ Hyperloop Macros

locations = locations as (NSArray *);
// Message passing is activated with `@` in dot-notation style
locationManager@startUpdatingLocation();
// Since the second argument we follow Swift’s form
locationManager@allowDeferredLocationUpdatesUntilTraveled(null, timeout: null);
}

@@ -46,0 +52,0 @@ }

@@ -84,9 +84,16 @@

console.log( objc_type_name (UIWindow * *) )
console.log( objc_type_name ((UIWindow*)*) )
console.log( objc_type_name (UIWindow*) )
console.log( objc_type_name (UIWindow) )
console.log( objc_type_name UIWindow )
console.log( objc_type_name 'UIWindow**' )
console.log( objc_type_name 'UIWindow*' )
console.log( objc_type_name 'UIWindow' )
console.log( objc_type_name (UIWindow * *) );
console.log( objc_type_name ((UIWindow*)*) );
console.log( objc_type_name (UIWindow*) );
console.log( objc_type_name (UIWindow) );
console.log( objc_type_name UIWindow );
console.log( objc_type_name 'UIWindow**' );
console.log( objc_type_name 'UIWindow*' );
console.log( objc_type_name 'UIWindow' );
var message;
console.log( receiver@message( ) );
console.log( receiver@message( 42 as Answer ) );
console.log( receiver@message( 42, with: 32 ) );
console.log( receiver@message( 42, with: 24, and: 58 ) );
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc