mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
do not allow import builtin
This commit is contained in:
@@ -133,6 +133,9 @@ fn (p mut Parser) parse() {
|
|||||||
for p.tok == IMPORT && p.peek() != CONST {
|
for p.tok == IMPORT && p.peek() != CONST {
|
||||||
p.import_statement()
|
p.import_statement()
|
||||||
}
|
}
|
||||||
|
if p.table.imports.contains('builtin') {
|
||||||
|
p.error('module `builtin` cannot be imported')
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Go through every top level token or throw a compilation error if a non-top level token is met
|
// Go through every top level token or throw a compilation error if a non-top level token is met
|
||||||
@@ -220,7 +223,7 @@ fn (p mut Parser) parse() {
|
|||||||
out := os.create('/var/tmp/fmt.v') or {
|
out := os.create('/var/tmp/fmt.v') or {
|
||||||
panic('failed to create fmt.v')
|
panic('failed to create fmt.v')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
out.writeln(p.scanner.fmt_out.str())
|
out.writeln(p.scanner.fmt_out.str())
|
||||||
out.close()
|
out.close()
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +0,0 @@
|
|||||||
module pg
|
|
||||||
|
|
||||||
#flag -I/usr/include/postgresql
|
|
||||||
// #flag `pkg-config --cflags libpq`
|
|
@@ -1,2 +0,0 @@
|
|||||||
module pg
|
|
||||||
|
|
Reference in New Issue
Block a user