Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Allow 'inline' keyword in declarations #84

Closed
jyn514 opened this issue Oct 3, 2019 · 2 comments · Fixed by #145
Closed

Allow 'inline' keyword in declarations #84

jyn514 opened this issue Oct 3, 2019 · 2 comments · Fixed by #145
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@jyn514
Copy link
Owner

jyn514 commented Oct 3, 2019

For now, it should just be a no-op.

static inline void f(); 
<stdin>:1:8: error: expected variable name or '(', got 'inline'
@jyn514 jyn514 added enhancement New feature or request good first issue Good for newcomers labels Oct 3, 2019
@jyn514 jyn514 added this to the MVP milestone Oct 3, 2019
@jyn514 jyn514 mentioned this issue Oct 7, 2019
8 tasks
@jyn514
Copy link
Owner Author

jyn514 commented Nov 25, 2019

Steps to get started:

  1. Optionally, parse inline as a Qualifier in declaration_specifier
  2. Give an error for inline int a in declarator
  3. Write some test cases in tests/runner-tests/decls/

@jyn514
Copy link
Owner Author

jyn514 commented Nov 25, 2019

Current behavior:

$ RUST_BACKTRACE=1 cargo run
    Finished dev [unoptimized] target(s) in 0.54s
     Running `target/debug/rcc`
int main(restrict int *p);
thread 'main' panicked at 'unrecognized declaration specifier restrict', src/parse/decl.rs:1486:25
stack backtrace:
  13: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declaration_specifier::{{closure}}
  14: core::result::Result<T,E>::unwrap_or_else
  15: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declaration_specifier
  16: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declaration_specifiers
  17: rcc::parse::decl::<impl rcc::parse::Parser<I>>::parameter_type_list
  18: rcc::parse::decl::<impl rcc::parse::Parser<I>>::postfix_type
  19: rcc::parse::decl::<impl rcc::parse::Parser<I>>::direct_declarator
  20: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declarator
  21: rcc::parse::decl::<impl rcc::parse::Parser<I>>::declaration
  22: <rcc::parse::Parser<I> as core::iter::traits::iterator::Iterator>::next::{{closure}}
  23: core::option::Option<T>::or_else
  24: <rcc::parse::Parser<I> as core::iter::traits::iterator::Iterator>::next
  25: rcc::compile
  26: rcc::real_main
  27: rcc::main

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant