Merge pull request #1194 from AleoHQ/abnf

[ABNF] Make the lexical grammar slightly less ambiguous.
This commit is contained in:
Alessandro Coglio 2021-07-27 09:19:51 -07:00 committed by GitHub
commit 13d14f65e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

Binary file not shown.

View File

@ -395,7 +395,6 @@ keyword = %s"address"
/ %s"console"
/ %s"const"
/ %s"else"
/ %s"false"
/ %s"field"
/ %s"for"
/ %s"function"
@ -416,7 +415,6 @@ keyword = %s"address"
/ %s"self"
/ %s"static"
/ %s"string"
/ %s"true"
/ %s"u8"
/ %s"u16"
/ %s"u32"
@ -448,7 +446,8 @@ hexadecimal-digit = digit / "a" / "b" / "c" / "d" / "e" / "f"
; because that is used for address literals:
; this is another extra-grammatical requirement.
identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
identifier = letter *( letter / digit / "_" )
; but not a keyword or a boolean literal or aleo1...
; A package name consists of one or more segments separated by single dashes,
; where each segment is a non-empty sequence of lowercase letters and digits.
@ -457,7 +456,7 @@ identifier = letter *( letter / digit / "_" ) ; but not a keyword or aleo1...
package-name = lowercase-letter *( lowercase-letter / digit )
*( "-" 1*( lowercase-letter / digit ) )
; but not a keyword or aleo1...
; but not a keyword or a boolean literal or aleo1...
; Note that, grammatically, identifiers are also package names.
; They are disambiguated from context, based on the syntactic grammar.