From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 3D7151F461 for ; Wed, 15 May 2019 17:46:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727424AbfEORqW (ORCPT ); Wed, 15 May 2019 13:46:22 -0400 Received: from bsmtp7.bon.at ([213.33.87.19]:50433 "EHLO bsmtp7.bon.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726466AbfEORqW (ORCPT ); Wed, 15 May 2019 13:46:22 -0400 Received: from dx.site (unknown [93.83.142.38]) by bsmtp7.bon.at (Postfix) with ESMTPSA id 45426M3GsHz5tlC; Wed, 15 May 2019 19:46:19 +0200 (CEST) Received: from [IPv6:::1] (localhost [IPv6:::1]) by dx.site (Postfix) with ESMTP id D6BDF496D; Wed, 15 May 2019 19:46:18 +0200 (CEST) Subject: Re: [PATCH v3] userdiff.c & doc/gitattributes.txt: add Octave To: "LI, BO XUAN" Cc: git@vger.kernel.org, =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , philipoakley@iee.org References: <20190511041331.51642-1-liboxuan@connect.hku.hk> From: Johannes Sixt Message-ID: Date: Wed, 15 May 2019 19:46:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 15.05.19 um 08:15 schrieb LI, BO XUAN: > On Wed, May 15, 2019 at 1:57 PM Johannes Sixt wrote: >> >> Am 11.05.19 um 06:13 schrieb Boxuan Li: >>> Octave pattern is almost the same as matlab. Besides, >>> octave also uses '%%%' or '##' to begin code sections. >>> >> >>> @@ -60,6 +60,11 @@ PATTERNS("java", >>> PATTERNS("matlab", >>> "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$", >>> "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"), >>> +PATTERNS("octave", >>> + /* Mostly the same as matlab. In addition, Octave >>> + * supports '##' and '%%%' for code sections */ >>> + "^[[:space:]]*((classdef|function)[[:space:]].*)$|^(%%%?|##)[[:space:]].*$", >>> + "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"), >>> PATTERNS("objc", >>> /* Negate C statements that can look like functions */ >>> "!^[ \t]*(do|for|if|else|return|switch|while)\n" >>> >> >> In Matlab, are %%% and ## valid syntax? If not, instead of introducing a >> new language, please just extend the Matlab rule to treat %%% and ## as >> you need for Octave and mark your Octave files as Matlab. > > '##' is not valid syntax in Matlab scripts. > > '%%%' is valid syntax in Matlab. However, it is not used as a section divider. In Matlab, is %%% followed by space at the beginning of a line *commonly* used for something different? If I were to make a guess, I would say no. If I'm right, it does not hurt to merge the Octave rules into the Matlab rules. -- Hannes