-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up the demo now that it is working as intended!
- Loading branch information
Showing
6 changed files
with
69 additions
and
197 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
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,52 @@ | ||
export type SupportedLanguage = keyof typeof examples; | ||
|
||
const examples = { | ||
hack: `<?hh // strict | ||
type SomeShape = shape( | ||
'frame_type' => FrameType, | ||
?'commit_id' => ?string, | ||
); | ||
abstract final class ClassDefWithLotsOfKeywords { | ||
const int BIG_NUMBER = 30000000; | ||
public static async function genRender(): Awaitable<Stuff> { | ||
return <xhp:div> | ||
hello world | ||
</xhp:div>; | ||
} | ||
} | ||
`, | ||
html: `<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
</body> | ||
</html> | ||
`, | ||
javascript: `\ | ||
const React = require('react'); | ||
function create() { | ||
return ( | ||
<div> | ||
hello world | ||
</div> | ||
); | ||
} | ||
`, | ||
python: `\ | ||
import foo | ||
async def bar(): string: | ||
f = await foo() | ||
f_string = f"Hooray {f}! format strings are not supported in current Monarch grammar" | ||
return foo_string | ||
`, | ||
}; | ||
|
||
export function getSampleCodeForLanguage(language: keyof typeof examples): string { | ||
return examples[language]; | ||
} |
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