Supporting empty programs in datalog languages, fixes pr11140

This commit is contained in:
Jay McCarthy 2010-08-28 15:54:21 -06:00
parent 36c2eea571
commit c24d6f94e7
6 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,7 @@
(datum->syntax #f tok-value (make-srcloc start-pos end-pos))))) (datum->syntax #f tok-value (make-srcloc start-pos end-pos)))))
(grammar (grammar
(program [(statements) $1]) (program [(statements) $1])
(statements [(statement) (list $1)] (statements [() empty]
[(statement statements) (list* $1 $2)]) [(statement statements) (list* $1 $2)])
(statement [(assertion) $1] (statement [(assertion) $1]
[(query) $1] [(query) $1]

View File

@ -38,6 +38,7 @@
[(_ thy-expr stmt ...) [(_ thy-expr stmt ...)
(syntax/loc stx (syntax/loc stx
(parameterize ([current-theory thy-expr]) (parameterize ([current-theory thy-expr])
(void)
(->substitutions (->substitutions
(datalog-stmt-var-selector stmt) (datalog-stmt-var-selector stmt)
(eval-statement (datalog-stmt stmt))) (eval-statement (datalog-stmt stmt)))
@ -48,6 +49,7 @@
[(_ thy-expr stmt ...) [(_ thy-expr stmt ...)
(syntax/loc stx (syntax/loc stx
(parameterize ([current-theory thy-expr]) (parameterize ([current-theory thy-expr])
(void)
(eval-top-level-statement (datalog-stmt stmt)) (eval-top-level-statement (datalog-stmt stmt))
...))])) ...))]))

View File

@ -0,0 +1 @@
#lang datalog

View File

@ -0,0 +1 @@
#lang datalog/sexp