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
What is the best way to check whether a string is a template, i.e. whether it contains template syntax? I've looked into Environment.lex(...) to get the tokens and derive the check from that information by checking whether there is any token of type other than data in the tokens list:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What is the best way to check whether a string is a template, i.e. whether it contains template syntax? I've looked into
Environment.lex(...)
to get the tokens and derive the check from that information by checking whether there is any token of type other thandata
in the tokens list:Is this approach correct and is there anything easier I could do? And would it be an interesting feature to be added to the library?
Beta Was this translation helpful? Give feedback.
All reactions