{"action":"created","issue":{"url":"https://api.github.com/repos/sirthias/parboiled2/issues/149","labels_url":"https://api.github.com/repos/sirthias/parboiled2/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/sirthias/parboiled2/issues/149/comments","events_url":"https://api.github.com/repos/sirthias/parboiled2/issues/149/events","html_url":"https://github.com/sirthias/parboiled2/issues/149","id":89153648,"number":149,"title":"null pointer trying to run a basic example?","user":{"login":"jwaldrop","id":316149,"avatar_url":"https://avatars.githubusercontent.com/u/316149?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaldrop","html_url":"https://github.com/jwaldrop","followers_url":"https://api.github.com/users/jwaldrop/followers","following_url":"https://api.github.com/users/jwaldrop/following{/other_user}","gists_url":"https://api.github.com/users/jwaldrop/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaldrop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaldrop/subscriptions","organizations_url":"https://api.github.com/users/jwaldrop/orgs","repos_url":"https://api.github.com/users/jwaldrop/repos","events_url":"https://api.github.com/users/jwaldrop/events{/privacy}","received_events_url":"https://api.github.com/users/jwaldrop/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-17T23:37:25Z","updated_at":"2015-06-18T15:11:43Z","closed_at":"2015-06-18T15:11:36Z","body":"With the following code, depending on parboiled 2.1.0, I get a null pointer exception trying to create my parser:\r\n\r\n```scala\r\nimport org.parboiled2._\r\n\r\nclass MyParser(val input: ParserInput) extends Parser {\r\n  val number = rule { oneOrMore(\"0\" - \"9\") }\r\n}\r\n\r\nobject MyParser {\r\n  def main(args: Array[String]) {\r\n    val parser = new MyParser(\"111\") // null pointer here\r\n    parser.number.run() match {\r\n      case _ => print(\"woot\")\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThe following exception is thrown running the main method:\r\n\r\n```\r\nException in thread \"main\" java.lang.NullPointerException\r\n\tat org.parboiled2.Parser.__saveState(Parser.scala:252)\r\n\tat com.fitbit.perf_sampler.parser.StackParser.<init>(StackParser.scala:11)\r\n\tat com.fitbit.perf_sampler.parser.RunMe$.main(StackParser.scala:25)\r\n\tat com.fitbit.perf_sampler.parser.RunMe.main(StackParser.scala)\r\n```\r\n\r\nSpecifically in the line below valueStack is null.\r\n\r\n```scala\r\n  def __saveState: Mark = new Mark((_cursor.toLong << 32) + (_cursorChar.toLong << 16) + valueStack.size)\r\n```\r\n\r\nIt seems likely that the examples are out of date, but I haven't been able to find anything that corresponds with 2.1 -- any pointers?\r\n"},"comment":{"url":"https://api.github.com/repos/sirthias/parboiled2/issues/comments/113188255","html_url":"https://github.com/sirthias/parboiled2/issues/149#issuecomment-113188255","issue_url":"https://api.github.com/repos/sirthias/parboiled2/issues/149","id":113188255,"user":{"login":"jwaldrop","id":316149,"avatar_url":"https://avatars.githubusercontent.com/u/316149?v=3","gravatar_id":"","url":"https://api.github.com/users/jwaldrop","html_url":"https://github.com/jwaldrop","followers_url":"https://api.github.com/users/jwaldrop/followers","following_url":"https://api.github.com/users/jwaldrop/following{/other_user}","gists_url":"https://api.github.com/users/jwaldrop/gists{/gist_id}","starred_url":"https://api.github.com/users/jwaldrop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwaldrop/subscriptions","organizations_url":"https://api.github.com/users/jwaldrop/orgs","repos_url":"https://api.github.com/users/jwaldrop/repos","events_url":"https://api.github.com/users/jwaldrop/events{/privacy}","received_events_url":"https://api.github.com/users/jwaldrop/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T15:11:43Z","updated_at":"2015-06-18T15:11:43Z","body":"Thanks!"}}