All of lore.kernel.org
 help / color / mirror / Atom feed
* slight oddity in script parser
@ 2008-07-31 23:48 Patrick Georgi
  2008-08-01  4:23 ` Bean
  0 siblings, 1 reply; 11+ messages in thread
From: Patrick Georgi @ 2008-07-31 23:48 UTC (permalink / raw)
  To: grub-devel

Hi,

I forgot this, so sorry for the separate mail:
Currently, the parser expects comments to start at the beginning of the 
line, so "ls /foo # necessary because of baz" doesn't work properly

I think a good scenario would be to have comments start either on "#" at 
pos0, or on " #". This way, ls /foo#bar continues to work.

Also, currently the following is a single comment, which is an unusual 
feature:
# this comment starts here\
and continues on this line


Regards,
Patrick Georgi




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-07-31 23:48 slight oddity in script parser Patrick Georgi
@ 2008-08-01  4:23 ` Bean
  2008-08-01  4:26   ` Stefan Reinauer
  0 siblings, 1 reply; 11+ messages in thread
From: Bean @ 2008-08-01  4:23 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 1, 2008 at 7:48 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
> Hi,
>
> I forgot this, so sorry for the separate mail:
> Currently, the parser expects comments to start at the beginning of the
> line, so "ls /foo # necessary because of baz" doesn't work properly
>
> I think a good scenario would be to have comments start either on "#" at
> pos0, or on " #". This way, ls /foo#bar continues to work.
>
> Also, currently the following is a single comment, which is an unusual
> feature:
> # this comment starts here\
> and continues on this line

Hi,

Actually, # and \ is handled in the read line function, it can't
handle complicated situation.

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:23 ` Bean
@ 2008-08-01  4:26   ` Stefan Reinauer
  2008-08-01  4:34     ` Bean
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Reinauer @ 2008-08-01  4:26 UTC (permalink / raw)
  To: The development of GRUB 2

Bean wrote:
> On Fri, Aug 1, 2008 at 7:48 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
>   
>> Hi,
>>
>> I forgot this, so sorry for the separate mail:
>> Currently, the parser expects comments to start at the beginning of the
>> line, so "ls /foo # necessary because of baz" doesn't work properly
>>
>> I think a good scenario would be to have comments start either on "#" at
>> pos0, or on " #". This way, ls /foo#bar continues to work.
>>
>> Also, currently the following is a single comment, which is an unusual
>> feature:
>> # this comment starts here\
>> and continues on this line
>>     
>
> Hi,
>
> Actually, # and \ is handled in the read line function, it can't
> handle complicated situation.
>   

Are you implying it is wrong there and should be moved to the parser?


-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info@coresystems.de  • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:26   ` Stefan Reinauer
@ 2008-08-01  4:34     ` Bean
  2008-08-01  4:42       ` Stefan Reinauer
  2008-08-01 13:44       ` Robert Millan
  0 siblings, 2 replies; 11+ messages in thread
From: Bean @ 2008-08-01  4:34 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 1, 2008 at 12:26 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
> Bean wrote:
>> On Fri, Aug 1, 2008 at 7:48 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
>>
>>> Hi,
>>>
>>> I forgot this, so sorry for the separate mail:
>>> Currently, the parser expects comments to start at the beginning of the
>>> line, so "ls /foo # necessary because of baz" doesn't work properly
>>>
>>> I think a good scenario would be to have comments start either on "#" at
>>> pos0, or on " #". This way, ls /foo#bar continues to work.
>>>
>>> Also, currently the following is a single comment, which is an unusual
>>> feature:
>>> # this comment starts here\
>>> and continues on this line
>>>
>>
>> Hi,
>>
>> Actually, # and \ is handled in the read line function, it can't
>> handle complicated situation.
>>
>
> Are you implying it is wrong there and should be moved to the parser?

Hi,

In theory, it should be handled by the lexer. but actually, it's not
so easy. lexer already has some issue, adding new handling would not
help.

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:34     ` Bean
@ 2008-08-01  4:42       ` Stefan Reinauer
  2008-08-01  4:47         ` Bean
  2008-08-01 13:44       ` Robert Millan
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Reinauer @ 2008-08-01  4:42 UTC (permalink / raw)
  To: The development of GRUB 2

Bean wrote:
> On Fri, Aug 1, 2008 at 12:26 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
>   
>> Bean wrote:
>>     
>>> On Fri, Aug 1, 2008 at 7:48 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
>>>
>>>       
>>>> Hi,
>>>>
>>>> I forgot this, so sorry for the separate mail:
>>>> Currently, the parser expects comments to start at the beginning of the
>>>> line, so "ls /foo # necessary because of baz" doesn't work properly
>>>>
>>>> I think a good scenario would be to have comments start either on "#" at
>>>> pos0, or on " #". This way, ls /foo#bar continues to work.
>>>>
>>>> Also, currently the following is a single comment, which is an unusual
>>>> feature:
>>>> # this comment starts here\
>>>> and continues on this line
>>>>
>>>>         
>>> Hi,
>>>
>>> Actually, # and \ is handled in the read line function, it can't
>>> handle complicated situation.
>>>
>>>       
>> Are you implying it is wrong there and should be moved to the parser?
>>     
>
> Hi,
>
> In theory, it should be handled by the lexer. but actually, it's not
> so easy. lexer already has some issue, adding new handling would not
> help.
>
>   
So, what's the right way to fix it, then?

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info@coresystems.de  • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:42       ` Stefan Reinauer
@ 2008-08-01  4:47         ` Bean
  2008-08-01 10:32           ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: Bean @ 2008-08-01  4:47 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 1, 2008 at 12:42 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
> Bean wrote:
>> On Fri, Aug 1, 2008 at 12:26 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
>>
>>> Bean wrote:
>>>
>>>> On Fri, Aug 1, 2008 at 7:48 AM, Patrick Georgi <patrick@georgi-clan.de> wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> I forgot this, so sorry for the separate mail:
>>>>> Currently, the parser expects comments to start at the beginning of the
>>>>> line, so "ls /foo # necessary because of baz" doesn't work properly
>>>>>
>>>>> I think a good scenario would be to have comments start either on "#" at
>>>>> pos0, or on " #". This way, ls /foo#bar continues to work.
>>>>>
>>>>> Also, currently the following is a single comment, which is an unusual
>>>>> feature:
>>>>> # this comment starts here\
>>>>> and continues on this line
>>>>>
>>>>>
>>>> Hi,
>>>>
>>>> Actually, # and \ is handled in the read line function, it can't
>>>> handle complicated situation.
>>>>
>>>>
>>> Are you implying it is wrong there and should be moved to the parser?
>>>
>>
>> Hi,
>>
>> In theory, it should be handled by the lexer. but actually, it's not
>> so easy. lexer already has some issue, adding new handling would not
>> help.
>>
>>
> So, what's the right way to fix it, then?

Hi,

Perhaps we should use automatic tool to generate the lexer, like using
bison for the parser. But I recall that Marco encounter some issue
with flex, but I can't remember what it's now.

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:47         ` Bean
@ 2008-08-01 10:32           ` Marco Gerards
  2008-08-01 10:48             ` Bean
  0 siblings, 1 reply; 11+ messages in thread
From: Marco Gerards @ 2008-08-01 10:32 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

Bean <bean123ch@gmail.com> writes:

> Perhaps we should use automatic tool to generate the lexer, like using
> bison for the parser. But I recall that Marco encounter some issue
> with flex, but I can't remember what it's now.

You are right.  I am not happy with the current lexer and would prefer
a generated lexer like flex.  Unfortunately, flex depends on a POSIX
environment.

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01 10:32           ` Marco Gerards
@ 2008-08-01 10:48             ` Bean
  2008-08-01 15:23               ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: Bean @ 2008-08-01 10:48 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 1, 2008 at 6:32 PM, Marco Gerards <mgerards@xs4all.nl> wrote:
> Hi,
>
> Bean <bean123ch@gmail.com> writes:
>
>> Perhaps we should use automatic tool to generate the lexer, like using
>> bison for the parser. But I recall that Marco encounter some issue
>> with flex, but I can't remember what it's now.
>
> You are right.  I am not happy with the current lexer and would prefer
> a generated lexer like flex.  Unfortunately, flex depends on a POSIX
> environment.

Hi,

Which POSIX feature does it use ? Can it be configured using option ?

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01  4:34     ` Bean
  2008-08-01  4:42       ` Stefan Reinauer
@ 2008-08-01 13:44       ` Robert Millan
  2008-08-01 14:17         ` Patrick Georgi
  1 sibling, 1 reply; 11+ messages in thread
From: Robert Millan @ 2008-08-01 13:44 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Aug 01, 2008 at 12:34:20PM +0800, Bean wrote:
> 
> Hi,
> 
> In theory, it should be handled by the lexer. but actually, it's not
> so easy. lexer already has some issue, adding new handling would not
> help.

I'm not familiar with this part of GRUB.  But based on what you say, I think
before we venture into significant redesign of the parser we'd have to evaluate
what do we gain with it.

If it's just to support \ in comments, I think it's not worth the hassle to
implement and later debug any problems it creates.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01 13:44       ` Robert Millan
@ 2008-08-01 14:17         ` Patrick Georgi
  0 siblings, 0 replies; 11+ messages in thread
From: Patrick Georgi @ 2008-08-01 14:17 UTC (permalink / raw)
  To: grub-devel

Robert Millan schrieb:
> If it's just to support \ in comments, I think it's not worth the hassle to
> implement and later debug any problems it creates.
There's also the "comments that don't start at the beginning of the 
line" thing, and it might be that one of the issues in my other mail 
(leading spaces within if/then/else trigger malloc magic failure) is 
related to it. Couldn't pinpoint it yet.
The text corruption thing probably has its roots in the parser, too.


Regards,
Patrick Georgi




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: slight oddity in script parser
  2008-08-01 10:48             ` Bean
@ 2008-08-01 15:23               ` Marco Gerards
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Gerards @ 2008-08-01 15:23 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

Bean <bean123ch@gmail.com> writes:

> On Fri, Aug 1, 2008 at 6:32 PM, Marco Gerards <mgerards@xs4all.nl> wrote:
>> Hi,
>>
>> Bean <bean123ch@gmail.com> writes:
>>
>>> Perhaps we should use automatic tool to generate the lexer, like using
>>> bison for the parser. But I recall that Marco encounter some issue
>>> with flex, but I can't remember what it's now.
>>
>> You are right.  I am not happy with the current lexer and would prefer
>> a generated lexer like flex.  Unfortunately, flex depends on a POSIX
>> environment.
>
> Hi,
>
> Which POSIX feature does it use ? Can it be configured using option ?

Sorry, I do not recall.  IIRC it could not be disabled, otherwise I
would have done that.

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-08-01 15:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-31 23:48 slight oddity in script parser Patrick Georgi
2008-08-01  4:23 ` Bean
2008-08-01  4:26   ` Stefan Reinauer
2008-08-01  4:34     ` Bean
2008-08-01  4:42       ` Stefan Reinauer
2008-08-01  4:47         ` Bean
2008-08-01 10:32           ` Marco Gerards
2008-08-01 10:48             ` Bean
2008-08-01 15:23               ` Marco Gerards
2008-08-01 13:44       ` Robert Millan
2008-08-01 14:17         ` Patrick Georgi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.