aboutsummaryrefslogtreecommitdiffstats
path: root/Llk
diff options
context:
space:
mode:
authorlovenunu <benjamin@perche.me>2015-12-14 16:48:09 +0100
committerlovenunu <benjamin@perche.me>2015-12-15 16:36:52 +0100
commite70ece70bffda8a86af0b2764e82b25240c222c4 (patch)
treec9f7aa2b837987416348ddd1f0d17aeb27f8f439 /Llk
parentec0849fd3c1472fbcd86c3c961981f0cfe1f8d39 (diff)
downloadCompiler-e70ece70bffda8a86af0b2764e82b25240c222c4.zip
Compiler-e70ece70bffda8a86af0b2764e82b25240c222c4.tar.gz
Compiler-e70ece70bffda8a86af0b2764e82b25240c222c4.tar.bz2
Fix Llk\Llk::parsePP unrecognized instructions exception
The stream was used in Llk\Llk::parsePP but was not passed to the function: https://github.com/hoaproject/Compiler/blob/master/Llk/Llk.php#L211
Diffstat (limited to 'Llk')
-rw-r--r--Llk/Llk.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/Llk/Llk.php b/Llk/Llk.php
index 9aa92df..fdecfce 100644
--- a/Llk/Llk.php
+++ b/Llk/Llk.php
@@ -140,7 +140,7 @@ class Llk
throw new Compiler\Exception($message . '.', 0);
}
- static::parsePP($pp, $tokens, $rawRules);
+ static::parsePP($pp, $tokens, $rawRules, $stream->getStreamName());
$ruleAnalyzer = new Rule\Analyzer($tokens);
$rules = $ruleAnalyzer->analyzeRules($rawRules);
@@ -151,13 +151,14 @@ class Llk
/**
* Parse PP.
*
- * @param string $pp PP.
- * @param array $tokens Extracted tokens.
- * @param array $rules Extracted raw rules.
+ * @param string $pp PP.
+ * @param array $tokens Extracted tokens.
+ * @param array $rules Extracted raw rules.
+ * @param string $streamName The name of the stream that contains the grammar
* @return void
* @throws \Hoa\Compiler\Exception
*/
- public static function parsePP($pp, &$tokens, &$rules)
+ public static function parsePP($pp, &$tokens, &$rules, $streamName)
{
$lines = explode("\n", $pp);
$tokens = ['default' => []];
@@ -208,7 +209,7 @@ class Llk
1,
[
$line,
- $stream->getStreamName(),
+ $streamName,
$i + 1
]
);