Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added HDL (Hardware Description Language) support #1710

Merged
merged 6 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/prism-nand2tetris-hdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Prism.languages['nand2tetris-hdl'] = {
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
'keyword': /\b(?:CHIP|IN|OUT|PARTS|BUILTIN|CLOCKED)\b/,
'boolean': /\b(?:true|false)\b/,
'function': /[A-Za-z][A-Za-z0-9]*(?=\()/,
RunDevelopment marked this conversation as resolved.
Show resolved Hide resolved
'number': /\b\d+\b/,
'operator': /=|\.\./,
'punctuation': /[{}[\];(),:]/
Expand Down
2 changes: 1 addition & 1 deletion components/prism-nand2tetris-hdl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tests/languages/nand2tetris-hdl/function_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
And()
not()
mux16()

----------------------------------------------------

[
["function", "And"],
["punctuation", "("],
["punctuation", ")"],

["function", "not"],
["punctuation", "("],
["punctuation", ")"],

["function", "mux16"],
["punctuation", "("],
["punctuation", ")"]
]

----------------------------------------------------

Checks for functions.