-# Literals
+## Literals
"foo"
'a'
1.0
# Definition and assignment
def foo 5 ;
-set foo 6 ;
+set! foo 6 ;
def foo 5 end
-set foo 6 end
+set! foo 6 end
-# Special function definition shorthand
-def max(a, b) if (a > b) a else b ;;
+# Special function definition shorthand (not yet supported)
+#def max(a, b)
+# if (a > b) a b;
+#end
# If statement
if conditional
func (a, b) foo(a, b) ;
func (a, b, c) foo(a, b, c) ;
-# Macro expressions
-macro () ;
-macro (a) ;
-macro (a, b) ;
-macro (a, b, c) ;
-macro () foo(a) ;
-macro (a) foo(a) ;
-macro (a, b) foo(a, b) ;
-macro (a, b, c) foo(a, b, c) ;
-
-# Quoting Expressions
-#quote( (1 + 1) )
+## Macro expressions (not yet supported)
+#macro () ;
+#macro (a) ;
+#macro (a, b) ;
+#macro (a, b, c) ;
+#macro () foo(a) ;
+#macro (a) foo(a) ;
+#macro (a, b) foo(a, b) ;
+#macro (a, b, c) foo(a, b, c) ;
-# Syntactic Extensions
+# Syntactic Extensions (not yet supported)
#syntax let ( := = ) ;
# ( a := b )
# define a b ;
# ( a = b )
# set! a b ;
#end
-
+#
#let foo := "bar" ;
#let foo = 5 ;
-(include "loop.scm")
-(declare (uses buf)
- (uses lexer)
+(declare
+
(uses parser))
+(define (parse-file fname)
+ (define result
+ (dlang/program (dlang/lexer (open-input-file fname))))
+ (print result))
+
+; If we have a file, then parse it
+(if (= 1 (length (command-line-arguments)))
+ (parse-file (car (command-line-arguments)))
+ (print "No input file provided."))
+