mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Add single-quoted strings
This commit is contained in:
1 parent
3bfed6d812
commit
9e50918718
14 files changed
+273
-84
No files matched your search
+12
-1
@@ -81,7 +81,8 @@ func (x ID) IsNumLiteral(m *Map) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x ID) IsStrLiteral(m *Map) bool {
|
||||
// IsDQStrLiteral returns whether x is a double-quote string literal.
|
||||
func (x ID) IsDQStrLiteral(m *Map) bool {
|
||||
if x < nBuiltInIDs {
|
||||
return false
|
||||
} else if s := m.ByID(x); s != "" {
|
||||
@@ -90,6 +91,16 @@ func (x ID) IsStrLiteral(m *Map) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IsSQStrLiteral returns whether x is a single-quote string literal.
|
||||
func (x ID) IsSQStrLiteral(m *Map) bool {
|
||||
if x < nBuiltInIDs {
|
||||
return false
|
||||
} else if s := m.ByID(x); s != "" {
|
||||
return s[0] == '\''
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x ID) IsIdent(m *Map) bool {
|
||||
if x < nBuiltInIDs {
|
||||
return minBuiltInIdent <= x && x <= maxBuiltInIdent
|
||||
|
||||
Reference in new issue
Block a user