-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue fleshing out
{{-in-element
.
- Loading branch information
Robert Jackson
committed
Sep 25, 2016
1 parent
c5867c7
commit ad19235
Showing
9 changed files
with
515 additions
and
29 deletions.
There are no files selected for viewing
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
34 changes: 34 additions & 0 deletions
34
packages/glimmer-runtime/lib/syntax/builtins/in-element.ts
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,34 @@ | ||
import { | ||
Statement as StatementSyntax | ||
} from '../../syntax'; | ||
|
||
import OpcodeBuilderDSL from '../../compiled/opcodes/builder'; | ||
import * as Syntax from '../core'; | ||
import Environment from '../../environment'; | ||
|
||
export default class InElementSyntax extends StatementSyntax { | ||
type = "in-element-statement"; | ||
|
||
public args: Syntax.Args; | ||
public templates: Syntax.Templates; | ||
public isStatic = false; | ||
|
||
constructor({ args, templates }: { args: Syntax.Args, templates: Syntax.Templates }) { | ||
super(); | ||
this.args = args; | ||
this.templates = templates; | ||
} | ||
|
||
compile(dsl: OpcodeBuilderDSL, env: Environment) { | ||
let { args, templates } = this; | ||
|
||
dsl.block({ templates, args }, (dsl, BEGIN, END) => { | ||
dsl.putArgs(args); | ||
dsl.test('simple'); | ||
dsl.jumpUnless(END); | ||
dsl.pushRemoteElement(); | ||
dsl.evaluate('default'); | ||
dsl.popRemoteElement(); | ||
}); | ||
} | ||
} |
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.