bugGNU Octave - Bugs: bug #56121, teach lexer to recognize...


bug #56121: teach lexer to recognize "SPDX-License-Identifier" tag as a copyright comment

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 11 Apr 2019 06:21:17 PM UTC  
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  Mike Miller <mtmiller>
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Fri 10 May 2019 07:48:35 PM UTC, comment #3: 

Pushed this change on the default branch


This could certainly be extended in the future to allow the user to specify all kinds of markers for the parser to skip leading comment blocks, but this is good for me for now.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Thu 11 Apr 2019 10:24:31 PM UTC, comment #2: 

I'm OK with accepting additional ways to recognize a comment block as a copyright notice instead of help text.  Maybe we should use a regexp and allow it to be configurable in some way?

John W. Eaton <jwe>
Project Administrator
Thu 11 Apr 2019 06:23:43 PM UTC, comment #1: 

Patch attached.

(file #46750)

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Thu 11 Apr 2019 06:21:17 PM UTC, original submission:  

The "SPDX-License-Identifier" tag is an attempt to create a machine-readable standardized way to mark the license of a source file. Typically this identifier is the first comment line in a source file, script, or data file.


Octave's lexer currently looks for the words "Author" or "Copyright" as the first word in a comment block. I would like to add support for "SPDX-License-Identifier" to serve the same purpose. I will submit an already-tested patch once I have a bug number. This patch will allow a function file that looks like this to work correctly:

## SPDX-License-Identifier: MIT
## Copyright (C) 2019 Mike Miller

## -*- texinfo -*-
## @deftypefn {} {} hello
## Print a hello world message.
## @end deftypefn

function hello ()
  disp ("Hello, world!")

Without this patch, the 'help' function does not find the doc string correctly, the user is forced to reorder the first two lines to put the "Copyright" line first.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #46750:  spdx.patch added by mtmiller (920B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-10 mtmiller StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2019-04-11 mtmiller Attached File- => Added spdx.patch, #46750
        StatusNone => Patch Submitted
    2019-04-11 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top

    Powered by Savane 3.5