mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
lang: add read-only type decorators
This commit is contained in:
1 parent
6e8349129c
commit
f3caf09d77
14 files changed
+132
-77
No files matched your search
+5
-9
@@ -510,9 +510,9 @@ func (p *parser) parseTypeExpr() (*a.TypeExpr, error) {
|
||||
}
|
||||
|
||||
decorator, arrayLength := t.ID(0), (*a.Expr)(nil)
|
||||
switch p.peek1() {
|
||||
case t.IDArray:
|
||||
decorator = t.IDArray
|
||||
switch peek1 := p.peek1(); peek1 {
|
||||
case t.IDArray, t.IDRoarray:
|
||||
decorator = peek1
|
||||
p.src = p.src[1:]
|
||||
|
||||
if x := p.peek1(); x != t.IDOpenBracket {
|
||||
@@ -533,12 +533,8 @@ func (p *parser) parseTypeExpr() (*a.TypeExpr, error) {
|
||||
}
|
||||
p.src = p.src[1:]
|
||||
|
||||
case t.IDSlice:
|
||||
decorator = t.IDSlice
|
||||
p.src = p.src[1:]
|
||||
|
||||
case t.IDTable:
|
||||
decorator = t.IDTable
|
||||
case t.IDRoslice, t.IDRotable, t.IDSlice, t.IDTable:
|
||||
decorator = peek1
|
||||
p.src = p.src[1:]
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user