Skip to content

Commit 7f685c0

Browse files
author
jared
committed
Changed syntax.md to have more consistent naming.
1 parent e1756cf commit 7f685c0

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

docs/syntax.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ keyword -> 'module' | 'sum' | 'prod' | 'record'
6363
| 'qualified' | 'as'
6464
modulename -> uppercamelcase
6565
longmodulename -> long modulename
66-
tyname -> uppercamelcase
66+
typename -> uppercamelcase
6767
fieldname -> lowercamelcase\keyword
68-
longtyname -> long tyname
68+
longtypename -> long typename
6969
varname -> lowers\keyword
7070
punctuation -> '<=' | ',' | '(' | ')' | '{' | '}'
7171
| ':' | ':-' | '=' | '|'
@@ -108,7 +108,7 @@ Imports bring *entities* (types and classes) of other modules into scope.
108108

109109
```text
110110
import -> 'import' [ 'qualified' ] longmodulename [ 'as' longmodulename ] [ importspec ]
111-
importspec -> '(' [ { tyname ',' } tyname [','] ] ')'
111+
importspec -> '(' [ { typename ',' } typename [','] ] ')'
112112
```
113113

114114
If `importspec` is omitted, then all entities specified in the module are imported; otherwise only the specified entities are imported.
@@ -135,10 +135,10 @@ typedef -> prodtypedef | sumtypedef | recordtypedef | opaquetypedef
135135
A product type definition defines a new product type.
136136

137137
```text
138-
prodtypedef -> 'prod' tyname { varname } '=' prod
139-
prod -> { tyexpr }
140-
tyexpr -> varname
141-
| longtyname
138+
prodtypedef -> 'prod' typename { varname } '=' prod
139+
prod -> { typeexp }
140+
typeexp -> varname
141+
| longtypename
142142
| '(' prod ')'
143143
```
144144

@@ -148,9 +148,9 @@ Product type definitions instruct the code generator to generate a product type
148148
A sum type definition defines a new sum type.
149149

150150
```text
151-
sumtypedef -> 'sum' tyname { varname } '=' sum
151+
sumtypedef -> 'sum' typename { varname } '=' sum
152152
sum -> sumconstructor { '|' sumconstructor }
153-
sumconstructor -> tyname prod
153+
sumconstructor -> typename prod
154154
```
155155

156156
Sum type definitions instruct the code generator to generate a sum type for the target language.
@@ -159,18 +159,18 @@ Sum type definitions instruct the code generator to generate a sum type for the
159159
A record type definition defines a new record type.
160160

161161
```text
162-
recordtypedef -> 'record' tyname { varname } '=' record
162+
recordtypedef -> 'record' typename { varname } '=' record
163163
record -> '{' [ field { ',' field } ] '}'
164164
field -> fieldname ':' prod
165165
````
166166
167167
Record type definitions instruct the code generator to generate a record type for the target language.
168168
169-
##### Opaque type
169+
##### Opaque type definition
170170
An opaque type definition defines a new opaque type.
171171
172172
```text
173-
opaquetypedef -> 'opaque' tyname { varname }
173+
opaquetypedef -> 'opaque' typename { varname }
174174
```
175175

176176
Opaque type definitions do not instruct the code generator to generate code, and an opaque type must be instead implemented in the target language.
@@ -194,7 +194,7 @@ An instance clause specifies a type is an instance of a class.
194194

195195
```text
196196
instanceclause -> 'instance' constraint [ ':-' constraintexps ]
197-
constraint -> classref { tyexpr }
197+
constraint -> classref { typeexp }
198198
```
199199

200200
Instance clauses do not instruct the code generator to generate code, but
@@ -218,7 +218,7 @@ The summarized productions of a LambdaBuffers file is as follows.
218218
module -> 'module' longmodulename { import } { statement }
219219
220220
import -> 'import' [ 'qualified' ] longmodulename [ 'as' longmodulename ] [ importspec ]
221-
importspec -> '(' [ { tyname ',' } tyname [','] ] ')'
221+
importspec -> '(' [ { typename ',' } typename [','] ] ')'
222222
223223
statement -> typedef
224224
| classdef
@@ -227,29 +227,29 @@ statement -> typedef
227227
228228
typedef -> prodtypedef | sumtypedef | recordtypedef | opaquetypedef
229229
230-
prodtypedef -> 'prod' tyname { varname } '=' prod
231-
prod -> { tyexpr }
232-
tyexpr -> varname
233-
| longtyname
230+
prodtypedef -> 'prod' typename { varname } '=' prod
231+
prod -> { typeexp }
232+
typeexp -> varname
233+
| longtypename
234234
| '(' prod ')'
235235
236-
sumtypedef -> 'sum' tyname { varname } '=' sum
236+
sumtypedef -> 'sum' typename { varname } '=' sum
237237
sum -> sumconstructor { '|' sumconstructor }
238-
sumconstructor -> tyname prod
238+
sumconstructor -> typename prod
239239
240-
recordtypedef -> 'record' tyname { varname } '=' record
240+
recordtypedef -> 'record' typename { varname } '=' record
241241
record -> '{' [ field { ',' field } ] '}'
242242
field -> fieldname ':' prod
243243
244-
opaquetypedef -> 'opaque' tyname { varname }
244+
opaquetypedef -> 'opaque' typename { varname }
245245
246246
classdef -> 'class' [ constraintexps '<=' ] classname { varname }
247247
constraintexp -> classref { varname }
248248
| '(' constraintexps ')'
249249
constraintexps -> [ constraintexp { ',' constraintexp } ]
250250
251251
instanceclause -> 'instance' constraint [ ':-' constraintexps ]
252-
constraint -> classref { tyexpr }
252+
constraint -> classref { typeexp }
253253
254254
deriveclause -> 'derive' constraint
255255
```

0 commit comments

Comments
 (0)