do not allow `import builtin`

pull/989/head
Alexander Medvednikov 2019-07-04 17:36:53 +02:00
parent 8f10e37370
commit 300ed59598
3 changed files with 4 additions and 7 deletions

View File

@ -133,6 +133,9 @@ fn (p mut Parser) parse() {
for p.tok == IMPORT && p.peek() != CONST {
p.import_statement()
}
if p.table.imports.contains('builtin') {
p.error('module `builtin` cannot be imported')
}
return
}
// 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 {
panic('failed to create fmt.v')
return
}
}
out.writeln(p.scanner.fmt_out.str())
out.close()
}

View File

@ -1,4 +0,0 @@
module pg
#flag -I/usr/include/postgresql
// #flag `pkg-config --cflags libpq`

View File

@ -1,2 +0,0 @@
module pg