nit icon indicating copy to clipboard operation
nit copied to clipboard

Pragma line for Nit

Open privat opened this issue 9 years ago • 2 comments

When generating Nit code, one might want to include some pasted content inside. The question is what syntax to use?

The one of C C++ C# is known but conflicts with comments

https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html https://msdn.microsoft.com/en-us/library/34dk387t.aspx

var a = 1
#line 50 somefile
print 1

privat avatar May 13 '16 21:05 privat

Unused US-ASCII printable characters in Nit lexicon : $&^

jcbrinfo avatar May 14 '16 16:05 jcbrinfo

Source files with the word pragma in them:

$ egrep -r '[^_]pragma' lib src contrib
src/compiler/compiler_ffi.nit:      # The real function MUST be compiled only once, #define pragma only protect the compiler, not the loader
contrib/online_ide/setup/mode-nit.js:           regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"
contrib/online_ide/sources/nit_mode_for_ace/lib_ace_mode/nit_highlight_rules.js:            regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"

jcbrinfo avatar May 14 '16 16:05 jcbrinfo