-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Addons and Syntax #1904
Comments
What do you mean? |
@lukeapage Im working on a project, so i pass the less code to parse of window.less.parser(). It returns the parsed object, but i want the array which contains the chunks of the less code. Is there any way of retrieving that array without modifying the less.js like the error. One more advice? I want to use $ instead of @ to differentiate a variable. How can i do that? |
@deviprsd21 and by "the chunks" you mean...? (tokens? rules?) Either way, no, there's no such function/interface in less.js since it's a just a compiler not a Less parsing library.
Find all occurrences of |
I'm not sure why the chunks are useful.. they don't break in predictable |
@seven-phases-max I mean the array that contains chunked less code. the variable named "chunks" @lukeapage I know, i just need them. I can just add a key to parse object and retrieve the chunks but since the project will be dependent on less.js i just don't want to provide a customized less.js. So, there has to be solution for this. |
I want to seperate out the chunker as part of the 2.0 work (see branch and |
@lukeapage i would love to .... 👍 |
@lukeapage have u mentioned that u want to separate out the chunker somewhere, coz i didnt find any?? And u want to separate the chunker in which sense? remove or move to a different place? I would like a detailed expaination |
@seven-phases-max i tried replacing all possible occurences turns out that it shows |
@deviprsd21 obviously it should not be all possible occurrences since the |
Yes the work in moving that out is bot started. Feel free to start it! |
As i working, i thought why can't less have custom syntax. I did some research ... no language has. So, if less supports custom syntax maybe more developers start using less.
These is one of the reasons, if less supports custom syntax where the developer can just change one instance of the differentiating word or char while keeping the less behavior intact, I think it would be really great. |
One more thing i thought of, if the chunks are made global, retrievable and editable outside the parser then one more new feature can come into play that is For example |
As @lukeapage has already mentioned the
Because beside putting compiler performance down to its knees this also would make the language to be a no-language (imagine English where anyone can randomly and arbitrary use French or Russian words. How nous would comprendre each друга?).
Exactly. No comments needed. |
Hmmm........ |
We will support (the possibility for this) with plugins, but we won't be writing something like that - personally I am excited instead by a linting plugin which errors on missing characters. See the plugins story and the 2.0.0 pull request for more info. I've moved moving the chunker to a task on the 2.0.0 pull request so I think I'll close this in favour of those 2. |
Is there a way to get chunks when the less code is passed to the parser?
The text was updated successfully, but these errors were encountered: