Ticket #808 (closed patch: fixed)

Opened 13 years ago

Last modified 13 years ago

VIM syntax file: fix parsing of quoted ".end"

Reported by: flh Owned by: jkeenan
Priority: minor Milestone:
Component: none Version: trunk
Severity: medium Keywords: Vim
Cc: Language:
Patch status: applied Platform: all

Description

The vim syntax file for PIR currently treats a quoted '.end' in a string as the PIR .end directive, i.e., in the following example, VIM thinks that the sub ends after $S0 = ":

.sub 'my_sub'
    $S0 = ".end"
    .return ($S0)
.end

The small attached patch to pir_vim.in fixes that (now, sub ends are matched by "\^\s*\.end" instead of simply "\.end"). It also updates the definition for macro ends (.endm) in the same way.

Attachments

pir_vim_end_directives.patch Download (1.0 KB) - added by flh 13 years ago.

Change History

Changed 13 years ago by flh

follow-up: ↓ 2   Changed 13 years ago by jkeenan

I applied your patch in my sandbox and created the following dummy file:

.sub main :main
.end
    
.sub 'my_sub'
    $S0 = ".end"
    .return ($S0)
.end
  
# Local Variables: 
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

I then quit Vim and my terminal program. But I did not get the desired effect. Everything from the string ".end" in line 5 through the end of the file now appears in red.

Am I doing something wrong?

kid51

in reply to: ↑ 1   Changed 13 years ago by jkeenan

  • status changed from new to assigned
  • patch changed from new to applied
  • priority changed from normal to minor
  • platform set to all
  • keywords Vim added
  • owner set to jkeenan
  • type changed from bug to patch

Replying to jkeenan:

I then quit Vim and my terminal program. But I did not get the desired effect. Everything from the string ".end" in line 5 through the end of the file now appears in red. Am I doing something wrong?

On #parrot, flh subsequently informed me that I had to cd editor; make vim-install to refresh the Vim preferences. I did so, and I then got the expected syntax coloring.

Patch applied in r39875; flh++.

kid51

  Changed 13 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.