groovy - why we don't need to add quotes to the name of gradle task when we declare it -


i ve seen grammar of groovy language , don't understand why don't need add quotes name of gradle task when declare like: task hello (type : defaulttask) { } ve tried in groovy project , found it's illegal, how gradle makes works. , don't understand expression above neither, why can add '(type : defaulttask)', how can analyze groovy grammar?

as example in groovyconsole runnable form, can define bit of code thusly:

// set base class our dsl  @basescript(mydsl) import groovy.transform.basescript  // deal people class person {      string name     closure method     string tostring() { "$name" }     person(string name, closure cl) {         this.name = name         this.method = cl         this.method.delegate =     }     def greet(string greeting) {         println "$greeting $name"     } }  //  , our base dsl class  abstract class mydsl extends script {     def methodmissing(string name, args) {         return new person(name, args[0])     }      def person(person p) {         p.method(p)     } }  // our actual script  person tim {     greet 'hello' } 

so when script @ bottom executed, prints hello tim stdout

but david's answer correct one, example

see here in documentation groovy