Comments (27)
Do you know where I can find a matlab grammar? A quick search doesn't turn one
up,
and I don't know enough about it to track down a similar language's grammar
either.
Original comment by [email protected]
on 23 Apr 2008 at 5:39
from code-prettify.
ViewVC supports matlab with the help from Highlight
(http://www.andre-simon.de/doku/highlight/en/highlight_langs.html). I attached
the
definition file from Highlight project. Hope this helps.
Original comment by [email protected]
on 24 Apr 2008 at 5:13
Attachments:
from code-prettify.
An additional complication is that Matlab and Objective-C files share the same
file
extension (.m).
Original comment by [email protected]
on 2 May 2010 at 4:54
from code-prettify.
+1
note that octave uses the same syntax
http://www.gnu.org/software/octave/
some vim/emacs modes for matlab/octave:
http://www.vim.org/scripts/script.php?script_id=1591
http://sunsite.univie.ac.at/textbooks/octave/octave_34.html
http://www.mathworks.com/matlabcentral/fileexchange/104
Original comment by [email protected]
on 28 Jun 2010 at 5:37
from code-prettify.
It looks quite bad now:
http://code.google.com/p/psychtoolbox-test/source/browse/beta/Psychtoolbox/Psych
GLImageProcessing/BitsPlusPlus.m?spec=svn1789&r=1789
There are even more matlab supporting highlighters available. Geshi has one and
WebSVN:
http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/PsychGLImageProcessing/BitsP
lusPlus.m?view=markup
There are other
Original comment by towolf
on 9 Sep 2010 at 7:07
from code-prettify.
Is anyone still working on this? Can I get involved and help develop this
highlighting scheme?
Original comment by [email protected]
on 6 Jul 2011 at 6:12
from code-prettify.
I'm not working on matlab because I don't have a grammar to work on. People
keep pointing me at VIM modes and the like but unless those are public domain
or use the same license as this project, I can't look at them.
Original comment by [email protected]
on 6 Jul 2011 at 7:10
from code-prettify.
Thanks. I'll try to compile a good document or some code for you.
Original comment by [email protected]
on 6 Jul 2011 at 7:18
from code-prettify.
Hi,
If I understand correctly, the BSD license is compatible with the Apache
License.
If so, maybe Pygment (written in Python) might be of some use: BSD licensed
(http://pygments.org/faq/#what-is-it), with a matlab lexer
(https://bitbucket.org/birkenfeld/pygments-main/src/071002c113cb/pygments/lexers
/math.py#cl-95)
HTH
Original comment by [email protected]
on 6 Sep 2011 at 4:05
from code-prettify.
Now that Berlios is closing shop, it would be cool if we got Matlab
highlighting on Google Code.
I proposed to move over to GC, but this one niggle remains:
http://code.google.com/p/psychtoolbox-test/source/browse/beta/Psychtoolbox/Updat
ePsychtoolbox.m
Original comment by towolf
on 4 Oct 2011 at 10:22
from code-prettify.
Sorry I've been unresponsive. Can you expand on what is wrong with the
formatting of UpdatePsychtoolbox.m ? I don't know matlab syntax well enough.
Is it that % comments aren't recognized as such?
Original comment by [email protected]
on 10 Oct 2011 at 9:39
from code-prettify.
It’s all wrong. I assume that is because Objective C is used (also .m).
I posted links further up to other services who highlight it up correctly.
Basically any highlighter you can find does Matlab/Octave.
Original comment by towolf
on 10 Oct 2011 at 10:27
from code-prettify.
We have migrated now: http://psychtoolbox-3.googlecode.com
What kind of help do you need, Mike? Do you want a full patch, or do you want
to do it yourself and just need hints?
Matlab syntax is not so complicated, it just needs the proper keywords and
markers. I don't know how many keywords of the standard library you want to
include.
Original comment by towolf
on 2 Nov 2011 at 11:24
from code-prettify.
I am happy to accept a patch, or if you can point me to a lexical grammar I can
do it. I don't know quite what to do about file name collisions. What google
code chooses to load is up to them, but I can talk to them and maybe they can
load the matlab version for projects that have a certain tag.
Original comment by [email protected]
on 4 Nov 2011 at 7:08
from code-prettify.
I’m not sure what consitutes a lexical grammar. Is that something you can
glean from other syntax highlighters or is it a formal definition in a defined
format?
If I would do it I would just proceed by eye.
Your tag idea is a very sensible one.
Original comment by towolf
on 5 Nov 2011 at 1:31
from code-prettify.
here you go- flex and bison files from octave (GPL matlab clone)
http://hg.savannah.gnu.org/hgweb/octave/file/tip/src/lex.ll
http://hg.savannah.gnu.org/hgweb/octave/file/tip/src/oct-parse.yy
Original comment by [email protected]
on 21 Mar 2012 at 7:48
from code-prettify.
gtksourceview's highlighter, also GPL:
http://git.gnome.org/browse/gtksourceview/tree/data/language-specs/matlab.lang
mike, can you let us know if there is any issue as far as licensing or format
for the examples we've provided?
Original comment by [email protected]
on 27 Mar 2012 at 1:12
from code-prettify.
Yes. The GPL is incompatible with the Apache 2 license. If I were to read GPL
code, translate it into another language and put an Apache 2 license on it, I
would be violating the license.
Original comment by [email protected]
on 7 Apr 2012 at 9:12
from code-prettify.
what about BSD? github uses pygments...
starting at line 251:
https://bitbucket.org/birkenfeld/pygments-main/src/5cc94956e233/pygments/lexers/
math.py
Original comment by [email protected]
on 2 Jun 2012 at 9:10
from code-prettify.
IT APPAERS THAT THIS SINTEX, CODE THAT HE WAS WORKING ON NEEDED TO BE (MAPED BY
CONTEX) first then apply simple equaison addressing as: (A- is 0000.1)-(B IS-
0000.2) THEN (J becomes 1 up by a point of a fraction ( ooo1.0 ) (T IS
001.00 AND SO EACH TEN THE POINT MOVES UP UNTILL THE BODY IS FINISHED WITH 26
ALPHFABIT THIS BECOMS A SQ,ROOT OF000.2.6 THIS IS A (CODE SINEING TABEL I HAD
LEARNED A LONG TIME AGO IN MY M O S TRAINING AT SIG, CORE I TRAINED AS A
MICRO TEC. WE HAD THINGS EVEN THEN, THAT I WONT SPEAK OF TODAY, THIS LOOKS
LIKE TO SIMPLAFY JUST BUILD A EQUA, TO APPLY ITS COM, THREDS....DONALD J
Original comment by [email protected]
on 29 Nov 2012 at 12:15
from code-prettify.
Here is my implementation of MATLAB syntax highlighting for
google-code-prettify (released under MIT license):
https://github.com/amroamroamro/prettify-matlab
Specifically:
https://github.com/amroamroamro/prettify-matlab/blob/master/js/lang-matlab.js
Original comment by [email protected]
on 4 Mar 2013 at 5:21
from code-prettify.
Sweet!!!
Original comment by [email protected]
on 4 Mar 2013 at 5:25
from code-prettify.
Great. I see a testcase in
https://github.com/amroamroamro/prettify-matlab/blob/master/demo/index.html .
I'll integrate that patch.
Original comment by [email protected]
on 4 Mar 2013 at 6:47
from code-prettify.
[deleted comment]
from code-prettify.
Yes, you can see its failing on some edge cases (nested comments)..
I had modified version in a separate branch that does not try to detect MATLAB
functions:
https://github.com/amroamroamro/prettify-matlab/blob/no_functions/js/lang-matlab
.js
This is mainly to keep file size to a minimum, as there are more than 1000
functions in core MATLAB alone:
http://www.mathworks.com/help/matlab/functionlist-alpha.html
Original comment by [email protected]
on 4 Mar 2013 at 7:14
from code-prettify.
The version from earlier is now available in release branch 4-Mar-2013, the
download list, and via the autoloader. amro^3, would you like contributor
access so you can maintain lang-matlab.js here?
Original comment by [email protected]
on 4 Mar 2013 at 8:21
- Changed state: Fixed
from code-prettify.
Great. I'm happy to maintain lang-matlab.js
Original comment by [email protected]
on 4 Mar 2013 at 8:34
from code-prettify.
Related Issues (20)
- Add support for Chapel? HOT 2
- [Feature Request] Add diff / patch highlighting support for StackExchange websites. HOT 1
- Add support for Idris
- No GitHub wiki
- Add support for Perl6 HOT 1
- How to use `Google Code Prettifier` to VBA macro in Microsoft Excel ?
- Add support for AppleScript HOT 1
- White space indentation added on Firefox when using linenums class
- Performance problem with "Hit Test" in Chrome HOT 1
- Wrong highlighting on stackoverflow.com vba if default is used HOT 1
- Extra white-space appears on the first line HOT 1
- XSS risks?
- Request: terraform / hcl language support HOT 2
- Golang run-on string when backticks appear to be escaped
- Makefile: is it really supported?
- Request support of ChoiceScript language
- Added 'record' among Java keywords
- How auto justify codes?
- Request support for DigitalMicrograph Scripting language (DM-script)
- Add support to MiniZinc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code-prettify.