-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Adding basic support for mathematica #2921
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
0e1edf5
Adding basic support for mathematica
msollami a3cbd9e
Update components/prism-wolfram.js
msollami decfd40
Update components/prism-wolfram.js
msollami aed5e0a
Update components/prism-wolfram.js
msollami c710dc3
Update components/prism-wolfram.js
msollami ea318c7
Moved string rule after comment to make highlighting faster.
msollami 29cfa2f
Update prism-wolfram.min.js
msollami 0302206
Update components.json
msollami ca78ed8
Adding modified build files
msollami 12a6450
Truncated list of builtins and renamed/aliased blanks and contexts
msollami 756b2bc
Adding back the aliasTitles
msollami 4aadc58
Editing regexes for blanks and global variables
msollami 0cb4f30
Update components/prism-wolfram.js
msollami c4427d2
Update prism-wolfram.js
msollami fadf27d
Fixed linting errors
msollami 50a8722
Removed unneeded alias title
msollami File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,29 @@ | ||
| Prism.languages.wolfram = { | ||
| 'comment': // Allow one level of nesting - note: regex taken from applescipt | ||
| /\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/, | ||
| 'string': { | ||
| pattern: /"(?:\\.|[^"\\\r\n])*"/, | ||
| greedy: true | ||
| }, | ||
| 'keyword': /\b(?:Abs|AbsArg|Accuracy|Block|Do|For|Function|If|Manipulate|Module|Nest|NestList|None|Return|Switch|Table|Which|While)\b/, | ||
| 'context': { | ||
| pattern: /\w+`+\w*/, | ||
| alias: 'class-name' | ||
| }, | ||
| 'blank': { | ||
| pattern: /\b\w+_\b/, | ||
| alias: 'regex' | ||
| }, | ||
| 'global-variable': { | ||
| pattern: /\$\w+/, | ||
| alias: 'variable' | ||
| }, | ||
| 'boolean': /\b(?:True|False)\b/, | ||
| 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i, | ||
| 'operator': /\/\.|\;|\=\.|\^\=|\^\:\=|\:\=|\<\<|\>\>|\<\||\|\>|\:\>|\|\-\>|\-\>|\<\-|\@\@\@|\@\@|\@|\/\@|\=\!\=|\=\=\=|\=\=|\=|\+|\-|\^|\*|\[\/-+%=]=?|\!\=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, | ||
| 'punctuation': /[\|{}[\];(),.:]/ | ||
| }; | ||
|
|
||
| Prism.languages.mathematica = Prism.languages.wolfram; | ||
| Prism.languages.wl = Prism.languages.wolfram; | ||
| Prism.languages.nb = Prism.languages.wolfram; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,31 @@ | ||
| <h2>Comments</h2> | ||
| <pre><code> | ||
| (* This is a comment *) | ||
| </code></pre> | ||
|
|
||
| <h2>Strings</h2> | ||
| <pre><code> | ||
| "foo bar baz" | ||
| </code></pre> | ||
|
|
||
| <h2>Numbers</h2> | ||
| <pre><code> | ||
| 7 | ||
| 3.14 | ||
| 10. | ||
| .001 | ||
| 1e100 | ||
| 3.14e-10 | ||
| 2147483647 | ||
| </code></pre> | ||
|
|
||
| <h2>Full example</h2> | ||
| <pre><code> | ||
| (* Most operators are supported *) | ||
| f /@ {1, 2, 3}; | ||
| f @@ Range[10]; | ||
| f @@@ y; | ||
| Module[{x=1}, | ||
| Return @ $Failed | ||
| ] | ||
| </code></pre> |
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.