On 23/04/20 10:43, Philippe Mathieu-Daudé wrote:
>>
>> You can add CONFIG_SEMIHOSTING=y directly in the Kconfig file.
> 
> I didn't know because it is not documented and no examples, but I the
> code is here:
> 
>     # assignment_var: ID (starting with "CONFIG_")
>     def parse_assignment_var(self):
>         if self.tok == TOK_ID:
>             val = self.val
>             if not val.startswith("CONFIG_"):
>                 raise KconfigParserError(self,
>                            'Expected identifier starting with
> "CONFIG_"', TOK_NONE)
>             self.get_token()
>             return self.data.do_var(val[7:])
>         else:
>             raise KconfigParserError(self, 'Expected identifier')
> 
>     # assignment: var EQUAL y_or_n
>     def parse_assignment(self):
>         var = self.parse_assignment_var()
>         if self.tok != TOK_EQUAL:
>             raise KconfigParserError(self, 'Expected "="')
>         self.get_token()
>         self.data.do_assignment(var, self.parse_y_or_n())
> 
> Thanks!

Well yeah, it's a bit of a hack and simply the simplest way to implement
it.  If it turns out that there are other ways to achieve what you need,
it's better.

Paolo


Reply via email to