This commit is contained in:
parent
db9e27dffd
commit
b68380f09b
2 changed files with 8 additions and 0 deletions
|
|
@ -2035,6 +2035,8 @@ proc evalInclude(c: PContext, n: PNode): PNode =
|
||||||
for i in 0 ..< sonsLen(n):
|
for i in 0 ..< sonsLen(n):
|
||||||
var imp: PNode
|
var imp: PNode
|
||||||
let it = n.sons[i]
|
let it = n.sons[i]
|
||||||
|
if it.kind == nkInfix and it.len == 3 and it[0].ident.s != "/":
|
||||||
|
localError(c.config, it.info, "Cannot use '" & it[0].ident.s & "' in 'include'.")
|
||||||
if it.kind == nkInfix and it.len == 3 and it[2].kind == nkBracket:
|
if it.kind == nkInfix and it.len == 3 and it[2].kind == nkBracket:
|
||||||
let sep = it[0]
|
let sep = it[0]
|
||||||
let dir = it[1]
|
let dir = it[1]
|
||||||
|
|
|
||||||
6
tests/modules/tincludeas.nim
Normal file
6
tests/modules/tincludeas.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
discard """
|
||||||
|
errormsg: "Cannot use 'as' in 'include'."
|
||||||
|
line: 6
|
||||||
|
"""
|
||||||
|
|
||||||
|
include foobar as foo
|
||||||
Loading…
Add table
Add a link
Reference in a new issue