This was causing newlines in go and javascript to be parsed as meaningless separator characters instead of statement terminators
41 lines
No EOL
958 B
Text
41 lines
No EOL
958 B
Text
==========================================
|
|
parses trivial programs
|
|
==========================================
|
|
package trivial
|
|
|
|
type x int64
|
|
var y = ""
|
|
func z() {}
|
|
---
|
|
(program
|
|
(package_directive (package_name))
|
|
(type_declaration (type_name) (type_name))
|
|
(var_declaration (var_name) (string))
|
|
(func_declaration (var_name) (statement_block)))
|
|
|
|
==========================================
|
|
parses comments
|
|
==========================================
|
|
package trivial
|
|
|
|
func main() {
|
|
// do stuff
|
|
}
|
|
---
|
|
(program
|
|
(package_directive (package_name))
|
|
(func_declaration (var_name) (statement_block
|
|
(comment))))
|
|
|
|
==========================================
|
|
handles indented code after blocks
|
|
=========================================
|
|
package trivial
|
|
|
|
func one() {}
|
|
func two() {}
|
|
---
|
|
(program
|
|
(package_directive (package_name))
|
|
(func_declaration (var_name) (statement_block))
|
|
(func_declaration (var_name) (statement_block))) |