nitlang / nit

Nit language
http://nitlanguage.org
Apache License 2.0
242 stars 67 forks source link

Pragma line for Nit #2079

Open privat opened 8 years ago

privat commented 8 years ago

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
jcbrinfo commented 8 years ago

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

jcbrinfo commented 8 years ago

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)"