View Issue Details

IDProjectCategoryView StatusLast Update
0000293file[All Projects] Generalpublic2021-11-19 16:49
ReporterYardanicoAssigned Tochristos 
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.40 
Target VersionFixed in Version 
Summary0000293: file is too strict with Nim file detection
Descriptionhttps://bugs.astron.com/view.php?id=273 reported that Nim wasn't in the file database and Nim magic was subsequently added to the `file`, but it's too strict - the current magic definition was clearly written for `koch.nim` specifically, but Nim is a programming language with a lot of possible code.

I think checking for `import` and `let` is enough for some minimal level of detection (if no other language matches that), and then for more accurate checking you can also check for the existence of `proc` or `echo`. I'm aware that quite a lot of languages have both`import` and `let` as keywords, but I think that file's magics would be enough to differentiate between them?
Tagsbug, magic, nim-lang

Activities

christos

2021-10-28 15:49

manager   ~0003660

Well, you know the language better, why don't you propose a patch?

Issue History

Date Modified Username Field Change
2021-10-20 13:01 Yardanico New Issue
2021-10-28 15:49 christos Assigned To => christos
2021-10-28 15:49 christos Status new => assigned
2021-10-28 15:49 christos Status assigned => feedback
2021-10-28 15:49 christos Note Added: 0003660
2021-11-19 16:49 joe733 Tag Attached: magic
2021-11-19 16:49 joe733 Tag Attached: bug
2021-11-19 16:49 joe733 Tag Attached: nim-lang