Code Monkey home page Code Monkey logo

Comments (5)

parrt avatar parrt commented on June 2, 2024

Hi. Oddly enough, that is correct behavior. <int> It is a StringTemplate expression referring to an attribute called int using the default angle bracket delimiters.

from jetbrains-plugin-st4.

Moritz90 avatar Moritz90 commented on June 2, 2024

Then why doesn't StringTemplate interpret it as such? I get no "undefined attribute" warning and

typeMap ::= [
  "list\<int>": "std::vector\<int>",
  "list\<long>": "std::vector\<long>",
  "list\<float>": "std::vector\<float>",
  "list\<double>": "std::vector\<double>"
]

doesn't work as expected (<if(typeMap.(attribute))> evaluates to false when attribute == "list<double>").

If I change my template to:

typeMap ::= [
  "list<int>": "std::vector\<int>",
  "list<long>": "std::vector\<long>",
  "list<float>": "std::vector\<float>",
  "list<double>": "std::vector\<double>"
]

Then the backslashes appear in the output.

So this is either a bug in StringTemplate itself or in the plugin.

from jetbrains-plugin-st4.

parrt avatar parrt commented on June 2, 2024

It is because of lazy evaluation. bad attrs can only be detected at ST exec time. Those are usueble as templates not just strings...maybe that is the source of confusion. Hmm...let me verify strings can be templates.

from jetbrains-plugin-st4.

Moritz90 avatar Moritz90 commented on June 2, 2024

Ok, in that case both the highlighting and StringTemplate's behavior would make sense. It's still very confusing, though.

from jetbrains-plugin-st4.

parrt avatar parrt commented on June 2, 2024

@Moritz90 I think that this is because the key is just a plain string but the value is interpreted as a template.

from jetbrains-plugin-st4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.