Leavitt/pkg/core/langs.go

43 lines
1.2 KiB
Go

/*
Copyright © 2022 Sameer Rahmani <lxsameer@gnu.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package core
type Lang struct {
Name string
CommentBlockMarker *string
}
var DOUBLE_SLASH = "//"
var POUND_SIGN = "#"
var C_LANG = Lang{"C", &DOUBLE_SLASH}
var CPP_LANG = Lang{"C++", &DOUBLE_SLASH}
var Go_LANG = Lang{"Go", &DOUBLE_SLASH}
var SH = Lang{"Shell", &POUND_SIGN}
var MLIR = Lang{"MLIR", &DOUBLE_SLASH}
var ExtsToLang map[string]*Lang = map[string]*Lang{
"h": &C_LANG,
"c": &C_LANG,
"cc": &C_LANG,
"hpp": &CPP_LANG,
"cpp": &CPP_LANG,
"sh": &SH,
"mlir": &MLIR,
}