You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Variables in detached rulesets not visited by visitor? #3205
It appears that not only is the variable visited pre-eval in your example, but it also appears to be replacing. I think somehow a copy of the variable is being created in the process of parsing or creating the DR or DR call, then is eval'd separately.
@jshado1 Were you using @plugin syntax with 2.7.3?
Okay! I figured out that for some reason, MixinCall arguments are not visited. It seems that it's an array of.... objects? instead of nodes? I've fixed it, but would like to fix some of the permissive parsing of custom properties to try parsing a value first. Otherwise you'll get a Variable today, but a Quoted after it's released, and your visitVariable would stop functioning. I'm just now sure how to make the parser "recover" from a bad path. I'm looking to tweak this code that was merged. - See this comment.
So if someone can help me understand how the Less parser works and addresses that comment, I'll do a PR for this fix.
Activity
JakobJingleheimer commentedon May 10, 2018
Also exists in
3.0.0,3.0.1, and3.0.4. Does not exist in2.7.3. I had to revert back.matthew-dean commentedon Jun 22, 2018
The error is confirmed; however, the node definitely is visited. Investigating...
matthew-dean commentedon Jun 22, 2018
It appears that not only is the variable visited pre-eval in your example, but it also appears to be replacing. I think somehow a copy of the variable is being created in the process of parsing or creating the DR or DR call, then is eval'd separately.
@jshado1 Were you using
@pluginsyntax with 2.7.3?JakobJingleheimer commentedon Jun 22, 2018
@matthew-dean I'm just compiling variable overrides into Semantic-Org/Semantic-UI-LESS; I don't know what they're using.
matthew-dean commentedon Jun 22, 2018
@jshado1 Variable overrides.... 🤔 Using a plugin? Why not just set a new value? Are they not globally scoped?
JakobJingleheimer commentedon Jun 23, 2018
Some are not globally scoped. Ex
site.variablesare global, butbutton.variablesapply only tobutton.less. I don't know how they achieve it.matthew-dean commentedon Jun 23, 2018
Okay! I figured out that for some reason,
MixinCallarguments are not visited. It seems that it's an array of.... objects? instead of nodes? I've fixed it, but would like to fix some of the permissive parsing of custom properties to try parsing a value first. Otherwise you'll get aVariabletoday, but aQuotedafter it's released, and yourvisitVariablewould stop functioning. I'm just now sure how to make the parser "recover" from a bad path. I'm looking to tweak this code that was merged. - See this comment.So if someone can help me understand how the Less parser works and addresses that comment, I'll do a PR for this fix.
matthew-dean commentedon Jun 23, 2018
@jshado1 They probably just wrap certain vars and mixins like:
Fixes less#3205, partial 3.0 math regression less#1880
matthew-dean commentedon Jun 24, 2018
Please review the PR - #3228
Fixes #3205, partial 3.0 math regression #1880 (#3228)