Add 'type_identifier' alias
This is more appropriate, and actually closer to the specified grammar.
This commit is contained in:
parent
6e40691a35
commit
2be5056793
6 changed files with 140 additions and 86 deletions
|
|
@ -18,7 +18,7 @@ type alias = int
|
|||
(type_declaration
|
||||
name: (identifier)
|
||||
value: (type_alias
|
||||
(identifier))))
|
||||
(type_identifier))))
|
||||
|
||||
================================================================================
|
||||
Record type declaration
|
||||
|
|
@ -146,7 +146,7 @@ function func(a: int, b: int) : string = "string"
|
|||
type: (identifier)
|
||||
name: (identifier)
|
||||
type: (identifier))
|
||||
return_type: (identifier)
|
||||
return_type: (type_identifier)
|
||||
body: (string_literal)))
|
||||
|
||||
================================================================================
|
||||
|
|
@ -204,7 +204,7 @@ primitive prim() : int
|
|||
(primitive_declaration
|
||||
name: (identifier)
|
||||
parameters: (parameters)
|
||||
return_type: (identifier)))
|
||||
return_type: (type_identifier)))
|
||||
|
||||
================================================================================
|
||||
Variable declaration
|
||||
|
|
@ -230,7 +230,7 @@ var a : int := 27
|
|||
(source_file
|
||||
(variable_declaration
|
||||
name: (identifier)
|
||||
type: (identifier)
|
||||
type: (type_identifier)
|
||||
value: (integer_literal)))
|
||||
|
||||
================================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue