enumArgumentForm
enum ArgumentForm: string
Public API: explicitly declared with
@visibility public.How the argument of a declaration was written.
Lemon accepts a { code } block, a "string" or a bare word after the keyword and strips only the delimiters, so the tree records which form it was to write it back the same way.
$file = (new \LemonParser\Parser())->parse("%name Calc\n%token_prefix \"TK_\"\n%include { int x; }\n");
array_map(static fn ($d) => $d->form->value, $file->declarations()) // => ['word', 'string', 'code']Cases§
case Code = 'code'case String = 'string'case Word = 'word'Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 13
TreeDumper::argumentcallsDestructorTest::testLocationcallsDirectiveTest::testLocationcallsTypeDeclarationTest::testLocationcallsLemonGrammarCompilerTestcallsLemonGrammarReaderTestcallsParserTestcallsDeclarationPrinterTest::testArgumentcallsDeclarationPrinterTest::testPrintcallsDeclarationReaderTest::testArgumentcallsDeclarationReaderTest::testReadcallsDeclarationReaderTest::testReadDestructorcallsDeclarationReaderTest::testReadTypecalls
Relations§
Constant reads 6
- class-const LemonParser\Printer\DeclarationPrinter::argument() packages/lemon-parser/src/Printer/DeclarationPrinter.php:62
- class-const LemonParser\Printer\DeclarationPrinter::argument() packages/lemon-parser/src/Printer/DeclarationPrinter.php:63
- class-const LemonParser\Printer\DeclarationPrinter::argument() packages/lemon-parser/src/Printer/DeclarationPrinter.php:64
- class-const LemonParser\Syntax\DeclarationReader::argument() packages/lemon-parser/src/Syntax/DeclarationReader.php:92
- class-const LemonParser\Syntax\DeclarationReader::argument() packages/lemon-parser/src/Syntax/DeclarationReader.php:93
- class-const LemonParser\Syntax\DeclarationReader::argument() packages/lemon-parser/src/Syntax/DeclarationReader.php:94
Type declarations 4
- type LemonParser\Ast\Declaration\Destructor packages/lemon-parser/src/Ast/Declaration/Destructor.php:31
- type LemonParser\Ast\Declaration\Directive packages/lemon-parser/src/Ast/Declaration/Directive.php:33
- type LemonParser\Ast\Declaration\TypeDeclaration packages/lemon-parser/src/Ast/Declaration/TypeDeclaration.php:31
- type LemonParser\Printer\DeclarationPrinter packages/lemon-parser/src/Printer/DeclarationPrinter.php:59