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

Add TradingView lexer #166

Merged
merged 1 commit into from
Sep 10, 2018
Merged

Add TradingView lexer #166

merged 1 commit into from
Sep 10, 2018

Conversation

Jos512
Copy link
Contributor

@Jos512 Jos512 commented Sep 10, 2018

This pull request proposes to add a lexer to Chroma for TradingView (https://www.tradingview.com). TradingView is an online website where people can code scripts that analyse or trade financial markets. Here's an overview of their language reference. They claim themselves that 7 million people use their website/tools (although not everyone will be writing scripts).

I've verified the syntax highlight made by this lexer against their online editor, and it matches. I've also cleaned up the regex as much as possible so that performance remains optimal. There's also a test (expected and actual) added.

Let me know if I missed something or if you have comments, suggestions, or questions. I'd happily look into them.

(By the way, just want to say that Chroma is great tool. I'm still starting out with Go but made good progress in little time because of the nice way that Chroma is set up. 🙂 )

Treat ( and ) as text in lexer

Added test files and small change of lexer

Fixed 'err' messages in Chroma output

Removed postfix behind numbers

Was originally from C# lexer, but not needed for TradingView

Improved single comment, punctuation, and operator

Simplified text match, improved punctuation and operators

Add slash to punctuation

Added missing named variables

Added proper test data with .expected file

Added TradingView lexer
@alecthomas alecthomas merged commit d5ca12b into alecthomas:master Sep 10, 2018
@alecthomas
Copy link
Owner

Thanks, and I'm glad you're finding Chroma easy to navigate 👍

@Jos512
Copy link
Contributor Author

Jos512 commented Sep 11, 2018

Thanks for accepting the pull request! 🙂

@Jos512 Jos512 deleted the tradingview branch September 11, 2018 15:15
mrsdizzie pushed a commit to mrsdizzie/chroma that referenced this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants