Skip to content

Yul keywords are to greedy #556

Description

@mbenke
ben@trawa:~/work/solcore$ cat tmp/yulkw.solc
function bad() -> () {
   format : word
   assembly {
     format := 0
   }
}ben@trawa:~/work/solcore$ cabal exec sol-core -- -f tmp/yulkw.solc 
error[SC0001]: parse error: unexpected 'm'
  ──> /home/ben/work/solcore/tmp/yulkw.solc:4:9
  │
4 │      format := 0
  │         ^ unexpected token

Proposed fix:

pKeyword is not backtracking:

pKeyword w = lexeme (string w <* notFollowedBy identChar)

change to

pKeyword w = lexeme (try (string w <* notFollowedBy identChar))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions