Comments (4)
If it's already in Go then it's definitely fine to update.
I find that surprising. Why is compiled Go code slower/larger?
This is a bit surprising, but each lexer is a whole bunch of what is effectively dynamic code to the Go compiler, so it a) expands to a very large amount of machine code and b) takes a considerable amount of time to execute at init time. If the Go compiler were a lot smarter this would probably end up being static data sections, but it isn't.
I can't find the heredoc lexing. Can you point me to it? I don't see any << stuff in bash.xml.
Search for <<
. It's a single regex with a backreference.
from chroma.
Look at how the bash lexer does it, it's the same concept.
I will not accept Go lexers unless there's a good reason, you should use XML. Chroma is used by a lot of people who aren't programmers, so XML is a better choice to foster contributions than Go. It's also much much more efficient in terms of binary size and startup time.
from chroma.
I will not accept Go lexers unless there's a good reason, you should use XML.
To be clear, I'm not making a new lexer, only updating an existing one. https://github.com/alecthomas/chroma/blob/master/lexers/caddyfile.go
It's also much much more efficient in terms of binary size and startup time.
I find that surprising. Why is compiled Go code slower/larger?
Look at how the bash lexer does it, it's the same concept.
I can't find the heredoc lexing. Can you point me to it? I don't see any <<
stuff in bash.xml
.
Edit: oh, <<<
🤦♂️
from chroma.
I see the \2
. So it's a single regexp.
Is there a way to do this with state though (push + pop)? I have some other token types I want to handle within the heredoc.
For example, if something like {foo}
appears within the heredoc, I want that to be a LiteralStringEscape
.
from chroma.
Related Issues (20)
- lexers.Analyse does not recognise Dockerfile, whereas quick.Highlight does HOT 1
- Add lexer for Typst HOT 2
- Mojolicious Embedded Perl (`.ep`)
- Kotlin destructuring declarations highlighted as syntax error HOT 2
- DNS / BIND9 Zone files are wrongly highlighted (`err` class) HOT 2
- Add support for Rego HOT 1
- Dependency Dashboard
- Surround whitespace (invisible characters) with tags
- Add mIRC formatter support
- Styles with no text color
- Add support for Lean
- `lexer.Match` does not work as intended HOT 5
- LineHighlight style is incorrect HOT 5
- Support Vector Remap Language
- Docker lexer does not work properly for HEALTHCHECK statements
- SVG Formatter Line Numbers
- Check fails while building with latest Go package on Fedora 39 HOT 1
- Failed tests: github.com/alecthomas/repr/repr.go:83:10: syntax error: unexpected [, expecting ( HOT 1
- Source filenames from linguist `language.yml` HOT 4
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 chroma.